Mercurial > hg > LGServices
diff src/main/webapp/pages/search.jsp @ 43:9dbbbfd474f4
new: 1.existing topic in search result. 2.difference-set of book for topic
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 23 Dec 2015 16:03:32 +0100 |
parents | ba9515f22897 |
children | 89d1076df1c3 |
line wrap: on
line diff
--- a/src/main/webapp/pages/search.jsp Fri Dec 18 11:50:24 2015 +0100 +++ b/src/main/webapp/pages/search.jsp Wed Dec 23 16:03:32 2015 +0100 @@ -1,4 +1,5 @@ <%@page import="de.mpiwg.gazetteer.bo.LGBranch"%> +<%@page import="de.mpiwg.gazetteer.bo.LGTopicSectionRelation"%> <%@page import="org.apache.commons.lang.StringUtils"%> <%@page import="de.mpiwg.gazetteer.db.DBSection"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> @@ -16,15 +17,33 @@ $(function() { + $("#addAllSectionsToTopic").click(function() { + + var r = confirm("Add "+ '<%= sessionBean.getSearchPage().getFilteredSectionList().size() %>' + " sections to a topic?"); + if (r == true) { + console.log("addAllSectionsToTopic"); + + var url0 = "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/addSectionToTopic.jsp?addAllSections=1"; + + $.ajax( url0 ) + .done(function(data) { + $( "#dialogAddSectionToTopicTable" ).replaceWith(data); + dialogAddSectionToTopic.dialog( "open" ); + }) + .fail(function() { + console.error("Error calling: " + query); + }); + + } + + }); + $( ".addSectionToTopic" ).click(function() { var sectionId = $( this ).data('section-id'); - - - console.log("addSectionToTopic. sectionId = " + sectionId); + //console.log("addSectionToTopic. sectionId = " + sectionId); var url0 = "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/addSectionToTopic.jsp?sectionId=" + sectionId; - - + $.ajax( url0 ) .done(function(data) { $( "#dialogAddSectionToTopicTable" ).replaceWith(data); @@ -191,7 +210,7 @@ <div id="dialogMoreInfoTable"></div> </div> - <div id="dialogAddSectionToTopic" title="Add Section into Topic:"> + <div id="dialogAddSectionToTopic" title="Add Section(s) into Topic:"> <div id="dialogAddSectionToTopicTable"></div> </div> @@ -411,29 +430,6 @@ </tr> </table> </th> - <!-- - <th> - <table class="sortTable"> - <tr> - <td><label class="tableTitle">Volume</label></td> - <td> - <table> - <tr><td> - <input type="image" - onclick="setAction('sortByVolumeUp', 'searchForm');" - src="<%=sessionBean.getApplicationBean().getUpImage()%>"/> - </td></tr> - <tr><td> - <input type="image" - onclick="setAction('sortByVolumeDown', 'searchForm');" - src="<%=sessionBean.getApplicationBean().getDownImage()%>"/> - </td></tr> - </table> - </td> - </tr> - </table> - </th> - --> <th> <table class="sortTable"> <tr> @@ -478,13 +474,20 @@ </th> <th><label class="tableTitle">View Text</label></th> - <th><label class="tableTitle">Add to Topic</label></th> + + <th> + <label class="tableTitle">Add to Topic</label> + + <img id="addAllSectionsToTopic" width="15" height="15" alt="Add all sections to Topic" src="<%=sessionBean.getApplicationBean().getPlusImage()%>"> + + + </th> <th><label class="tableTitle">Existing Tasks</label></th> </tr> - <% - for (DBSection section : sessionBean.getSearchPage().getDisplaySectionList()) { + <% + for (DBSection section : sessionBean.getSearchPage().getDisplaySectionList()) { %> <tr> <td> @@ -514,10 +517,33 @@ </td> <!-- Add to Topic --> - <td> + <td style="max-width:300px;"> + <!-- existing topic --> + <% if(section.getTopicSectionRelation() != null && !section.getTopicSectionRelation().isEmpty()) { %> + <lable>Already in topic: </lable> + <table style="width:100%"> + <% for(LGTopicSectionRelation relation : section.getTopicSectionRelation()) { %> + <tr> + <td> + <table style="width:100%; min-width:100px"> + <tr><td><%=relation.getTopic().info() %></td></tr> + </table> + </td> + <td style="max-width:150px"> + + <a href="<%=sessionBean.getApplicationBean().getRootServer() %>/pages/topicPage.jsp?topicId=<%=relation.getTopicId() %>" > + <img alt="Manage Topic" src="<%=sessionBean.getApplicationBean().getEditBranchImage()%>"/> + </a> + + </td> + </tr> + <% } %> + </table> + <% } %> <img width="10" height="10" alt="Add the section to Topic" src="<%=sessionBean.getApplicationBean().getPlusImage()%>" data-section-id="<%=section.getId()%>" class="addSectionToTopic"> - + + </td>