Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Nov 4, 2023
1 parent 9abcded commit 072252f
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import ru.org.linux.spring.dao.MessageText
import ru.org.linux.topic.{TopicPermissionService, TopicPrepareService}
import ru.org.linux.util.{ServletParameterException, StringUtil}

import java.util
import java.util.Optional
import javax.servlet.http.HttpServletRequest
import javax.validation.Valid
Expand All @@ -51,13 +50,6 @@ class AddCommentController(ipBlockDao: IPBlockDao, commentPrepareService: Commen
@ModelAttribute("ipBlockInfo")
def loadIPBlock(request: HttpServletRequest): IPBlockInfo = ipBlockDao.getBlockInfo(request.getRemoteAddr)

@ModelAttribute("modes")
def getModes: util.Map[String, String] = AuthUtil.AuthorizedOpt { currentUser =>
val tmpl = Template.getTemplate

MessageTextService.postingModeSelector(currentUser, tmpl.getFormatMode).asJava
}

/**
* Показ формы добавления ответа на комментарий.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 1998-2022 Linux.org.ru
* Copyright 1998-2023 Linux.org.ru
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down Expand Up @@ -50,9 +50,6 @@ class EditCommentController(commentService: CommentCreateService, msgbaseDao: Ms
@ModelAttribute("ipBlockInfo")
def loadIPBlock(request: HttpServletRequest): IPBlockInfo = ipBlockDao.getBlockInfo(request.getRemoteAddr)

@ModelAttribute("modes")
def getModes: util.Map[String, String] = Map.empty[String, String].asJava

/**
* Показ формы изменения комментария.
*/
Expand Down
1 change: 0 additions & 1 deletion src/main/webapp/WEB-INF/jsp/add.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<%--@elvariable id="group" type="ru.org.linux.group.Group"--%>
<%--@elvariable id="section" type="ru.org.linux.section.Section"--%>
<%--@elvariable id="template" type="ru.org.linux.site.Template"--%>
<%--@elvariable id="modes" type="java.util.Map"--%>
<%--@elvariable id="addportal" type="java.lang.String"--%>
<%--@elvariable id="form" type="ru.org.linux.topic.AddTopicRequest"--%>
<%--@elvariable id="postscoreInfo" type="java.lang.String"--%>
Expand Down
5 changes: 2 additions & 3 deletions src/main/webapp/WEB-INF/jsp/add_comment.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="l" uri="http://www.linux.org.ru" %>
<%--
~ Copyright 1998-2022 Linux.org.ru
~ Copyright 1998-2023 Linux.org.ru
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
Expand Down Expand Up @@ -91,7 +91,6 @@
msg="${add.msg}"
mode="${add.mode}"
form_action_url="${form_action_url}"
postscoreInfo="${postscoreInfo}"
modes="${modes}"/>
postscoreInfo="${postscoreInfo}"/>

<jsp:include page="/WEB-INF/jsp/footer.jsp"/>
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/comment-message.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%@ taglib prefix="l" uri="http://www.linux.org.ru" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
~ Copyright 1998-2022 Linux.org.ru
~ Copyright 1998-2023 Linux.org.ru
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
Expand Down Expand Up @@ -47,6 +47,6 @@
mode="${add.mode}"
ipBlockInfo="${ipBlockInfo}"
form_action_url="${form_action_url}"
postscoreInfo="${preparedMessage.postscoreInfo}" modes="${modes}" />
postscoreInfo="${preparedMessage.postscoreInfo}"/>

<jsp:include page="/WEB-INF/jsp/footer.jsp"/>
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/edit_comment.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="l" uri="http://www.linux.org.ru" %>
<%--
~ Copyright 1998-2022 Linux.org.ru
~ Copyright 1998-2023 Linux.org.ru
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
Expand Down Expand Up @@ -57,6 +57,6 @@
mode="${add.mode}"
form_action_url="${form_action_url}"
cancel="true"
postscoreInfo="${postscoreInfo}" modes="${modes}" />
postscoreInfo="${postscoreInfo}"/>

<jsp:include page="/WEB-INF/jsp/footer.jsp"/>
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/jsp/view-topic.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
mode="${template.formatMode}"
ipBlockInfo="${ipBlockInfo}"
form_action_url="${form_action_url}"
postscoreInfo="${preparedMessage.postscoreInfo}" modes="${modes}" />
postscoreInfo="${preparedMessage.postscoreInfo}"/>
</div>
</c:if>

Expand Down
1 change: 0 additions & 1 deletion src/main/webapp/WEB-INF/tags/commentForm.tag
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<%@ attribute name="cancel" required="false" type="java.lang.Boolean" %>
<%@ attribute name="ipBlockInfo" required="false" type="ru.org.linux.auth.IPBlockInfo" %>
<%@ attribute name="postscoreInfo" required="true" type="java.lang.String" %>
<%@ attribute name="modes" required="true" type="java.util.Map" %>

<form:form modelAttribute="add" method="POST" action="${form_action_url}" id="commentForm">
<lor:csrf/>
Expand Down

0 comments on commit 072252f

Please sign in to comment.