Skip to content

Commit

Permalink
sameip: fix кнопок
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Jul 31, 2024
1 parent a9938a6 commit e289078
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/ru/org/linux/spring/SameIPController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object SameIPController {
class SameIPController(ipBlockDao: IPBlockDao, userService: UserService, userAgentDao: UserAgentDao, sameIpService: SameIpService) {
@ModelAttribute("masks")
def masks: util.List[(String, String)] =
Seq("32" -> "IP", "24" -> "Сеть /24", "16" -> "Сеть /16", "0" -> "Любой IP").asJava
Seq("32" -> "Только IP", "24" -> "Сеть /24", "16" -> "Сеть /16", "0" -> "Любой IP").asJava

@ModelAttribute("scores")
def scores: util.List[(String, String)] =
Expand Down
25 changes: 13 additions & 12 deletions src/main/webapp/WEB-INF/jsp/sameip.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@
<div class="controls">
<input class="input-lg" name="ip" type="search" size="17" maxlength="17" value="${ip}" id="ip-field" pattern="[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+">

<c:forEach items="${masks}" var="v">
<c:if test="${v._1() == mask}">
<button name="mask" value="${v._1()}" type="submit" class="btn btn-selected">${v._2()}</button>
</c:if>
<c:if test="${v._1() != mask}">
<button name="mask" value="${v._1()}" type="submit" class="btn btn-default">${v._2()}</button>
</c:if>
</c:forEach>
<select name="mask" class="btn btn-default" onchange="this.form.submit()">
<c:forEach items="${masks}" var="v">
<c:if test="${v._1() == mask}">
<option value="${v._1()}" selected>${v._2()}</option>
</c:if>
<c:if test="${v._1() != mask}">
<option value="${v._1()}">${v._2()}</option>
</c:if>
</c:forEach>
</select>

<select name="score" class="btn btn-default" onchange="this.form.submit()">
<c:forEach items="${scores}" var="v">
Expand Down Expand Up @@ -242,9 +244,7 @@
</table>
</div>

<c:if test="${ip != null}">

<c:if test="${!hasMask}">
<c:if test="${ip != null and !hasMask}">
<h2>Управление</h2>

<fieldset>
Expand Down Expand Up @@ -310,6 +310,7 @@
</form>
</fieldset>

<c:if test="${empty score}">
<fieldset>
<legend>Удалить темы и сообщения с IP</legend>
<form method="post" action="delip.jsp">
Expand All @@ -327,6 +328,6 @@
<button type="submit" name="del" class="btn btn-danger">del from ip</button>
</form>
</fieldset>
</c:if>
</c:if>
</c:if>
<jsp:include page="/WEB-INF/jsp/footer.jsp"/>

0 comments on commit e289078

Please sign in to comment.