You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2014/11/12 21:40:26 UTC

ambari git commit: AMBARI-7924 Background operation notification plurality should match number of operations (apenniston via jaoki)

Repository: ambari
Updated Branches:
  refs/heads/trunk 2f639afe7 -> a77f8bd1d


AMBARI-7924 Background operation notification plurality should match number of operations (apenniston via jaoki)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a77f8bd1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a77f8bd1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a77f8bd1

Branch: refs/heads/trunk
Commit: a77f8bd1dc3588d9342dc6aabcf5b16dd2e9a01c
Parents: 2f639af
Author: Jun Aoki <ja...@apache.org>
Authored: Wed Nov 12 12:40:07 2014 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Wed Nov 12 12:40:07 2014 -0800

----------------------------------------------------------------------
 ambari-web/app/messages.js               | 1 +
 ambari-web/app/templates/application.hbs | 6 ++++--
 ambari-web/app/utils/helper.js           | 6 +++---
 3 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a77f8bd1/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index c57a854..f795909 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -60,6 +60,7 @@ Em.I18n.translations = {
   'yes':'Yes',
   'no':'No',
   'add': 'Add',
+  'op': 'op',
   'ops': 'ops',
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a77f8bd1/ambari-web/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/application.hbs b/ambari-web/app/templates/application.hbs
index 1796a27..4034b03 100644
--- a/ambari-web/app/templates/application.hbs
+++ b/ambari-web/app/templates/application.hbs
@@ -28,9 +28,11 @@
               <span {{action "showPopup" target="App.router.backgroundOperationsController"}} >{{clusterDisplayName}} </span>
               {{#with App.router.backgroundOperationsController}}
                 {{#if allOperationsCount}}
-                  <i class="icon-caret-left ops-count"></i><span class="label operations-count" {{action "showPopup" target="App.router.backgroundOperationsController"}}> {{allOperationsCount}} {{t ops}}</span>
+                  <i class="icon-caret-left ops-count"></i><span class="label operations-count" {{action "showPopup" target="App.router.backgroundOperationsController"}}>
+                    {{allOperationsCount}} {{pluralize allOperationsCount singular="t:op" plural="t:ops"}}</span>
                 {{else}}
-                  <i class="icon-caret-left"></i><span class="label" {{action "showPopup" target="App.router.backgroundOperationsController"}}>{{allOperationsCount}} {{t ops}}</span>
+                  <i class="icon-caret-left"></i><span class="label" {{action "showPopup" target="App.router.backgroundOperationsController"}}>
+                    {{allOperationsCount}} {{pluralize allOperationsCount singular="t:op" plural="t:ops"}}</span>
                 {{/if}}
               {{/with}}
             </a>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a77f8bd1/ambari-web/app/utils/helper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js
index 5a25b8f..27efd87 100644
--- a/ambari-web/app/utils/helper.js
+++ b/ambari-web/app/utils/helper.js
@@ -596,10 +596,10 @@ App.registerBoundHelper('pluralize', Em.View.extend({
     if (!plural) plural = singular + 's';
     else plural = this.parseValue(plural);
     if (singular && plural) {
-      if (count > 1) {
-        return plural;
-      } else {
+      if (count == 1) {
         return singular;
+      } else {
+        return plural;
       }
     }
     return '';