>From 219672f57dfc277f85c127e3df0e2d9532106cac Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 3 Feb 2016 19:20:31 +0100 Subject: [PATCH] Added property file for token state and transition labels. The labels for token states and transitions are now stored in token-states.properties. The labels will be loaded when the UI is initialized. The dialog box for changing token status will now show the transition labels. The property file later can be moved into the theme package to allow customization. https://fedorahosted.org/pki/ticket/1289 https://fedorahosted.org/pki/ticket/1291 --- base/tps/shared/webapps/tps/js/token.js | 14 ++++--------- base/tps/shared/webapps/tps/ui/index.html | 24 +++++++++++++++++++++- .../shared/webapps/tps/ui/token-states.properties | 21 +++++++++++++++++++ 3 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 base/tps/shared/webapps/tps/ui/token-states.properties diff --git a/base/tps/shared/webapps/tps/js/token.js b/base/tps/shared/webapps/tps/js/token.js index 1a4267f72de1c378522dc16ec18f3c90414f1dd7..a2d25fd6eaf39161fd6fb0e611929789ef87851d 100644 --- a/base/tps/shared/webapps/tps/js/token.js +++ b/base/tps/shared/webapps/tps/js/token.js @@ -19,15 +19,9 @@ * @author Endi S. Dewata */ -var TokenStatus = { - UNINITIALIZED: "Uninitialized", - ACTIVE: "Active", - TEMP_LOST: "Temporarily lost", - PERM_LOST: "Permanently lost", - DAMAGED: "Physically damaged", - TEMP_LOST_PERM_LOST: "Temporarily lost then permanently lost", - TERMINATED: "Terminated" -}; +// contents are defined in token-states.properties +var TokenStatus = {}; +var TokenStateTransition = {}; var TokenModel = Model.extend({ urlRoot: "/tps/rest/tokens", @@ -125,7 +119,7 @@ var TokenDialog = Dialog.extend({ var nextStates = self.entry["nextStates"]; _.each(nextStates, function(nextState) { $('