summaryrefslogtreecommitdiffstats
path: root/base/server/share/webapps/pki
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2014-04-11 12:18:53 -0400
committerEndi S. Dewata <edewata@redhat.com>2014-04-15 14:51:14 -0400
commit25eae6fd27fa774a683db1389b7c081d72d2fa22 (patch)
treed14d112397de52371313fba98a880d07618a7bb1 /base/server/share/webapps/pki
parent4e548279b92af62b913c1678e84a695366608540 (diff)
downloadpki-25eae6fd27fa774a683db1389b7c081d72d2fa22.tar.gz
pki-25eae6fd27fa774a683db1389b7c081d72d2fa22.tar.xz
pki-25eae6fd27fa774a683db1389b7c081d72d2fa22.zip
Replaced token dialog with token page.
The dialog used to edit token attributes has been replaced with a details page since it will be required for breadcrumbs. A new HTML template has been added for this page. Changing token status now can be done both in token list page and in token details page. The EntryPage has been modified such that it requires the editable fields to be specified for the add mode. To improve the appearance, the input fields in all dialogs and pages will now appear as read-only while the data is still loading. Ticket #654
Diffstat (limited to 'base/server/share/webapps/pki')
-rw-r--r--base/server/share/webapps/pki/js/pki-ui.js50
1 files changed, 22 insertions, 28 deletions
diff --git a/base/server/share/webapps/pki/js/pki-ui.js b/base/server/share/webapps/pki/js/pki-ui.js
index 9ba801012..ce5d5ccff 100644
--- a/base/server/share/webapps/pki/js/pki-ui.js
+++ b/base/server/share/webapps/pki/js/pki-ui.js
@@ -473,13 +473,14 @@ var TableItem = Backbone.View.extend({
// add link handler
$("a", td).click(function(e) {
- self.open(td);
e.preventDefault();
+ self.open(td);
});
},
open: function(td) {
var self = this;
- self.table.open(self);
+ var column = td.attr("name");
+ self.table.open(self, column);
}
});
@@ -985,12 +986,6 @@ var EntryPage = Page.extend({
// Use blank entry.
self.entry = {};
- // All fields are editable.
- self.$(".pki-fields input").each(function(index) {
- var input = $(this);
- input.removeAttr("readonly");
- });
-
} else {
// Use fetched entry.
self.entry = _.clone(self.model.attributes);
@@ -998,33 +993,32 @@ var EntryPage = Page.extend({
// Show entry ID in the title.
self.$("span[name='id']").text(self.entry.id);
- if (self.mode == "edit") {
- // Show editable fields.
- self.$(".pki-fields input").each(function(index) {
- var input = $(this);
- var name = input.attr("name");
- if (_.contains(self.editable, name)) {
- input.removeAttr("readonly");
- } else {
- input.attr("readonly", "readonly");
- }
- });
-
- } else { // self.mode == "view"
- // All fields are read-only.
- self.$(".pki-fields input").each(function(index) {
- var input = $(this);
- input.attr("readonly", "readonly");
- });
- }
}
if (self.mode == "view") {
- self.menu.show();
+ // All fields are read-only.
+ self.$(".pki-fields input").each(function(index) {
+ var input = $(this);
+ input.attr("readonly", "readonly");
+ });
+
self.buttons.hide();
+ self.menu.show();
} else {
self.menu.hide();
+
+ // Show editable fields.
+ self.$(".pki-fields input").each(function(index) {
+ var input = $(this);
+ var name = input.attr("name");
+ if (_.contains(self.editable, name)) {
+ input.removeAttr("readonly");
+ } else {
+ input.attr("readonly", "readonly");
+ }
+ });
+
self.buttons.show();
}