From 0b6b214b717ad035ad0bd1bce6f6ab6f00d745ca 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..b2b2877c2440432bd24d451b0adb1e5988423383 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) { $('