Mercurial > hg > LGServices
view src/main/webapp/pages/topicList.jsp @ 46:6199b0ddac94
minor bug fixed
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 28 Dec 2015 12:51:45 +0100 |
parents | 9dbbbfd474f4 |
children | ef113c53629b |
line wrap: on
line source
<%@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(); } %> <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> <% if(sessionBean.getTopicListPage().getCompleteTopicList().isEmpty()) { %> <label class="subTitel">There's no topic in the system!</label> <% } else { %> <form name="topicListForm" id="topicListForm" method="post" action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" > <input name="bean" type="hidden" value="topicListBean" /> <div class="subTitel">Topic List <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> <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().getCompleteTopicList() ) { %> <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> </form> <% } %> <% } %> </div> </body>