diff options
author | Endi S. Dewata <edewata@redhat.com> | 2013-11-26 21:40:28 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2013-12-06 03:18:59 -0500 |
commit | 0ae21ef7d59fd446f51ec880f90733dc71afd1bf (patch) | |
tree | f86ae6d8a5adc2b58bce44fa6e50a803ed8fb6de /base/server/share | |
parent | 8f6de6fd339c156ce3aad13ad5d45b635d194f79 (diff) | |
download | pki-0ae21ef7d59fd446f51ec880f90733dc71afd1bf.tar.gz pki-0ae21ef7d59fd446f51ec880f90733dc71afd1bf.tar.xz pki-0ae21ef7d59fd446f51ec880f90733dc71afd1bf.zip |
Added TPS UI skeleton.
An inititial implementation of TPS UI has been added. The UI will
display TPS resources as tables.
Ticket #654
Diffstat (limited to 'base/server/share')
-rw-r--r-- | base/server/share/webapps/pki/css/pki-ui.css | 29 | ||||
-rw-r--r-- | base/server/share/webapps/pki/js/pki-ui.js | 56 |
2 files changed, 85 insertions, 0 deletions
diff --git a/base/server/share/webapps/pki/css/pki-ui.css b/base/server/share/webapps/pki/css/pki-ui.css new file mode 100644 index 000000000..63df0ffd2 --- /dev/null +++ b/base/server/share/webapps/pki/css/pki-ui.css @@ -0,0 +1,29 @@ +/* --- 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 --- + * + * @author Endi S. Dewata + */ + +table { + border: 1px solid black; + border-spacing: 0; +} + +table td { + border: 1px solid black; +} diff --git a/base/server/share/webapps/pki/js/pki-ui.js b/base/server/share/webapps/pki/js/pki-ui.js new file mode 100644 index 000000000..35363b0f7 --- /dev/null +++ b/base/server/share/webapps/pki/js/pki-ui.js @@ -0,0 +1,56 @@ +/* --- 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 --- + * + * @author Endi S. Dewata + */ + +var TableItemView = Backbone.View.extend({ + render: function() { + var self = this; + $("td", self.el).each(function(index) { + var item = $(this); + var name = item.attr("name"); + var value = self.model.get(name); + item.text(value); + }); + } +}); + +var TableView = Backbone.View.extend({ + initialize: function() { + var self = this; + self.tbody = $("tbody", self.el); + self.template = $("tr", self.tbody).detach(); + self.render(); + }, + render: function() { + var self = this; + self.collection.fetch({ + success: function() { + _(self.collection.models).each(function(item) { + var itemView = new TableItemView({ + el: self.template.clone(), + model: item + }); + itemView.render(); + self.tbody.append(itemView.el); + }, self); + } + }); + } +}); |