comparison src/main/webapp/pages/topicPage.jsp @ 43:9dbbbfd474f4

new: 1.existing topic in search result. 2.difference-set of book for topic
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 23 Dec 2015 16:03:32 +0100
parents 815cd86bb9ec
children 89d1076df1c3
comparison
equal deleted inserted replaced
42:815cd86bb9ec 43:9dbbbfd474f4
1 <%@page import="de.mpiwg.gazetteer.dataverse.bo.VDCUser"%> 1 <%@page import="de.mpiwg.gazetteer.dataverse.bo.VDCUser"%>
2 <%@page import="de.mpiwg.gazetteer.bo.LGFile"%> 2 <%@page import="de.mpiwg.gazetteer.bo.LGFile"%>
3 <%@page import="de.mpiwg.gazetteer.bo.LGBranch"%> 3 <%@page import="de.mpiwg.gazetteer.bo.LGBranch"%>
4 <%@page import="org.apache.commons.lang.StringUtils"%> 4 <%@page import="org.apache.commons.lang.StringUtils"%>
5 <%@page import="de.mpiwg.gazetteer.db.DBSection"%> 5 <%@page import="de.mpiwg.gazetteer.db.DBSection"%>
6 <%@page import="de.mpiwg.gazetteer.db.DBBook"%>
6 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 7 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
7 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" /> 8 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
8 9
9 <html> 10 <html>
10 <head> 11 <head>
11 12
12 <jsp:include page="../componentes/headContent.jsp"/> 13 <jsp:include page="../componentes/headContent.jsp"/>
13 14
14 <script> 15 <script>
16
15 $(function() { 17 $(function() {
16 18 $("#showPendingButton").click(function() {
17 $( "#dialogDataverse" ).dialog({ 19 if($('#pendingBooks').css('display') == 'none'){
20 $('#pendingBooks').show();
21 $("#showPendingButton").text('Hide Missing Books');
22 } else {
23 $('#pendingBooks').hide();
24 $("#showPendingButton").text('Show Missing Books');
25 }
26 });
27
28 $( "#dialogDataverse" ).dialog({
18 autoOpen: false, 29 autoOpen: false,
19 modal: true, 30 modal: true,
20 width: 600, 31 width: 600,
21 position: { my: "center", at: "top", of: window }, 32 position: { my: "center", at: "top", of: window },
22 hide: { 33 hide: {
68 <% if(sessionBean.getTopicPage().getCompleteSectionList() == null || request.getParameter("topicId") != null) { 79 <% if(sessionBean.getTopicPage().getCompleteSectionList() == null || request.getParameter("topicId") != null) {
69 sessionBean.getTopicPage().loadParameters(request, response); 80 sessionBean.getTopicPage().loadParameters(request, response);
70 sessionBean.getTopicPage().loadTopic(request.getParameter("topicId")); 81 sessionBean.getTopicPage().loadTopic(request.getParameter("topicId"));
71 } %> 82 } %>
72 83
73 <% if(sessionBean.getTopicPage().getCompleteSectionList().isEmpty()) { %> 84
74 <label>Task not found!</label>
75
76 <% } else { %>
77 85
78 <div id="dialogAddContributors" title="Select a new Contributors:"> 86 <div id="dialogAddContributors" title="Select a new Contributors:">
79 <form name="contributorsForm" id="contributorsForm" 87 <form name="contributorsForm" id="contributorsForm"
80 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" 88 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
81 method="post"> 89 method="post">
92 </form> 100 </form>
93 </div> 101 </div>
94 102
95 <!-- Topic Detail --> 103 <!-- Topic Detail -->
96 <div> 104 <div>
97 <label class="subTitel">Topic "<%=sessionBean.getTopicPage().getTopic().getNameEn() %> (<%=sessionBean.getTopicPage().getTopic().getNameCh()%>)" Details </label> 105 <label class="subTitel">Topic "<%=sessionBean.getTopicPage().getTopic().getNameEn() %> (<%=sessionBean.getTopicPage().getTopic().getNameCh()%>)"</label>
106 <form name="topicForm"
107 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
108 method="post">
109 <input name="bean" type="hidden" value="topicBean" />
110 <input name="topicId" type="hidden" value="<%=sessionBean.getTopicPage().getTopicId()%>" />
111
98 112
99 <table class="tableComponent"> 113 <table class="tableComponent">
100 <tr> 114 <tr>
101 <td><label>Topic Id</label></td> 115 <td><label>Topic Id</label></td>
102 <td><label><%=sessionBean.getTopicPage().getTopic().getId() %></label></td> 116 <td><label><%=sessionBean.getTopicPage().getTopic().getId() %></label></td>
114 <td><label><%=sessionBean.getTopicPage().getTopic().getNamePinyin() %></label></td> 128 <td><label><%=sessionBean.getTopicPage().getTopic().getNamePinyin() %></label></td>
115 </tr> 129 </tr>
116 <tr> 130 <tr>
117 <td><label>Description</label></td> 131 <td><label>Description</label></td>
118 <td> 132 <td>
119 <form name="topicForm" 133 <input type="text" name="description" size="60" maxlength="250" value="<%=sessionBean.getTopicPage().getTopic().getDescription() %>" />
120 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" 134 <input type="image" alt="edit description" onclick="setAction('updateDescription', 'topicForm');"
121 method="post"> 135 src="<%=sessionBean.getApplicationBean().getSaveImage()%>" width="15" height="15"/>
122 <input name="bean" type="hidden" value="topicBean" /> 136
123 <input name="topicId" type="hidden" value="<%=sessionBean.getTopicPage().getTopicId()%>" />
124 <input type="text" name="description" size="60" maxlength="250" value="<%=sessionBean.getTopicPage().getTopic().getDescription() %>" />
125 <input type="image" alt="edit description" onclick="setAction('updateDescription', 'topicForm');"
126 src="<%=sessionBean.getApplicationBean().getSaveImage()%>" width="15" height="15"/>
127
128 </form>
129 </td> 137 </td>
138 </tr>
139 <tr>
140 <td><label>Searching Keywords(separated by ",")</label></td>
141 <td>
142 <input type="text" name="keywords" size="60" maxlength="250" value="<%=sessionBean.getTopicPage().getTopic().getKeywords() %>" />
143 <input type="image" alt="edit keywords" onclick="setAction('updateKeywords', 'topicForm');"
144 src="<%=sessionBean.getApplicationBean().getSaveImage()%>" width="15" height="15"/>
145
146 </td>
147 </tr>
130 <tr> 148 <tr>
131 <td><label>Created</label></td> 149 <td><label>Created</label></td>
132 <td><label><%=sessionBean.getTopicPage().getTopic().getFomattedCreation() %></label></td> 150 <td><label><%=sessionBean.getTopicPage().getTopic().getFomattedCreation() %></label></td>
133 </tr> 151 </tr>
134 <tr> 152 <tr>
147 <td> 165 <td>
148 <form name="contributorForm" 166 <form name="contributorForm"
149 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" 167 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
150 method="post"> 168 method="post">
151 <input name="bean" type="hidden" value="topicBean" /> 169 <input name="bean" type="hidden" value="topicBean" />
152 <input name="topicId" type="hidden" value="<%=sessionBean.getTopicPage().getTopicId()%>" />
153
154 <table style="width: 300px;" class="pageTable"> 170 <table style="width: 300px;" class="pageTable">
155 <% for(VDCUser contr : sessionBean.getTopicPage().getContributors()) { %> 171 <% for(VDCUser contr : sessionBean.getTopicPage().getContributors()) { %>
156 <tr> 172 <tr>
157 <td><label><%=contr.getUserName() %></label></td> 173 <td><label><%=contr.getUserName() %></label></td>
158 <td> 174 <td>
171 </tr> 187 </tr>
172 </table> 188 </table>
173 </td> 189 </td>
174 </tr> 190 </tr>
175 </table> 191 </table>
192 </form>
176 </div> 193 </div>
177 194
178 195
196
197 <div>
198 <button id="showPendingButton" type="button" class="lgButton" >Show Missing Books</button>
179 199
180 <!-- Sections in Topic -->
181
182 <div>
183 <form name="topicSectionRelationForm" 200 <form name="topicSectionRelationForm"
184 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" 201 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
185 method="post"> 202 method="post">
186 <input name="bean" type="hidden" value="topicBean" /> 203 <input name="bean" type="hidden" value="topicBean" />
187 <input name="topicId" type="hidden" value="<%=sessionBean.getTopicPage().getTopicId()%>" /> 204 <input name="topicId" type="hidden" value="<%=sessionBean.getTopicPage().getTopicId()%>" />
188 205
189 206 <div id="pendingBooks" style="display:none">
190 <label class="subTitel">Sections in Topic 207 <label class="subTitel"><%=sessionBean.getTopicPage().getPendingBookList().size()%> book(s) not in the topic.</label>
208
209 <div class="tableDiv double-scroll" >
210 <table class="pageTable">
211 <tr>
212 <th><label class="tableTitle">Book Id</label></th>
213 <th><label class="tableTitle">Book Name</label></th>
214 <th><label class="tableTitle">Level 1</label></th>
215 <th><label class="tableTitle">Level 2</label></th>
216 <th><label class="tableTitle">Dynasty</label></th>
217 <th><label class="tableTitle">Period</label></th>
218 <th><label class="tableTitle">Admin Type</label></th>
219 <th><label class="tableTitle">Section Name</label></th>
220 <th><label class="tableTitle">Section Pages</label></th>
221 <th><label class="tableTitle">View Text</label></th>
222 <th><label class="tableTitle">Existing Tasks</label></th>
223 <th><label class="tableTitle">Remove</label></th>
224 </tr>
225
226 <!-- TODO pending book list -->
227 <% for(DBBook book : sessionBean.getTopicPage().getPendingBookList() ) { %>
228 <tr>
229 <td>
230 <a href="<%=sessionBean.getApplicationBean().getTocInterfaceUrl()%>/check_sections_details.php?book_id=<%=book.getId() %>&amp;count=100&amp;sessionId=<%= session.getId()%>" target="blank">
231 <%=book.getId() %>
232 </a>
233 </td>
234 <td><label><%= book.getName() %></label></td>
235 <td class="removedContent"><label><%= book.getLevel1() %></label></td>
236 <td class="removedContent"><label><%= book.getLevel2() %></label></td>
237 <td class="removedContent"><label><%= book.getDynasty() %></label></td>
238 <td class="removedContent"><label><%= book.getPeriod() %></label></td>
239 <td class="removedContent"><label><%= book.getAdmin_type() %></label></td>
240 <td class="removedContent"><label>-</label></td>
241 <td class="removedContent"><label>-</label></td>
242 <td class="removedContent"><label>-</label></td>
243 <td class="removedContent"><label>-</label></td>
244 <td class="removedContent"><label>-</label></td>
245 </tr>
246
247 <% } %>
248 </table>
249 </div>
250 </div>
251
252 <label class="subTitel"> <%=sessionBean.getTopicPage().getCompleteSectionList().size()%> section(s) in the topic
191 <input type="image" 253 <input type="image"
192 onclick="setAction0('forceLoadTopicSectionRelation', 'topicSectionRelationForm');" 254 onclick="setAction('forceLoadTopicSectionRelation', 'topicSectionRelationForm');"
193 src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/> 255 src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/>
194 </label> 256 </label>
195 257
258 <!-- Sections in Topic -->
259 <% if(sessionBean.getTopicPage().getCompleteSectionList().isEmpty()) { %>
260 <label>(No section in the topic...)</label>
261
262 <% } else { %>
263
264
196 <div class="tableDiv double-scroll"> 265 <div class="tableDiv double-scroll">
197 <table class="pageTable"> 266 <table class="pageTable">
198 <tr> 267 <tr>
199 <th> 268 <th>
200 <table class="sortTable"> 269 <table class="sortTable">
473 <th><label class="tableTitle">View Text</label></th> 542 <th><label class="tableTitle">View Text</label></th>
474 <th><label class="tableTitle">Existing Tasks</label></th> 543 <th><label class="tableTitle">Existing Tasks</label></th>
475 <th><label class="tableTitle">Remove</label></th> 544 <th><label class="tableTitle">Remove</label></th>
476 </tr> 545 </tr>
477 546
478 <% for(DBSection section : sessionBean.getTopicPage().getDisplaySectionList() ) { %> 547 <% for(DBSection section : sessionBean.getTopicPage().getCompleteSectionList() ) { %>
479 <tr> 548 <tr>
480 <td> 549 <td>
481 <a href="<%=sessionBean.getApplicationBean().getTocInterfaceUrl()%>/check_sections_details.php?book_id=<%=section.getBook().getId() %>&amp;count=100&amp;sessionId=<%= session.getId()%>" target="blank"> 550 <a href="<%=sessionBean.getApplicationBean().getTocInterfaceUrl()%>/check_sections_details.php?book_id=<%=section.getBook().getId() %>&amp;count=100&amp;sessionId=<%= session.getId()%>" target="blank">
482 <%=section.getBookId()%> 551 <%=section.getBookId()%>
483 </a> 552 </a>
531 <input type="image" 600 <input type="image"
532 onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> setAction0('deleteSection', 'topicSectionRelationForm', 'sectionId', <%=section.getId() %>);" 601 onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> setAction0('deleteSection', 'topicSectionRelationForm', 'sectionId', <%=section.getId() %>);"
533 src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/> 602 src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
534 </td> 603 </td>
535 </tr> 604 </tr>
536 <% } %> 605 <% } %>
606
537 </table> 607 </table>
538 </div> 608 </div>
609
610
611
612 <% } %>
539 </form> 613 </form>
540 </div> 614 </div>
541 615
542 616
543 <% } %>
544 617
545 <% } %> 618 <% } %>
546 619
547 </div> 620 </div>
548 621