# HG changeset patch # User Zoe Hong # Date 1448029108 -3600 # Node ID ed215307f426f5982f0cb0f4baec2d652939c7a2 # Parent eab47936591ac17bb9317edbeef8cb9ba5f3165d new: show all existing branches in the searching result page of search for sections diff -r eab47936591a -r ed215307f426 src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java --- a/src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java Fri Nov 20 11:53:29 2015 +0100 +++ b/src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java Fri Nov 20 15:18:28 2015 +0100 @@ -44,6 +44,18 @@ public List getBranches(Long userId){ List list = new ArrayList(); + for(LGBranch branch : getBranchMap().values()){ + list.add(branch); + } + return list; + } + + /* + * old version: only showing the branches that the current user has contributor role. + * But we modify it to get all branches in the section, and leave the role checking to jsp at front-end. + * + public List getBranches(Long userId){ + List list = new ArrayList(); for(LGBranch branch : getBranchMap().values()){ if(branch.hasContributor(userId)){ list.add(branch); @@ -51,6 +63,7 @@ } return list; } + */ public LGBranch getBranch(Long branchId){ return getBranchMap().getValuesByOwnKey(branchId); diff -r eab47936591a -r ed215307f426 src/main/webapp/pages/search.jsp --- a/src/main/webapp/pages/search.jsp Fri Nov 20 11:53:29 2015 +0100 +++ b/src/main/webapp/pages/search.jsp Fri Nov 20 15:18:28 2015 +0100 @@ -473,21 +473,25 @@ Show Section in Extraction Interface - + <% if(section.getBranches() != null && !section.getBranches().isEmpty()) { %> - +
<% for(LGBranch branch : section.getBranches()) { %> - <% } %>
- +
<%=branch.getFomattedLastChange() %>
<%=branch.getLabel() %>
+ + <% if (branch.hasContributor(sessionBean.getUser().getId())) { %> Manage Branch + <% } else { %> + + <% } %>