From 12ee9365a7a08c7a45887b98f17a44c64d7eb5f0 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Thu, 19 Aug 2010 20:48:21 -0400 Subject: Changes the URL parsing from standard HTML params ( starting with ?) to hash params ( starting with # ). User Details are now part of index.xhtml, ao one more .inc file has been removed. Updated commit to catch a few things that had been left out, including sampledata handling and updateing Makefile.am --- install/static/Makefile.am | 2 - install/static/details.js | 11 ++--- install/static/group-details.inc | 32 --------------- install/static/group.js | 51 +++++++++++++++++++----- install/static/index.xhtml | 37 +++++++++++++++-- install/static/ipa.css | 14 +++---- install/static/ipa.js | 21 +++++++++- install/static/navigation.js | 46 ++++++++++++++++++--- install/static/search.js | 86 +++++++++++++++++++--------------------- install/static/user-details.inc | 27 ------------- install/static/user.js | 55 +++++++++++++------------ 11 files changed, 216 insertions(+), 166 deletions(-) delete mode 100644 install/static/group-details.inc delete mode 100644 install/static/user-details.inc (limited to 'install/static') diff --git a/install/static/Makefile.am b/install/static/Makefile.am index 762587179..8e1dc1bcf 100644 --- a/install/static/Makefile.am +++ b/install/static/Makefile.am @@ -11,7 +11,6 @@ app_DATA = \ ipa.css \ jquery.js \ group.js \ - group-details.inc \ host.js \ hostgroup.js \ index.xhtml \ @@ -23,7 +22,6 @@ app_DATA = \ details.js \ user.js \ user-add.inc \ - user-details.inc \ ipalogo.png \ gray-fade-line.png \ Mainnav-background.png \ diff --git a/install/static/details.js b/install/static/details.js index d47cfe8b5..bdfafc0a8 100644 --- a/install/static/details.js +++ b/install/static/details.js @@ -39,7 +39,7 @@ var _ipa_load_on_fail_callback = null; var ipa_details_cache = null; -function ipa_details_load(pkey, on_win, on_fail) +function ipa_details_load(pkey, on_win, on_fail,sampleData) { if (!pkey) return; @@ -49,8 +49,7 @@ function ipa_details_load(pkey, on_win, on_fail) ipa_cmd( 'show', [pkey], {all: true}, _ipa_load_on_win, _ipa_load_on_fail, - _ipa_obj_name - ); + _ipa_obj_name, sampleData ); } function _ipa_load_on_win(data, text_status, xhr) @@ -171,7 +170,9 @@ function ipa_details_create(dls, container) for (var i = 0; i < dls.length; ++i) { var d = dls[i]; - ipa_generate_dl(container.children('hr').last(), d[0], d[1], d[2]); + + ipa_generate_dl($('#detail-lists hr').last(), d[0], d[1], d[2]); +// ipa_generate_dl($("#detail-lists"), d[0], d[1], d[2]); } } @@ -188,7 +189,6 @@ function ipa_generate_dl(jobj, id, name, dts) jobj = jobj.next(); jobj.after(_ipa_dl_template.replace('I', id)); jobj = jobj.next(); - jobj.after('
'); for (var i = 0; i < dts.length; ++i) { var label = ''; @@ -203,6 +203,7 @@ function ipa_generate_dl(jobj, id, name, dts) _ipa_dt_template.replace('T', dts[i][0]).replace('N', label) ); } + jobj.after('
'); } /* HTML templates for ipa_details_display() */ diff --git a/install/static/group-details.inc b/install/static/group-details.inc deleted file mode 100644 index 445042b8d..000000000 --- a/install/static/group-details.inc +++ /dev/null @@ -1,32 +0,0 @@ - -

Managing group:

-
- Reset - Update -
- -
- -

− Group Details

-
-
Group Name:
-
Description:
-
GID
-
-
- - diff --git a/install/static/group.js b/install/static/group.js index eddb272c6..beb10879c 100644 --- a/install/static/group.js +++ b/install/static/group.js @@ -68,29 +68,60 @@ function setupAddGroup(){ } -function setupGroupDetails(){ +var group_details_list = + [['identity', 'Group Details', [ + ['cn', 'Group Name'], + ['description', 'Description'], + ['gidnumber', 'Group ID']]]]; - $('#search').css("visibility","hidden"); - $('#content').css("visibility","visible"); - $('#content').load("group-details.inc"); - sampleData = "sampledata/groupshow.json"; +function setupGroupDetails(group){ + + window.location.hash="#tab=user&facet=details&pkey="+group; + + //re initialize global parse of parameters + qs = ipa_parse_qs(); + + //TODO make this work for more than just user details + user_details_lists; + + showDetails(); + + ipa_details_init('group'); + ipa_details_create(group_details_list, $('#details')); + ipa_details_load(qs['pkey'], on_win, null, "sampledata/groupshow.json"); + $('h1').text('Managing group: ' + group); } + + +function renderGroupDetails(group) +{ + +} + + +function renderGroupDetailColumn(current,cell){ + + $("",{ + href:"#tab=group&facet=details&pkey="+current.cn, + html: ""+ current[this.column], + click: function(){ setupGroupDetails(current.cn)}, + }).appendTo(cell); +} + + function setupGroupSearch(){ var columns = [ - {title:"Group Name", column:"cn",render: function(current,cell){ - renderDetailColumn(current,cell,current[this.column],"group"); - }}, + {title:"Group Name", column:"cn",render: renderGroupDetailColumn}, {title:"GID", column:"gidnumber",render: renderSimpleColumn}, {title:"Description", column:"description",render: renderSimpleColumn} ]; - var groupSearchForm = new SearchForm("group", "find", columns); + var groupSearchForm = new SearchForm("group", "find", columns,"sampledata/grouplist.json"); $("#query").unbind(); $("#query").click(function(){ - sampleData = "sampledata/grouplist.json"; executeSearch(groupSearchForm); }); $("#new").unbind(); diff --git a/install/static/index.xhtml b/install/static/index.xhtml index e94e6d18e..935f226cd 100644 --- a/install/static/index.xhtml +++ b/install/static/index.xhtml @@ -16,7 +16,6 @@