diff src/main/webapp/pages/books.jsp @ 21:5b1856cd6b4f

bug fixed: 1.TOC Done display issue 2.issue in firefox
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 23 Jun 2015 14:20:36 +0200
parents 996f8f1b69db
children 2c6f44ef34ab
line wrap: on
line diff
--- a/src/main/webapp/pages/books.jsp	Fri Jun 19 16:23:16 2015 +0200
+++ b/src/main/webapp/pages/books.jsp	Tue Jun 23 14:20:36 2015 +0200
@@ -12,19 +12,43 @@
 
 	<jsp:include page="../componentes/headContent.jsp"/>	
 
-
+<script>
+	// TODO delete this function
+	function setTocComment(t) {
+		var notes = t.value;
+		var bookId = t.name;
+		console.log(notes);
+		console.log(bookId);
+		$.ajax({
+			url: "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/setTocComment.jsp",
+			type: 'POST',
+			dataType : 'json',
+			data : {
+				bookId : bookId,
+				notes : notes
+			},
+			success: function(data){
+	        	console.log("You've updated the comments of book: " + data);
+	        },
+	        error: function(error) {
+	        	console.log("error to update toc comments"+ error);
+	        	alert('You have NOT updated the status of book. If this issue remains, please contact us. Thanks.');
+	        }
+		});
+	}
+	
+</script>
 </head>
 
 <body>
-
-
-
 	<jsp:include page="../componentes/template.jsp"/>
-
-
-
 	<div id="page">
-	
+		<form name="booksForm"
+				action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
+				method="post"
+				class="contentForm">
+		<input name="bean" type="hidden" value="booksBean" /> 
+					
 		<% if(sessionBean.getUser() == null) { %>
 			<label>You must login!</label>
 		<% } else {
@@ -36,23 +60,22 @@
 		%>
 		
 		<div class="subTitel">List of Books
+			<input type="image"
+					onclick="setAction('forceReloadBooks', 'booksForm');"
+			src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/>
+			
 			<p class="label"><%= sessionBean.getBooksPage().getBookNumber() %> books in Chinese localgazetteers</p>
-			<p class="label"><%= (StringUtils.isNotEmpty(sessionBean.getBooksPage().getFilteringMessage())) ? sessionBean.getBooksPage().getFilteringMessage() : ""%></p>
+			<p class="label"><%= (StringUtils.isNotEmpty(sessionBean.getBooksPage().getFilteringMessage())) ? sessionBean.getBooksPage().getFilteringMessage() : ""%> </p>
 		</div>
-		<form name="booksForm"
-			action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
-			method="post"
-			class="contentForm">
-			<input name="bean" type="hidden" value="booksBean" /> 
-				
+		
 				<jsp:include page="../componentes/paginator.jsp">
 					<jsp:param name="formName" value="booksForm"/>
 				</jsp:include> 
 				
 				<table style="width: 90%; margin-left: auto;margin-right: auto;" class="pageTable">
 					<tr>
-					<td>
-						<table class="sortTable">
+						<td>
+							<table class="sortTable">
 								<tr>
 									<td><label class="tableTitle">Book ID</label></td>
 									<td>
@@ -317,9 +340,7 @@
 							<table class="sortTable">
 								<tr>
 									<td><label class="tableTitle">TOC Done
-										<input type="image"
-										onclick="setAction('forceReloadBooks', 'booksForm');"
-										src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/>
+										
 										</label>
 									</td>
 									<td>
@@ -382,11 +403,20 @@
 								</tr>
 							</table>
 						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Comments</label></td>
+									
+								</tr>
+							</table>
+						</td>
+					
 						
 					</tr>	
-				
-					<% //for(DBBook book : sessionBean.getBooksPage().getCompleteBookList() ) { 
-						for (DBBook book : sessionBean.getBooksPage().getDisplayBookList() ) {%>
+					
+					
+					<% for (DBBook book : sessionBean.getBooksPage().getDisplayBookList() ) {%>
 					
 					<tr>
 						<!-- books info -->
@@ -399,25 +429,39 @@
 						<td><%=book.getDynasty() %></td>
 						<td><%=book.getAdmin_type() %></td>
 						<td><%=book.getStart_year() %></td>
-						<td><a href="<%=sessionBean.getApplicationBean().getTocInterfaceUrl()%>/check_sections_details.php?book_id=<%=book.getId() %>&amp;count=100&amp;sessionId=<%= session.getId()%>" target="blank">
+						<td><a href="<%=sessionBean.getApplicationBean().getTocInterfaceUrl()%>/check_sections_details.php?book_id=<%=book.getId() %>&amp;count=10000&amp;sessionId=<%= session.getId()%>" target="blank">
 						Edit TOC</a></td>
 						
 						<td>						
-						<% if (book.getToc_correction() == 1) { %>
-							<input type="image" name="tocBookId" value="<%=book.getId()%>"
-								onclick="setAction('unSetTocCorrection', 'booksForm');"
-								src="<%=sessionBean.getApplicationBean().getCheckboxCheckedImage()%>" width="20" height="20"/>	
-						<% } else { %>
 						
-							<input type="image" name="tocBookId" value="<%=book.getId()%>"
-								onclick="setAction('setTocCorrection', 'booksForm');"
+						<% if ( book.getTocCorrection().equals("1") ) { %>
+							<input type="image"	onclick="setAction0('unSetTocCorrection', 'booksForm', 'tocBookId', '<%=book.getId() %>');"	
+								src="<%=sessionBean.getApplicationBean().getCheckboxCheckedImage()%>" width="20" height="20"/>
+							
+						<% } else { %>
+							<input type="image" onclick="setAction0('setTocCorrection', 'booksForm', 'tocBookId', '<%=book.getId() %>');"	
 								src="<%=sessionBean.getApplicationBean().getCheckboxUncheckedImage()%>" width="20" height="20"/>
-								
+						
 						<% } %>
+						
 						</td>
 						
 						<td><%= (book.getCurrentSectionVersion() == null) ? "" : book.getCurrentSectionVersion().getEditor() %></td>
 						<td><%= (book.getCurrentSectionVersion() == null) ? "" : book.getCurrentSectionVersion().getDate() %></td>
+						
+						<td>
+							<!--
+							<div>  
+								<textarea rows="2" cols="15" maxlength="100" name=<%=book.getId() %> > <%= book.getComments() %></textarea>
+								
+								<input type="image" alt="save comments" 
+									onclick="setAction0('saveComment', 'booksForm', 'bookId', '<%=book.getId()%>');" 
+									src="<%=sessionBean.getApplicationBean().getSaveImage()%>" width="20" height="20"/>
+								
+							</div>
+							-->
+						</td>
+						
 					</tr>
 					
 					<% } %>
@@ -427,8 +471,11 @@
 					<jsp:param name="formName" value="booksForm"/>
 				</jsp:include>
 				
-			</form>
+		
+		
+					
 		<% } %>
+		</form>
 	</div>
 	
 </body>