summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2014-04-11 14:42:15 -0400
committerEndi S. Dewata <edewata@redhat.com>2014-04-15 14:51:46 -0400
commit76f6a8d73ad2fd39b24146317e72a0f7c88b3276 (patch)
tree81a902ca9602a04268827c66f3a09734f2bf1f87
parentbeacfc52bd5cc47d9c04ab48090994826e4353ef (diff)
downloadpki-76f6a8d73ad2fd39b24146317e72a0f7c88b3276.tar.gz
pki-76f6a8d73ad2fd39b24146317e72a0f7c88b3276.tar.xz
pki-76f6a8d73ad2fd39b24146317e72a0f7c88b3276.zip
Replaced certificate dialog with certificate page.
The dialog used to view certificate 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. Ticket #654
-rw-r--r--base/tps-tomcat/shared/webapps/tps/js/cert.js46
-rw-r--r--base/tps-tomcat/shared/webapps/tps/ui/cert.html43
-rw-r--r--base/tps-tomcat/shared/webapps/tps/ui/certs.html33
-rw-r--r--base/tps-tomcat/shared/webapps/tps/ui/index.html2
4 files changed, 81 insertions, 43 deletions
diff --git a/base/tps-tomcat/shared/webapps/tps/js/cert.js b/base/tps-tomcat/shared/webapps/tps/js/cert.js
index 2ef0c3a63..6754b3b53 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/cert.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/cert.js
@@ -72,21 +72,49 @@ var CertificateCollection = Collection.extend({
}
});
-var CertificatePage = Page.extend({
- load: function() {
+var CertificatePage = EntryPage.extend({
+ initialize: function(options) {
+ var self = this;
+ CertificatePage.__super__.initialize.call(self, options);
+ self.parentPage = options.parentPage;
+ },
+ close: function() {
var self = this;
+ if (self.parentPage) {
+ self.parentPage.open();
+ } else {
+ CertificatePage.__super__.close.call(self);
+ }
+ }
+});
- var editDialog = new Dialog({
- el: $("#certificate-dialog"),
- title: "Edit Certificate",
- readonly: ["id", "serialNumber", "subject", "tokenID", "userID",
- "keyType", "status", "createTime", "modifyTime"]
+var CertificatesTable = ModelTable.extend({
+ initialize: function(options) {
+ var self = this;
+ CertificatesTable.__super__.initialize.call(self, options);
+ self.parentPage = options.parentPage;
+ },
+ open: function(item, column) {
+ var self = this;
+
+ var page = new CertificatePage({
+ el: self.parentPage.$el,
+ url: "cert.html",
+ model: self.collection.get(item.entry.id)
});
- var table = new ModelTable({
+ page.open();
+ }
+});
+
+var CertificatesPage = Page.extend({
+ load: function() {
+ var self = this;
+
+ var table = new CertificatesTable({
el: $("table[name='certificates']"),
collection: new CertificateCollection(),
- editDialog: editDialog
+ parentPage: self
});
table.render();
diff --git a/base/tps-tomcat/shared/webapps/tps/ui/cert.html b/base/tps-tomcat/shared/webapps/tps/ui/cert.html
new file mode 100644
index 000000000..e750527b1
--- /dev/null
+++ b/base/tps-tomcat/shared/webapps/tps/ui/cert.html
@@ -0,0 +1,43 @@
+<!-- --- BEGIN COPYRIGHT BLOCK ---
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Copyright (C) 2013 Red Hat, Inc.
+ All rights reserved.
+ --- END COPYRIGHT BLOCK --- -->
+<div class="pki-header">
+<span class="pki-title">Certificate <span name="id"></span></span>
+</div>
+
+<div name="certificate" class="pki-fields">
+<fieldset>
+ <label>Certificate ID</label>
+ <input name="id" readonly="readonly"><br>
+ <label>Serial Number</label>
+ <input name="serialNumber" readonly="readonly"><br>
+ <label>Subject</label>
+ <input name="subject" readonly="readonly"><br>
+ <label>Token ID</label>
+ <input name="tokenID" readonly="readonly"><br>
+ <label>User ID</label>
+ <input name="userID" readonly="readonly"><br>
+ <label>Key Type</label>
+ <input name="keyType" readonly="readonly"><br>
+ <label>Status</label>
+ <input name="status" readonly="readonly"><br>
+ <label>Created</label>
+ <input name="createTime" readonly="readonly"><br>
+ <label>Modified</label>
+ <input name="modifyTime" readonly="readonly"><br>
+</fieldset>
+</div>
diff --git a/base/tps-tomcat/shared/webapps/tps/ui/certs.html b/base/tps-tomcat/shared/webapps/tps/ui/certs.html
index 15254c44c..f4b052009 100644
--- a/base/tps-tomcat/shared/webapps/tps/ui/certs.html
+++ b/base/tps-tomcat/shared/webapps/tps/ui/certs.html
@@ -80,36 +80,3 @@
</tr>
</tfoot>
</table>
-
-<div id="certificate-dialog" class="rcue-dialog-background">
- <div class="rcue-dialog">
- <header>
- <h1>Certificate</h1>
- <a class="rcue-button-close" href="#"></a>
- </header>
- <fieldset>
- <label>Certificate ID</label>
- <input name="id" readonly="readonly"><br>
- <label>Serial Number</label>
- <input name="serialNumber" readonly="readonly"><br>
- <label>Subject</label>
- <input name="subject" readonly="readonly"><br>
- <label>Token ID</label>
- <input name="tokenID" readonly="readonly"><br>
- <label>User ID</label>
- <input name="userID" readonly="readonly"><br>
- <label>Key Type</label>
- <input name="keyType" readonly="readonly"><br>
- <label>Status</label>
- <input name="status" readonly="readonly"><br>
- <label>Created</label>
- <input name="createTime" readonly="readonly"><br>
- <label>Modified</label>
- <input name="modifyTime" readonly="readonly"><br>
- </fieldset>
- <footer>
- <button name="save" class="primary">Save</button>
- <button name="cancel">Cancel</button>
- </footer>
- </div>
-</div>
diff --git a/base/tps-tomcat/shared/webapps/tps/ui/index.html b/base/tps-tomcat/shared/webapps/tps/ui/index.html
index 8de7e5bff..412892b01 100644
--- a/base/tps-tomcat/shared/webapps/tps/ui/index.html
+++ b/base/tps-tomcat/shared/webapps/tps/ui/index.html
@@ -76,7 +76,7 @@ $(function() {
url: "authenticators.html"
}));
- navigation.page("certs", new CertificatePage({
+ navigation.page("certs", new CertificatesPage({
el: content,
url: "certs.html"
}));