Merge pull request #162 from Doha2012/master

ui modifications
This commit is contained in:
Eugen 2015-03-11 12:59:18 +02:00
commit e2b46404e0
4 changed files with 43 additions and 7 deletions

View File

@ -8,7 +8,17 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="<c:url value="/resources/datetime-picker.js" />"></script> <script src="<c:url value="/resources/datetime-picker.js" />"></script>
<script src="<c:url value="/resources/validator.js" />"></script> <script src="<c:url value="/resources/validator.js" />"></script>
<style type="text/css">
.btn.disabled{
background-color: #ddd;
border-color: #ddd;
}
.btn.disabled:hover{
background-color: #ddd;
border-color: #ddd;
}
</style>
</head> </head>
<body> <body>
<nav class="navbar navbar-default"> <nav class="navbar navbar-default">
@ -57,8 +67,8 @@
<span class="col-sm-9"><input name="sr" placeholder="Subreddit" class="form-control" value="${post.getSubreddit()}" required data-minlength="3"/></span> <span class="col-sm-9"><input name="sr" placeholder="Subreddit" class="form-control" value="${post.getSubreddit()}" required data-minlength="3"/></span>
</div> </div>
<br><br> <br><br>
<div class="col-sm-3"> <div>
<label>Send replies to my inbox</label> &nbsp; <input type="checkbox" name="sendreplies" value="true" <c:if test="${post.isSendReplies()=='true'}"> checked </c:if> /> <label class="col-sm-3">Send replies to my inbox</label> <span class="col-sm-9"> <input type="checkbox" name="sendreplies" value="true" <c:if test="${post.isSendReplies()=='true'}"> checked </c:if> /></span>
</div> </div>
<br><br> <br><br>

View File

@ -53,7 +53,7 @@
<td><c:out value="${post.getSubmissionResponse()}"/></td> <td><c:out value="${post.getSubmissionResponse()}"/></td>
<td> <td>
<a href="editPost/${post.getId()}" class="btn btn-warning" >Edit</a> <a href="editPost/${post.getId()}" class="btn btn-warning" >Edit</a>
<a href="#" class="btn btn-danger" onclick="deletePost(${post.getId()})">Delete</a> <a href="#" class="btn btn-danger" onclick="confirmDelete(${post.getId()})">Delete</a>
</td> </td>
</tr> </tr>
</c:forEach> </c:forEach>
@ -61,6 +61,12 @@
</div> </div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script> <script>
function confirmDelete(id) {
if (confirm("Do you really want to delete this post?") == true) {
deletePost(id);
}
}
function deletePost(id){ function deletePost(id){
$.ajax({ $.ajax({
url: 'deletePost/'+id, url: 'deletePost/'+id,

View File

@ -8,7 +8,17 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="<c:url value="/resources/datetime-picker.js" />"></script> <script src="<c:url value="/resources/datetime-picker.js" />"></script>
<script src="<c:url value="/resources/validator.js" />"></script> <script src="<c:url value="/resources/validator.js" />"></script>
<style type="text/css">
.btn.disabled{
background-color: #ddd;
border-color: #ddd;
}
.btn.disabled:hover{
background-color: #ddd;
border-color: #ddd;
}
</style>
</head> </head>
<body> <body>
<nav class="navbar navbar-default"> <nav class="navbar navbar-default">
@ -56,8 +66,8 @@
<span class="col-sm-9"><input name="sr" placeholder="Subreddit (e.g. kitten)" class="form-control" required data-minlength="3"/></span> <span class="col-sm-9"><input name="sr" placeholder="Subreddit (e.g. kitten)" class="form-control" required data-minlength="3"/></span>
</div> </div>
<br><br> <br><br>
<div class="col-sm-3"> <div >
<label>Send replies to my inbox</label> &nbsp;<input type="checkbox" name="sendreplies" value="true"/> <label class="col-sm-3">Send replies to my inbox</label> <span class="col-sm-9"><input type="checkbox" name="sendreplies" value="true"/></span>
</div> </div>
<br><br> <br><br>

View File

@ -6,7 +6,17 @@
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="<c:url value="/resources/validator.js" />"></script> <script src="<c:url value="/resources/validator.js" />"></script>
<style type="text/css">
.btn.disabled{
background-color: #ddd;
border-color: #ddd;
}
.btn.disabled:hover{
background-color: #ddd;
border-color: #ddd;
}
</style>
</head> </head>
<body> <body>
<nav class="navbar navbar-default"> <nav class="navbar navbar-default">
@ -54,8 +64,8 @@
<span class="col-sm-9"><input name="sr" placeholder="Subreddit (e.g. kitten)" class="form-control" required data-minlength="3"/></span> <span class="col-sm-9"><input name="sr" placeholder="Subreddit (e.g. kitten)" class="form-control" required data-minlength="3"/></span>
</div> </div>
<br><br> <br><br>
<div class="col-sm-3"> <div>
<label>Send replies to my inbox</label> &nbsp;<input type="checkbox" name="sendreplies" value="true"/> <label class="col-sm-3">Send replies to my inbox</label> <span class="col-sm-9"><input type="checkbox" name="sendreplies" value="true"/></span>
</div> </div>
<br><br> <br><br>