Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #713 from zanata/fix-about-message
Browse files Browse the repository at this point in the history
Ensure that a success message is shown when project about page is updated
  • Loading branch information
davidmason committed Mar 5, 2015
2 parents 13498ff + ed0ebdb commit cadeb3d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions zanata-war/src/main/java/org/zanata/action/ProjectHome.java
Expand Up @@ -966,6 +966,19 @@ public List<ValidationAction.State> getValidationStates() {
return Arrays.asList(ValidationAction.State.values());
}

/**
* Update the about page to the entered value, and show a success message.
*/
@Restrict("#{s:hasPermission(projectHome.instance, 'update')}")
public void updateAboutPage() {
String status = update();
if ("updated".equals(status)) {
FacesMessages.instance().add(StatusMessage.Severity.INFO, msgs.get("jsf.project.AboutPageUpdated"));
} else {
FacesMessages.instance().add(StatusMessage.Severity.ERROR, msgs.get("jsf.project.AboutPageUpdateFailed"));
}
}

@Override
protected void updatedMessage() {
// Disable the default message from Seam
Expand Down
2 changes: 2 additions & 0 deletions zanata-war/src/main/resources/messages.properties
Expand Up @@ -290,6 +290,8 @@ jsf.languageSettings.LanguagesDisabled=Disabled languages: {0}.
jsf.languageSettings.LanguageEnabled=Language "{0}" has been enabled.
jsf.languageSettings.LanguagesEnabled=Enabled languages: {0}.
jsf.project.LanguageUpdateFromGlobal=Updated languages from global settings.
jsf.project.AboutPageUpdated=About page updated.
jsf.project.AboutPageUpdateFailed=There was a problem while updating the about page.
jsf.project.AddWebhook=Add webhook
jsf.project.RemoveWebhook=Webhook {0} removed.
jsf.project.AddNewWebhook=Webhook {0} added.
Expand Down
Expand Up @@ -490,7 +490,7 @@
</p>

<a4j:commandLink value="#{msgs['jsf.project.saveNotes']}"
action="#{projectHome.update}" rendered="#{projectHome.managed}"
action="#{projectHome.updateAboutPage}" rendered="#{projectHome.managed}"
render="project-about"
styleClass="l--push-top-1 button button--primary"/>
</h:form>
Expand Down

0 comments on commit cadeb3d

Please sign in to comment.