Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

project version group: implemented filtering by group name, removed u…

…nused images
  • Loading branch information...
commit 064644c2064e26efe6dd54d1fb18bd70e7cc124d 1 parent 241e4fa
Alex Eng authored April 19, 2012

Showing 19 changed files with 48 additions and 58 deletions. Show diff stats Hide diff stats

  1. 83  server/zanata-war/src/main/java/org/zanata/action/VersionGroupAction.java
  2. 2  server/zanata-war/src/main/java/org/zanata/action/VersionGroupMaintainerManageAction.java
  3. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/cell_middle_bg.png
  4. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/cell_top_bg.png
  5. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/menu_active_bg.png
  6. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/panel-header-bg.png
  7. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/photos.png
  8. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/cross.png
  9. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/help.png
  10. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/home.png
  11. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/photos.png
  12. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/tick.png
  13. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/user.png
  14. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/world.png
  15. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/wrench.png
  16. BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/zoom.png
  17. 4  server/zanata-war/src/main/webapp/WEB-INF/layout/add_maintainer_form.xhtml
  18. 15  server/zanata-war/src/main/webapp/version-group/home.xhtml
  19. 2  server/zanata-war/src/main/webapp/version-group/version_group.xhtml
83  server/zanata-war/src/main/java/org/zanata/action/VersionGroupAction.java
@@ -29,8 +29,11 @@
29 29
 import org.jboss.seam.annotations.Logger;
30 30
 import org.jboss.seam.annotations.Name;
31 31
 import org.jboss.seam.annotations.Scope;
  32
+import org.jboss.seam.annotations.Transactional;
32 33
 import org.jboss.seam.annotations.datamodel.DataModel;
  34
+import org.jboss.seam.annotations.security.Restrict;
33 35
 import org.jboss.seam.log.Log;
  36
+import org.zanata.model.HDocument;
34 37
 import org.zanata.model.HIterationGroup;
35 38
 import org.zanata.model.HProjectIteration;
36 39
 import org.zanata.service.VersionGroupService;
@@ -52,6 +55,7 @@
52 55
 
53 56
    private HIterationGroup group;
54 57
    private String searchTerm;
  58
+   private String groupNameFilter;
55 59
    private List<HProjectIteration> searchResults;
56 60
 
57 61
    public void loadAllActiveGroups()
@@ -91,68 +95,19 @@ public boolean isVersionInGroup(Long projectIterationId)
91 95
       return false;
92 96
    }
93 97
 
  98
+   @Transactional
  99
+   @Restrict("#{s:hasPermission(versionGroupHome.instance, 'update')}")
94 100
    public void joinVersionGroup(Long projectIterationId)
95 101
    {
96 102
       versionGroupServiceImpl.joinVersionGroup(group.getSlug(), projectIterationId);
97 103
    }
98 104
 
  105
+   @Transactional
99 106
    public void leaveVersionGroup(Long projectIterationId)
100 107
    {
101 108
       versionGroupServiceImpl.leaveVersionGroup(group.getSlug(), projectIterationId);
102 109
    }
103 110
 
104  
-   /*
105  
-    * @Transactional
106  
-    * 
107  
-    * @Restrict("#{s:hasRole('admin')}") public void joinGroup() {
108  
-    * log.debug("starting join tribe"); if (authenticatedAccount == null) {
109  
-    * log.error("failed to load auth person"); return; } try {
110  
-    * languageTeamServiceImpl.joinLanguageTeam(this.language,
111  
-    * authenticatedAccount.getPerson().getId());
112  
-    * Events.instance().raiseEvent("personJoinedTribe");
113  
-    * log.info("{0} joined tribe {1}", authenticatedAccount.getUsername(),
114  
-    * this.language);
115  
-    * FacesMessages.instance().add("You are now a member of the {0} language team"
116  
-    * , this.locale.retrieveNativeName()); } catch (Exception e) {
117  
-    * FacesMessages.instance().add(Severity.ERROR, e.getMessage()); } }
118  
-    * 
119  
-    * @Transactional public void leaveGroup() {
120  
-    * log.debug("starting leave tribe"); if (authenticatedAccount == null) {
121  
-    * log.error("failed to load auth person"); return; }
122  
-    * languageTeamServiceImpl.leaveLanguageTeam(this.language,
123  
-    * authenticatedAccount.getPerson().getId());
124  
-    * Events.instance().raiseEvent("personLeftTribe");
125  
-    * log.info("{0} left tribe {1}", authenticatedAccount.getUsername(),
126  
-    * this.language);
127  
-    * FacesMessages.instance().add("You have left the {0} language team",
128  
-    * this.locale.retrieveNativeName()); }
129  
-    * 
130  
-    * @Restrict("#{languageTeamAction.checkPermission('manage-language-team')}")
131  
-    * public void saveTeamCoordinator(HLocaleMember member) {
132  
-    * this.localeDAO.makePersistent(this.locale); this.localeDAO.flush(); if
133  
-    * (member.isCoordinator()) {
134  
-    * FacesMessages.instance().add("{0} has been made a Team Coordinator",
135  
-    * member.getPerson().getAccount().getUsername()); } else {
136  
-    * FacesMessages.instance
137  
-    * ().add("{0} has been removed from Team Coordinators",
138  
-    * member.getPerson().getAccount().getUsername()); } }
139  
-    * 
140  
-    * @Restrict("#{languageTeamAction.checkPermission('manage-language-team')}")
141  
-    * public void addTeamMember(final Long personId) {
142  
-    * this.languageTeamServiceImpl.joinLanguageTeam(this.language, personId); //
143  
-    * reload the locale for changes this.locale =
144  
-    * localeServiceImpl.getByLocaleId(new LocaleId(language)); }
145  
-    * 
146  
-    * @Restrict("#{languageTeamAction.checkPermission('manage-language-team')}")
147  
-    * public void removeMembership(HLocaleMember member) {
148  
-    * this.languageTeamServiceImpl.leaveLanguageTeam(this.language,
149  
-    * member.getPerson().getId()); this.locale.getMembers().remove(member); }
150  
-    * 
151  
-    * public boolean isPersonInTeam(final Long personId) { for (HLocaleMember lm
152  
-    * : this.locale.getMembers()) { if (lm.getPerson().getId().equals(personId))
153  
-    * { return true; } } return false; }
154  
-    */
155  
-
156 111
    public void searchProjectAndVersion()
157 112
    {
158 113
       try
@@ -164,4 +119,28 @@ public void searchProjectAndVersion()
164 119
          return;
165 120
       }
166 121
    }
  122
+
  123
+   public boolean filterGroupByName( Object groupObject )
  124
+   {
  125
+      final HIterationGroup group = (HIterationGroup)groupObject;
  126
+      
  127
+      if( this.groupNameFilter != null && this.groupNameFilter.length() > 0 )
  128
+      {
  129
+         return group.getName().toLowerCase().contains( this.groupNameFilter.toLowerCase() );
  130
+      }
  131
+      else
  132
+      {
  133
+         return true;
  134
+      }
  135
+   }
  136
+   
  137
+   public String getGroupNameFilter()
  138
+   {
  139
+      return groupNameFilter;
  140
+   }
  141
+
  142
+   public void setGroupNameFilter(String groupNameFilter)
  143
+   {
  144
+      this.groupNameFilter = groupNameFilter;
  145
+   }
167 146
 }
2  server/zanata-war/src/main/java/org/zanata/action/VersionGroupMaintainerManageAction.java
@@ -102,7 +102,7 @@ public String addMaintainers(String account)
102 102
       }
103 103
       if (!a.isEnabled())
104 104
       {
105  
-         FacesMessages.instance().add("This account has been disabled.");
  105
+         FacesMessages.instance().add("This account is disabled.");
106 106
          return "failure";
107 107
       }
108 108
       FacesMessages.instance().add("This account does not exist.");
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/cell_middle_bg.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/cell_top_bg.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/menu_active_bg.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/panel-header-bg.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/photos.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/cross.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/help.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/home.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/photos.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/tick.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/user.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/world.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/wrench.png
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/zoom.png
4  server/zanata-war/src/main/webapp/WEB-INF/layout/add_maintainer_form.xhtml
@@ -12,8 +12,8 @@
12 12
         <s:decorate id="userField"
13 13
                     template="../layout/edit.xhtml">
14 14
             <ui:define name="label">#{messages['jsf.Username']}</ui:define>
15  
-            <h:inputText id="input" value="#{accountSearch.maintainer}" size="40">
16  
-                <a4j:support event="onblur" reRender="output" action="#{accountSearch.update}" />
  15
+            <h:inputText id="input" value="#{accountSearch.maintainer}" size="40" >
  16
+                <a4j:support event="onchange" reRender="results" action="#{accountSearch.update}" />
17 17
             </h:inputText>
18 18
             <rich:suggestionbox width="290" suggestionAction="#{accountSearch.search}" var="account" for="input">
19 19
                 <h:column>
15  server/zanata-war/src/main/webapp/version-group/home.xhtml
@@ -31,8 +31,19 @@
31 31
               <s:token allowMultiplePosts="true" />
32 32
               <rich:dataTable id="threads" value="#{allVersionGroups}"
33 33
                               var="group">
34  
-                  <rich:column sortBy="#{group.name}">
35  
-                  	  <f:facet name="header">#{messages['jsf.Name']}</f:facet>
  34
+                  <rich:column filterMethod="#{versionGroupAction.filterGroupByName}">
  35
+                  	  <f:facet name="header">
  36
+                  	  	#{messages['jsf.Name']}
  37
+                  	  	<h:panelGroup>
  38
+							<h:outputText value="#{messages['jsf.Name']}" />
  39
+							<br />
  40
+							<h:inputText value="#{versionGroupAction.groupNameFilter}"
  41
+								id="name_filter_input">
  42
+								<a4j:support event="onkeyup" reRender="threads"
  43
+									ignoreDupResponses="true" requestDelay="700" focus="name_filter_input" />
  44
+							</h:inputText>
  45
+						</h:panelGroup>
  46
+                  	  </f:facet>
36 47
                       <s:link id="versionGroup" styleClass="table_link" value="#{group.name}" propagation="none"
37 48
                              view="/version-group/version_group.xhtml"> 
38 49
                             <f:param name="slug" value="#{group.slug}"/>
2  server/zanata-war/src/main/webapp/version-group/version_group.xhtml
@@ -93,7 +93,7 @@
93 93
                                         value="#{versionGroupAction.searchResults}" var="projectIteration">
94 94
                             <f:facet name="header">#{messages['jsf.SearchResults']}</f:facet>
95 95
                             <rich:column sortBy="#{projectIteration.project.name}">
96  
-                                <f:facet name="header">#{messages['jsf.Project']}</f:facet>
  96
+                                <f:facet name="header">#{messages['jsf.ProjectName']}</f:facet>
97 97
                                 #{projectIteration.project.name}
98 98
                             </rich:column>
99 99
                             <rich:column sortBy="#{projectIteration.slug}">

0 notes on commit 064644c

Please sign in to comment.
Something went wrong with that request. Please try again.