comparison src/main/webapp/pages/topicList.jsp @ 41:ba9515f22897

new: topic management and adding sections from searching result into topic
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Thu, 17 Dec 2015 13:44:08 +0100
parents
children 9dbbbfd474f4
comparison
equal deleted inserted replaced
40:35ed4e650a53 41:ba9515f22897
1 <%@page import="de.mpiwg.gazetteer.bo.LGTopic"%>
2 <%@page import="org.apache.commons.lang.StringUtils"%>
3 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
4
5 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
6
7 <html>
8
9 <head>
10 <jsp:include page="../componentes/headContent.jsp"/>
11 <script>
12 $(function() {
13 var dialogCreateTopic = $("#dialogCreateTopic").dialog(
14 {autoOpen: false}
15 );
16 $("#createTopic").button().on( "click", function() {
17 dialogCreateTopic.dialog( "open" );
18 });
19
20
21 });
22
23 </script>
24 </head>
25
26 <body>
27
28 <jsp:include page="../componentes/template.jsp"/>
29
30 <div id="page">
31
32 <% if(sessionBean.getUser() == null) { %>
33 <label class="subTitel">You must login!</label>
34 <% } else {
35
36 if (sessionBean.getTopicListPage().getCompleteTopicList() == null){
37 sessionBean.getTopicListPage().loadParameters(request, response);
38 sessionBean.getTopicListPage().reloadTopics();
39 }
40
41 %>
42
43 <% if(sessionBean.getTopicListPage().getCompleteTopicList().isEmpty()) { %>
44 <label class="subTitel">There's no topic in the system!</label>
45 <% } else { %>
46
47 <div id="dialogCreateTopic" title="Create a New Topic:">
48 <form name="createTopicForm" id="createTopicForm"
49 action="<%= sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
50 method="post">
51 <input name="bean" type="hidden" value="topicListBean" />
52 <table>
53 <tr>
54 <td>
55 <span>Name (Eng)</span>
56 </td>
57 <td>
58 <input id="nameEn" name="nameEn" type="text" placeholder="e.g. Local Product"/>
59 </td>
60 </tr>
61 <tr>
62 <td>
63 <span>name (中文)</span>
64 </td>
65 <td>
66 <input id="nameCh" name="nameCh" type="text" placeholder="e.g. 物產"/>
67 </td>
68 </tr>
69 <tr>
70 <td>
71 <span>name (Pinyin)</span>
72 </td>
73 <td>
74 <input id="namePinyin" name="namePinyin" type="text" placeholder="e.g. wu chan"/>
75 </td>
76 </tr>
77 <tr>
78 <td>
79 <span>description</span>
80 </td>
81 <td>
82 <input id="description" name="description" type="text" placeholder=""/>
83 </td>
84 </tr>
85 <tr>
86 <td>
87 <button onclick="setAction('createTopic', 'createTopicForm'); document.getElementById('createTopicForm').submit();">Submit</button>
88 </td>
89 </tr>
90
91 </table>
92 </form>
93 </div>
94
95 <form name="topicListForm" id="topicListForm" method="post"
96 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" >
97 <input name="bean" type="hidden" value="topicListBean" />
98
99 <div class="subTitel">Topic
100 <input type="image"
101 onclick="setAction('forceLoadTopics', 'topicListForm');"
102 src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/>
103
104 <p class="label">You have <%= sessionBean.getTopicListPage().getTopicNumber() %> topics.</p>
105 <p class="label"><%= (StringUtils.isNotEmpty(sessionBean.getTopicListPage().getFilteringMessage())) ? sessionBean.getTopicListPage().getFilteringMessage() : ""%> </p>
106 </div>
107
108
109
110 <button id="createTopic" type="button" class="lgButton">Create New Topic</button>
111
112
113 <jsp:include page="../componentes/paginator.jsp">
114 <jsp:param name="formName" value="topicListForm"/>
115 </jsp:include>
116
117 <div class="tableDiv double-scroll">
118 <table class="pageTable" >
119 <tr>
120 <td>
121 <table class="sortTable">
122 <tr>
123 <td><label class="tableTitle">Topic ID</label></td>
124 <td>
125 <table>
126 <tr><td>
127 <input type="image"
128 onclick="setAction('sortByTopicIdUp', 'topicListForm');"
129 src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>
130 </td></tr>
131 <tr><td>
132 <input type="image"
133 onclick="setAction('sortByTopicIdDown', 'topicListForm');"
134 src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>
135 </td></tr>
136 </table>
137 </td>
138 </tr>
139 </table>
140 </td>
141
142
143 <td>
144 <table class="sortTable">
145 <tr>
146 <td><label class="tableTitle">Name(Eng)</label></td>
147 <td>
148 <table>
149 <tr><td>
150 <input type="image"
151 onclick="setAction('sortByNameEnUp', 'topicListForm');"
152 src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>
153 </td></tr>
154 <tr><td>
155 <input type="image"
156 onclick="setAction('sortByNameEnDown', 'topicListForm');"
157 src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>
158 </td></tr>
159 </table>
160 </td>
161 </tr>
162
163 </table>
164 </td>
165 <td>
166 <table class="sortTable">
167 <tr>
168 <td><label class="tableTitle">Name(Chi)</label></td>
169 <td>
170 <table>
171 <tr><td>
172 <input type="image"
173 onclick="setAction('sortByNameChUp', 'topicListForm');"
174 src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>
175 </td></tr>
176 <tr><td>
177 <input type="image"
178 onclick="setAction('sortByNameChDown', 'topicListForm');"
179 src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>
180 </td></tr>
181 </table>
182 </td>
183 </tr>
184
185 </table>
186 </td>
187 <td>
188 <table class="sortTable">
189 <tr>
190 <td><label class="tableTitle">Name(Pinyin)</label></td>
191 <td>
192 <table>
193 <tr><td>
194 <input type="image"
195 onclick="setAction('sortByNamePinyinUp', 'topicListForm');"
196 src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>
197 </td></tr>
198 <tr><td>
199 <input type="image"
200 onclick="setAction('sortByNamePinyinDown', 'topicListForm');"
201 src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>
202 </td></tr>
203 </table>
204 </td>
205 </tr>
206
207 </table>
208 </td>
209 <td>
210 <table class="sortTable">
211 <tr>
212 <td><label class="tableTitle">Description</label></td>
213 <td>
214 <table>
215 <tr><td>
216 <input type="image"
217 onclick="setAction('sortByDescriptionUp', 'topicListForm');"
218 src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>
219 </td></tr>
220 <tr><td>
221 <input type="image"
222 onclick="setAction('sortByNDescriptionDown', 'topicListForm');"
223 src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>
224 </td></tr>
225 </table>
226 </td>
227 </tr>
228
229 </table>
230 </td>
231 <td><label class="tableTitle">Contributors</label></td>
232 <td>
233 <table class="sortTable">
234 <tr>
235 <td><label class="tableTitle">Last Modified</label></td>
236 <td>
237 <table>
238 <tr><td>
239 <input type="image"
240 onclick="setAction('sortByLastModifiedUp', 'topicListForm');"
241 src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>
242 </td></tr>
243 <tr><td>
244 <input type="image"
245 onclick="setAction('sortByLastModifiedDown', 'topicListForm');"
246 src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>
247 </td></tr>
248 </table>
249 </td>
250 </tr>
251
252 </table>
253 </td>
254
255
256 <td><label class="tableTitle">Manage</label></td>
257 <td><label class="tableTitle">Delete</label></td>
258 </tr>
259
260 <% for (LGTopic topic : sessionBean.getTopicListPage().getDisplayTopicList() ) {
261 %>
262 <tr>
263 <td><%=topic.getId() %></td>
264 <td><%=topic.getNameEn() %></td>
265 <td><%=topic.getNameCh() %></td>
266 <td><%=topic.getNamePinyin() %></td>
267 <td><%=topic.getDescription() %></td>
268 <td>
269 <table style="width:120px;">
270 <% for(String contributor : topic.getContributorsNameList()) { %>
271 <tr><td><label><%= contributor %></label></td></tr>
272 <% } %>
273 </table>
274 </td>
275 <td><%=topic.getFomattedLastChange() %></td>
276
277
278 <td>
279 <a href="<%=sessionBean.getApplicationBean().getRootServer() %>/pages/topicPage.jsp?topicId=<%=topic.getId() %>" >
280 <img alt="Manage Topic" src="<%=sessionBean.getApplicationBean().getEditBranchImage()%>"/>
281 </a>
282 </td>
283 <td>
284 <input type="image"
285 onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> deleteTopic('deleteTopic', 'topicListForm', '<%=topic.getId() %>');"
286 src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
287 </td>
288
289
290 </tr>
291
292 <% } %>
293
294 </table>
295
296 </div>
297
298
299 <jsp:include page="../componentes/paginator.jsp">
300 <jsp:param name="formName" value="topicListForm"/>
301 </jsp:include>
302
303 </form>
304 <% } %>
305 <% } %>
306 </div>
307
308 </body>