diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/webapp/pages/topicList.jsp	Thu Dec 17 13:44:08 2015 +0100
@@ -0,0 +1,308 @@
+<%@page import="de.mpiwg.gazetteer.bo.LGTopic"%>
+<%@page import="org.apache.commons.lang.StringUtils"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+
+<jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
+
+<html>
+
+<head>
+	<jsp:include page="../componentes/headContent.jsp"/>	
+	<script>
+		$(function() {
+			var dialogCreateTopic = $("#dialogCreateTopic").dialog(
+					{autoOpen: false}
+		  	);	  
+			$("#createTopic").button().on( "click", function() {
+				dialogCreateTopic.dialog( "open" );
+			});
+			
+			
+		});
+		
+	</script>
+</head>
+
+<body>
+
+	<jsp:include page="../componentes/template.jsp"/>
+
+	<div id="page">
+		
+		<% if(sessionBean.getUser() == null) { %>
+			<label class="subTitel">You must login!</label>
+		<% } else { 
+			
+			if (sessionBean.getTopicListPage().getCompleteTopicList() == null){ 
+				sessionBean.getTopicListPage().loadParameters(request, response);
+				sessionBean.getTopicListPage().reloadTopics();
+			}
+			
+		%>
+		
+		<% if(sessionBean.getTopicListPage().getCompleteTopicList().isEmpty()) { %>
+			<label class="subTitel">There's no topic in the system!</label>
+		<% } else { %>
+					
+			<div id="dialogCreateTopic" title="Create a New Topic:">
+				<form name="createTopicForm" id="createTopicForm"
+					action="<%= sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
+					method="post">
+					<input name="bean" type="hidden" value="topicListBean" /> 
+					<table>
+						<tr>
+							<td>
+								<span>Name (Eng)</span>
+							</td>
+							<td>
+								<input id="nameEn" name="nameEn" type="text" placeholder="e.g. Local Product"/>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<span>name (中文)</span>
+							</td>
+							<td>
+								<input id="nameCh" name="nameCh" type="text" placeholder="e.g. 物產"/>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<span>name (Pinyin)</span>
+							</td>
+							<td>
+								<input id="namePinyin" name="namePinyin" type="text" placeholder="e.g. wu chan"/>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<span>description</span>
+							</td>
+							<td>
+								<input id="description" name="description" type="text" placeholder=""/>
+							</td>
+						</tr>
+						<tr>
+							<td>
+								<button onclick="setAction('createTopic', 'createTopicForm'); document.getElementById('createTopicForm').submit();">Submit</button> 
+							</td>
+						</tr>
+								
+					</table>	
+				</form>
+			</div>	
+		
+			<form name="topicListForm" id="topicListForm" method="post"
+				action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" >
+				<input name="bean" type="hidden" value="topicListBean" /> 
+				
+				<div class="subTitel">Topic 
+					<input type="image"
+						onclick="setAction('forceLoadTopics', 'topicListForm');"
+						src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/>
+			
+					<p class="label">You have <%= sessionBean.getTopicListPage().getTopicNumber() %> topics.</p>
+					<p class="label"><%= (StringUtils.isNotEmpty(sessionBean.getTopicListPage().getFilteringMessage())) ? sessionBean.getTopicListPage().getFilteringMessage() : ""%> </p>
+				</div>
+				
+				
+				
+				<button id="createTopic" type="button" class="lgButton">Create New Topic</button>		
+				
+				
+				<jsp:include page="../componentes/paginator.jsp">
+					<jsp:param name="formName" value="topicListForm"/>
+				</jsp:include> 
+		
+				<div class="tableDiv double-scroll">
+					<table class="pageTable" >
+						<tr>
+							<td>
+								<table class="sortTable">
+									<tr>
+										<td><label class="tableTitle">Topic ID</label></td>
+										<td>
+											<table>
+												<tr><td>
+													<input type="image" 
+														onclick="setAction('sortByTopicIdUp', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
+												</td></tr>
+												<tr><td>
+													<input type="image"
+														onclick="setAction('sortByTopicIdDown', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
+												</td></tr>
+											</table>
+										</td>
+									</tr>
+								</table>
+							</td>
+			
+							
+							<td>
+								<table class="sortTable">
+									<tr>
+										<td><label class="tableTitle">Name(Eng)</label></td>
+										<td>
+											<table>
+												<tr><td>
+													<input type="image" 
+														onclick="setAction('sortByNameEnUp', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
+												</td></tr>
+												<tr><td>
+													<input type="image"
+														onclick="setAction('sortByNameEnDown', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
+												</td></tr>
+											</table>
+										</td>
+									</tr>
+									
+								</table>
+							</td>
+							<td>
+								<table class="sortTable">
+									<tr>
+										<td><label class="tableTitle">Name(Chi)</label></td>
+										<td>
+											<table>
+												<tr><td>
+													<input type="image" 
+														onclick="setAction('sortByNameChUp', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
+												</td></tr>
+												<tr><td>
+													<input type="image"
+														onclick="setAction('sortByNameChDown', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
+												</td></tr>
+											</table>
+										</td>
+									</tr>
+									
+								</table>
+							</td>
+							<td>
+								<table class="sortTable">
+									<tr>
+										<td><label class="tableTitle">Name(Pinyin)</label></td>
+										<td>
+											<table>
+												<tr><td>
+													<input type="image" 
+														onclick="setAction('sortByNamePinyinUp', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
+												</td></tr>
+												<tr><td>
+													<input type="image"
+														onclick="setAction('sortByNamePinyinDown', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
+												</td></tr>
+											</table>
+										</td>
+									</tr>
+									
+								</table>
+							</td>
+							<td>
+								<table class="sortTable">
+									<tr>
+										<td><label class="tableTitle">Description</label></td>
+										<td>
+											<table>
+												<tr><td>
+													<input type="image" 
+														onclick="setAction('sortByDescriptionUp', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
+												</td></tr>
+												<tr><td>
+													<input type="image"
+														onclick="setAction('sortByNDescriptionDown', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
+												</td></tr>
+											</table>
+										</td>
+									</tr>
+									
+								</table>
+							</td>
+							<td><label class="tableTitle">Contributors</label></td>
+							<td>
+								<table class="sortTable">
+									<tr>
+										<td><label class="tableTitle">Last Modified</label></td>
+										<td>
+											<table>
+												<tr><td>
+													<input type="image" 
+														onclick="setAction('sortByLastModifiedUp', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
+												</td></tr>
+												<tr><td>
+													<input type="image"
+														onclick="setAction('sortByLastModifiedDown', 'topicListForm');"
+														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
+												</td></tr>
+											</table>
+										</td>
+									</tr>
+									
+								</table>
+							</td>
+							
+							
+							<td><label class="tableTitle">Manage</label></td>
+							<td><label class="tableTitle">Delete</label></td>
+						</tr>	
+						
+						<% for (LGTopic topic : sessionBean.getTopicListPage().getDisplayTopicList() ) {
+						%>
+						<tr>
+							<td><%=topic.getId() %></td>
+							<td><%=topic.getNameEn() %></td>
+							<td><%=topic.getNameCh() %></td>
+							<td><%=topic.getNamePinyin() %></td>
+							<td><%=topic.getDescription() %></td>
+							<td>
+								<table style="width:120px;">
+								<% for(String contributor : topic.getContributorsNameList()) { %>
+									<tr><td><label><%= contributor %></label></td></tr>
+								<% } %>
+								</table>
+							</td>
+							<td><%=topic.getFomattedLastChange() %></td>
+							
+						
+							<td>
+								<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/pages/topicPage.jsp?topicId=<%=topic.getId() %>" >
+									<img alt="Manage Topic" src="<%=sessionBean.getApplicationBean().getEditBranchImage()%>"/>
+								</a>
+							</td>
+							<td>
+								<input type="image" 
+									onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> deleteTopic('deleteTopic', 'topicListForm', '<%=topic.getId() %>');" 
+									src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
+							</td>
+							
+					
+						</tr>
+						
+						<% } %>
+				
+					</table>
+
+				</div>
+				
+				
+				<jsp:include page="../componentes/paginator.jsp">
+					<jsp:param name="formName" value="topicListForm"/>
+				</jsp:include> 
+				
+			</form>
+		<% } %>
+		<% } %>
+	</div>
+	
+</body>
\ No newline at end of file