Mercurial > hg > LGServices
annotate src/main/webapp/pages/books.jsp @ 14:3387d855a194
new: toc status in books page
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 29 May 2015 11:00:09 +0200 |
parents | 9c6e74761f60 |
children | d81a5401b9af |
rev | line source |
---|---|
10 | 1 <%@page import="de.mpiwg.gazetteer.bo.LGBranch"%> |
2 <%@page import="org.apache.commons.lang.StringUtils"%> | |
3 <%@page import="de.mpiwg.gazetteer.db.DBSection"%> | |
4 <%@page import="de.mpiwg.gazetteer.db.DBBook"%> | |
5 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
6 | |
7 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" /> | |
8 | |
9 <html> | |
10 | |
11 <head> | |
12 | |
13 <jsp:include page="../componentes/headContent.jsp"/> | |
14 | |
15 | |
16 <script> | |
17 $(function() { | |
18 | |
19 $( "#dialogMoreInfo" ).dialog({ | |
20 autoOpen: false, | |
21 modal: true, | |
22 position: { my: "center", at: "top", of: window }, | |
23 hide: { | |
24 effect: "explode", | |
25 duration: 1000 | |
26 } | |
27 }); | |
28 | |
29 $( ".moreInfo" ).click(function() { | |
30 var sectionId = $( this ).data('section-id'); | |
31 | |
32 var url0 = "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/sectionTableDetails.jsp?sectionId=" + sectionId; | |
33 | |
34 $.ajax( url0 ) | |
35 .done(function(data) { | |
36 $( "#dialogMoreInfoTable" ).replaceWith(data); | |
37 $( "#dialogMoreInfo" ).dialog( "open" ); | |
38 }) | |
39 .fail(function() { | |
40 console.error("Error calling: " + query); | |
41 }) | |
42 | |
43 | |
44 | |
45 }); | |
46 | |
47 $("#searchTerm").autocomplete({ | |
48 source : function(request, response) { | |
49 var radioButton0 = $("input[type='radio'][name='searchIn']:checked"); | |
50 var searchInVal = (radioButton0) ? radioButton0.val() : 0; | |
51 $.ajax({ | |
52 url : "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/searchAutocomplete.jsp", | |
53 type : "POST", | |
54 dataType : "json", | |
55 data : { | |
56 term : request.term, | |
57 searchIn : searchInVal | |
58 }, | |
59 success : function(data) { | |
60 | |
61 response($.map(data, function(item) { | |
62 return { | |
63 label : item.name, | |
64 value : item.value, | |
65 } | |
66 })); | |
67 }, | |
68 error : function(error) { | |
69 alert('error: ' + error); | |
70 } | |
71 }); | |
72 }, | |
73 minLength : 0 | |
74 }); | |
75 | |
76 $("#dynastyFilter").autocomplete({ | |
77 source : function(request, response) { | |
78 $.ajax({ | |
79 url : "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/dynastyAutocomplete.jsp", | |
80 type : "POST", | |
81 dataType : "json", | |
82 data : { | |
83 term : request.term | |
84 }, | |
85 success : function(data) { | |
86 | |
87 response($.map(data, function(item) { | |
88 return { | |
89 label : item.name, | |
90 value : item.value, | |
91 } | |
92 })); | |
93 }, | |
94 error : function(error) { | |
95 alert('error: ' + error); | |
96 } | |
97 }); | |
98 }, | |
99 minLength : 0 | |
100 }); | |
101 | |
102 $("#level1Filter").autocomplete({ | |
103 source : function(request, response) { | |
104 $.ajax({ | |
105 url : "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/level1Autocomplete.jsp", | |
106 type : "POST", | |
107 dataType : "json", | |
108 data : { | |
109 term : request.term | |
110 }, | |
111 success : function(data) { | |
112 | |
113 response($.map(data, function(item) { | |
114 return { | |
115 label : item.name, | |
116 value : item.value, | |
117 } | |
118 })); | |
119 }, | |
120 error : function(error) { | |
121 alert('error: ' + error); | |
122 } | |
123 }); | |
124 }, | |
125 minLength : 0 | |
126 }); | |
127 | |
128 $("#adminTypeFilter").autocomplete({ | |
129 source : function(request, response) { | |
130 $.ajax({ | |
131 url : "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/adminTypeAutocomplete.jsp", | |
132 type : "POST", | |
133 dataType : "json", | |
134 data : { | |
135 term : request.term | |
136 }, | |
137 success : function(data) { | |
138 | |
139 response($.map(data, function(item) { | |
140 return { | |
141 label : item.name, | |
142 value : item.value, | |
143 } | |
144 })); | |
145 }, | |
146 error : function(error) { | |
147 alert('error: ' + error); | |
148 } | |
149 }); | |
150 }, | |
151 minLength : 0 | |
152 }); | |
153 | |
154 }); | |
14
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
155 |
10 | 156 </script> |
157 </head> | |
158 | |
159 <body> | |
160 | |
161 | |
162 | |
163 <jsp:include page="../componentes/template.jsp"/> | |
164 | |
165 | |
166 | |
167 <div id="page"> | |
168 | |
169 <% if(sessionBean.getUser() == null) { %> | |
170 <label>You must login!</label> | |
171 <% } else { | |
172 sessionBean.getBooksPage().loadParameters(request, response); | |
173 sessionBean.getBooksPage().loadBooks(); | |
13
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
174 // TODO: add a "update" to forceLoadBooks() |
10 | 175 %> |
176 | |
13
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
177 <div class="subTitel">List of Books |
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
178 <p class="label">Total <%= sessionBean.getBooksPage().getBookNumber() %> books</p> |
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
179 </div> |
10 | 180 <form name="booksForm" |
181 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" | |
182 method="post" | |
183 class="contentForm"> | |
184 <input name="bean" type="hidden" value="booksBean" /> | |
13
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
185 |
10 | 186 <table style="width: 90%; margin-left: auto;margin-right: auto;" class="pageTable"> |
187 <tr> | |
188 <td><label class="tableTitle">Book ID</label></td> | |
189 <td><label class="tableTitle">Book Name</label></td> | |
190 <td><label class="tableTitle">Edition</label></td> | |
191 <td><label class="tableTitle">Level 1</label></td> | |
192 <td><label class="tableTitle">Level 2</label></td> | |
193 <td><label class="tableTitle">Period</label></td> | |
194 <td><label class="tableTitle">Dynasty</label></td> | |
195 <td><label class="tableTitle">Admin Type</label></td> | |
196 <td><label class="tableTitle">Start Year</label></td> | |
197 | |
198 <td><label class="tableTitle">Edit TOC</label></td> <!-- go to toc page --> | |
14
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
199 <td><label class="tableTitle">TOC Finished</label> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
200 <input type="image" |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
201 onclick="setAction('forceReloadBooks', 'booksForm');" |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
202 src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
203 </td> <!-- finished or not --> |
10 | 204 <td><label class="tableTitle">Last Editor</label></td> |
205 <td><label class="tableTitle">Edit Time</label></td> | |
206 | |
207 </tr> | |
13
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
208 |
10 | 209 <% for(DBBook book : sessionBean.getBooksPage().getCompleteBookList() ) { %> |
210 | |
211 <tr> | |
212 <!-- books info --> | |
213 <td><%=book.getId() %></td> | |
214 <td><%=book.getName() %></td> | |
215 <td><%=book.getEdition() %></td> | |
216 <td><%=book.getLevel1()%></td> | |
217 <td><%=book.getLevel2() %></td> | |
218 <td><%=book.getPeriod() %></td> | |
219 <td><%=book.getDynasty() %></td> | |
220 <td><%=book.getAdmin_type() %></td> | |
221 <td><%=book.getStart_year() %></td> | |
13
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
222 <td><a href="<%=sessionBean.getApplicationBean().getTocInterfaceUrl()%>/check_sections_details.php?book_id=<%=book.getId() %>&count=100&sessionId=<%= session.getId()%>" target="blank"> |
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
223 Edit TOC</a></td> |
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
224 |
14
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
225 <td> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
226 <% if (book.getToc_correction() == 1) { %> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
227 <input type="image" name="tocBookId" value="<%=book.getId()%>" |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
228 onclick="setAction('unSetTocCorrection', 'booksForm');" |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
229 src="<%=sessionBean.getApplicationBean().getCheckboxCheckedImage()%>" width="20" height="20"/> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
230 <% } else { %> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
231 |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
232 <input type="image" name="tocBookId" value="<%=book.getId()%>" |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
233 onclick="setAction('setTocCorrection', 'booksForm');" |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
234 src="<%=sessionBean.getApplicationBean().getCheckboxUncheckedImage()%>" width="20" height="20"/> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
235 |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
236 <% } %> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
237 </td> |
3387d855a194
new: toc status in books page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
13
diff
changeset
|
238 |
12
d57fe2179f61
Improvement of book page
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
10
diff
changeset
|
239 <td><%= (book.getCurrentSectionVersion() == null) ? "" : book.getCurrentSectionVersion().getEditor() %></td> |
d57fe2179f61
Improvement of book page
"jurzua <jurzua@mpiwg-berlin.mpg.de>"
parents:
10
diff
changeset
|
240 <td><%= (book.getCurrentSectionVersion() == null) ? "" : book.getCurrentSectionVersion().getDate() %></td> |
10 | 241 </tr> |
242 | |
243 <% } %> | |
244 </table> | |
13
9c6e74761f60
new: link to Edit Toc page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
12
diff
changeset
|
245 |
10 | 246 </form> |
247 <% } %> | |
248 </div> | |
249 | |
250 </body> | |
251 </html> | |
252 |