summaryrefslogtreecommitdiffstats
path: root/base/server/share/webapps/pki
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-02-03 19:20:31 +0100
committerEndi S. Dewata <edewata@redhat.com>2016-02-05 22:40:44 +0100
commit9bd94a0a54793a0720b803846ce2291e5064c2ae (patch)
tree0e0d5731923844454c23fc89e7a10b5abb708a58 /base/server/share/webapps/pki
parent987dda15acdd6e6f4c7c477fed122a76ad40260c (diff)
downloadpki-9bd94a0a54793a0720b803846ce2291e5064c2ae.tar.gz
pki-9bd94a0a54793a0720b803846ce2291e5064c2ae.tar.xz
pki-9bd94a0a54793a0720b803846ce2291e5064c2ae.zip
Added resource bundle for token state labels.
The labels for token states and the transitions are now stored in token-states.properties. The default file will be stored in the /usr/share/pki/tps/conf, but it can be overriden by copying and customizing the file into <instance>/tps/conf. When the UI retrieves the token data the labels for the current state and the valid transitions will be loaded from the file and returned to the UI. The UI will show the transition labels in the dropdown list for changing token status. https://fedorahosted.org/pki/ticket/1289 https://fedorahosted.org/pki/ticket/1291
Diffstat (limited to 'base/server/share/webapps/pki')
-rw-r--r--base/server/share/webapps/pki/js/pki-ui.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/base/server/share/webapps/pki/js/pki-ui.js b/base/server/share/webapps/pki/js/pki-ui.js
index c6e326a0c..0729895aa 100644
--- a/base/server/share/webapps/pki/js/pki-ui.js
+++ b/base/server/share/webapps/pki/js/pki-ui.js
@@ -456,8 +456,24 @@ var TableItem = Backbone.View.extend({
break;
}
- var name = RegExp.$1;
- var value = self.get(name);
+ // get attribute name
+ var fullName = RegExp.$1;
+
+ // split attribute names
+ var names = fullName.split(".");
+
+ // get the value from the leaf object
+ var value;
+ for (var i=0; i<names.length; i++) {
+ var name = names[i];
+ if (i == 0) {
+ value = self.get(name);
+ } else {
+ value = value[name];
+ }
+ if (! value) break;
+ }
+
if (value === undefined) value = "";
if (value instanceof Date) value = value.toUTCString();
@@ -465,7 +481,7 @@ var TableItem = Backbone.View.extend({
newContent += content.substring(0, index) + value;
// process the remaining content
- content = content.substring(index + name.length + 3);
+ content = content.substring(index + fullName.length + 3);
}
td.html(newContent);