-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #456 from support-project/feature/issue123_attachfile
Feature/issue123 attachfile
- Loading branch information
Showing
11 changed files
with
99 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 61 additions & 11 deletions
72
src/main/webapp/WEB-INF/views/open/knowledge/partials/partials-view-attach-files.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,70 @@ | ||
<%@page import="org.support.project.common.util.StringUtils"%> | ||
<%@page import="org.support.project.knowledge.logic.KnowledgeLogic"%> | ||
<%@page import="org.support.project.web.util.JspUtil"%> | ||
<%@page pageEncoding="UTF-8" isELIgnored="false" session="false" errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%> | ||
<%@page import="java.util.List"%> | ||
<%@page import="org.support.project.web.util.JspUtil"%> | ||
<%@page import="org.support.project.common.util.StringUtils"%> | ||
<%@page import="org.support.project.knowledge.vo.UploadFile"%> | ||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> | ||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | ||
|
||
<% JspUtil jspUtil = new JspUtil(request, pageContext); %> | ||
|
||
<c:forEach var="file" items="${files}"> | ||
<c:if test="${file.commentNo == 0}"> | ||
<div class="downloadfile"> | ||
<img src="<%=jspUtil.out("file.thumbnailUrl")%>" /> <a href="<%=jspUtil.out("file.url")%>"> <%=jspUtil.out("file.name")%> | ||
</a> | ||
</div> | ||
</c:if> | ||
</c:forEach> | ||
<% int MAX_COUNT = 5; %> | ||
|
||
<div class="panel panel-primary"> | ||
<div class="panel-heading" style="cursor: move;"> | ||
<h4 class="panel-title"> | ||
<i class="fa fa-download"></i> <%= jspUtil.label("knowledge.view.label.attach") %> | ||
| ||
<% | ||
int num = 0; | ||
List<UploadFile> attachs = jspUtil.getValue("files", List.class); | ||
for (int i = 0; i < attachs.size(); i++) { | ||
UploadFile attach = attachs.get(i); | ||
if (attach.getCommentNo() == null || attach.getCommentNo() == 0) { | ||
num++; | ||
} | ||
} | ||
%> | ||
- [<%= num %>] | ||
</h4> | ||
</div> | ||
<div class="panel-body"> | ||
<% | ||
int count = 0; | ||
String hide = ""; | ||
%> | ||
<c:forEach var="file" items="${files}" > | ||
<% count++; %> | ||
<c:if test="${file.commentNo == 0}"> | ||
<% | ||
if (count > MAX_COUNT) { | ||
hide = "hide"; | ||
} | ||
%> | ||
<div class="row"> | ||
<div class="downloadfile <%= hide %>"> | ||
<div class="col-xs-1"> | ||
<a href="<%=jspUtil.out("file.url")%>"> | ||
<img src="<%=jspUtil.out("file.thumbnailUrl")%>" width="20"/> | ||
</a> | ||
</div> | ||
<div class="col-xs-10"> | ||
<a href="<%=jspUtil.out("file.url")%>"> <%=jspUtil.out("file.name")%></a> | ||
</div> | ||
</div> | ||
</div> | ||
</c:if> | ||
</c:forEach> | ||
<% if (count > MAX_COUNT) { %> | ||
<div class="text-right"> | ||
<a id="more_attach">more...</a> | ||
<% } %> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,5 +81,3 @@ | |
</a> | ||
</div> | ||
|
||
<div id="panel_target"></div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters