Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…nused images
  • Loading branch information...
commit 064644c2064e26efe6dd54d1fb18bd70e7cc124d 1 parent 241e4fa
Alex Eng aeng authored
Showing with 48 additions and 58 deletions.
  1. +31 −52 server/zanata-war/src/main/java/org/zanata/action/VersionGroupAction.java
  2. +1 −1  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. +2 −2 server/zanata-war/src/main/webapp/WEB-INF/layout/add_maintainer_form.xhtml
  18. +13 −2 server/zanata-war/src/main/webapp/version-group/home.xhtml
  19. +1 −1  server/zanata-war/src/main/webapp/version-group/version_group.xhtml
83 server/zanata-war/src/main/java/org/zanata/action/VersionGroupAction.java
View
@@ -29,8 +29,11 @@
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.log.Log;
+import org.zanata.model.HDocument;
import org.zanata.model.HIterationGroup;
import org.zanata.model.HProjectIteration;
import org.zanata.service.VersionGroupService;
@@ -52,6 +55,7 @@
private HIterationGroup group;
private String searchTerm;
+ private String groupNameFilter;
private List<HProjectIteration> searchResults;
public void loadAllActiveGroups()
@@ -91,68 +95,19 @@ public boolean isVersionInGroup(Long projectIterationId)
return false;
}
+ @Transactional
+ @Restrict("#{s:hasPermission(versionGroupHome.instance, 'update')}")
public void joinVersionGroup(Long projectIterationId)
{
versionGroupServiceImpl.joinVersionGroup(group.getSlug(), projectIterationId);
}
+ @Transactional
public void leaveVersionGroup(Long projectIterationId)
{
versionGroupServiceImpl.leaveVersionGroup(group.getSlug(), projectIterationId);
}
- /*
- * @Transactional
- *
- * @Restrict("#{s:hasRole('admin')}") public void joinGroup() {
- * log.debug("starting join tribe"); if (authenticatedAccount == null) {
- * log.error("failed to load auth person"); return; } try {
- * languageTeamServiceImpl.joinLanguageTeam(this.language,
- * authenticatedAccount.getPerson().getId());
- * Events.instance().raiseEvent("personJoinedTribe");
- * log.info("{0} joined tribe {1}", authenticatedAccount.getUsername(),
- * this.language);
- * FacesMessages.instance().add("You are now a member of the {0} language team"
- * , this.locale.retrieveNativeName()); } catch (Exception e) {
- * FacesMessages.instance().add(Severity.ERROR, e.getMessage()); } }
- *
- * @Transactional public void leaveGroup() {
- * log.debug("starting leave tribe"); if (authenticatedAccount == null) {
- * log.error("failed to load auth person"); return; }
- * languageTeamServiceImpl.leaveLanguageTeam(this.language,
- * authenticatedAccount.getPerson().getId());
- * Events.instance().raiseEvent("personLeftTribe");
- * log.info("{0} left tribe {1}", authenticatedAccount.getUsername(),
- * this.language);
- * FacesMessages.instance().add("You have left the {0} language team",
- * this.locale.retrieveNativeName()); }
- *
- * @Restrict("#{languageTeamAction.checkPermission('manage-language-team')}")
- * public void saveTeamCoordinator(HLocaleMember member) {
- * this.localeDAO.makePersistent(this.locale); this.localeDAO.flush(); if
- * (member.isCoordinator()) {
- * FacesMessages.instance().add("{0} has been made a Team Coordinator",
- * member.getPerson().getAccount().getUsername()); } else {
- * FacesMessages.instance
- * ().add("{0} has been removed from Team Coordinators",
- * member.getPerson().getAccount().getUsername()); } }
- *
- * @Restrict("#{languageTeamAction.checkPermission('manage-language-team')}")
- * public void addTeamMember(final Long personId) {
- * this.languageTeamServiceImpl.joinLanguageTeam(this.language, personId); //
- * reload the locale for changes this.locale =
- * localeServiceImpl.getByLocaleId(new LocaleId(language)); }
- *
- * @Restrict("#{languageTeamAction.checkPermission('manage-language-team')}")
- * public void removeMembership(HLocaleMember member) {
- * this.languageTeamServiceImpl.leaveLanguageTeam(this.language,
- * member.getPerson().getId()); this.locale.getMembers().remove(member); }
- *
- * public boolean isPersonInTeam(final Long personId) { for (HLocaleMember lm
- * : this.locale.getMembers()) { if (lm.getPerson().getId().equals(personId))
- * { return true; } } return false; }
- */
-
public void searchProjectAndVersion()
{
try
@@ -164,4 +119,28 @@ public void searchProjectAndVersion()
return;
}
}
+
+ public boolean filterGroupByName( Object groupObject )
+ {
+ final HIterationGroup group = (HIterationGroup)groupObject;
+
+ if( this.groupNameFilter != null && this.groupNameFilter.length() > 0 )
+ {
+ return group.getName().toLowerCase().contains( this.groupNameFilter.toLowerCase() );
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ public String getGroupNameFilter()
+ {
+ return groupNameFilter;
+ }
+
+ public void setGroupNameFilter(String groupNameFilter)
+ {
+ this.groupNameFilter = groupNameFilter;
+ }
}
2  server/zanata-war/src/main/java/org/zanata/action/VersionGroupMaintainerManageAction.java
View
@@ -102,7 +102,7 @@ public String addMaintainers(String account)
}
if (!a.isEnabled())
{
- FacesMessages.instance().add("This account has been disabled.");
+ FacesMessages.instance().add("This account is disabled.");
return "failure";
}
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
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/cell_top_bg.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/menu_active_bg.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/panel-header-bg.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/photos.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/cross.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/help.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/home.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/photos.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/tick.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/user.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/world.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/wrench.png
View
Deleted file not rendered
BIN  server/zanata-war/src/main/resources/org/zanata/webtrans/images/public-img/silk/zoom.png
View
Deleted file not rendered
4 server/zanata-war/src/main/webapp/WEB-INF/layout/add_maintainer_form.xhtml
View
@@ -12,8 +12,8 @@
<s:decorate id="userField"
template="../layout/edit.xhtml">
<ui:define name="label">#{messages['jsf.Username']}</ui:define>
- <h:inputText id="input" value="#{accountSearch.maintainer}" size="40">
- <a4j:support event="onblur" reRender="output" action="#{accountSearch.update}" />
+ <h:inputText id="input" value="#{accountSearch.maintainer}" size="40" >
+ <a4j:support event="onchange" reRender="results" action="#{accountSearch.update}" />
</h:inputText>
<rich:suggestionbox width="290" suggestionAction="#{accountSearch.search}" var="account" for="input">
<h:column>
15 server/zanata-war/src/main/webapp/version-group/home.xhtml
View
@@ -31,8 +31,19 @@
<s:token allowMultiplePosts="true" />
<rich:dataTable id="threads" value="#{allVersionGroups}"
var="group">
- <rich:column sortBy="#{group.name}">
- <f:facet name="header">#{messages['jsf.Name']}</f:facet>
+ <rich:column filterMethod="#{versionGroupAction.filterGroupByName}">
+ <f:facet name="header">
+ #{messages['jsf.Name']}
+ <h:panelGroup>
+ <h:outputText value="#{messages['jsf.Name']}" />
+ <br />
+ <h:inputText value="#{versionGroupAction.groupNameFilter}"
+ id="name_filter_input">
+ <a4j:support event="onkeyup" reRender="threads"
+ ignoreDupResponses="true" requestDelay="700" focus="name_filter_input" />
+ </h:inputText>
+ </h:panelGroup>
+ </f:facet>
<s:link id="versionGroup" styleClass="table_link" value="#{group.name}" propagation="none"
view="/version-group/version_group.xhtml">
<f:param name="slug" value="#{group.slug}"/>
2  server/zanata-war/src/main/webapp/version-group/version_group.xhtml
View
@@ -93,7 +93,7 @@
value="#{versionGroupAction.searchResults}" var="projectIteration">
<f:facet name="header">#{messages['jsf.SearchResults']}</f:facet>
<rich:column sortBy="#{projectIteration.project.name}">
- <f:facet name="header">#{messages['jsf.Project']}</f:facet>
+ <f:facet name="header">#{messages['jsf.ProjectName']}</f:facet>
#{projectIteration.project.name}
</rich:column>
<rich:column sortBy="#{projectIteration.slug}">
Please sign in to comment.
Something went wrong with that request. Please try again.