action panel formatting

Cleans up the indentation of the action panel
Puts the sudo and HBAC entries in a consistent order
This commit is contained in:
Adam Young
2010-11-23 22:24:50 -05:00
committed by Endi Sukma Dewata
parent a34bb67cbd
commit 841c290113
8 changed files with 53 additions and 26 deletions

View File

@@ -457,9 +457,7 @@ function ipa_details_create(container)
var action_panel = that.get_action_panel();
var ul = $('ul', action_panel);
var buttons = $('<li/>', {
'class': 'details-buttons'
}).prependTo(ul);
var buttons = $('.action-controls',action_panel);
$('<input/>', {
'type': 'text',

View File

@@ -1,6 +1,7 @@
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Endi S. Dewata <edewata@redhat.com>
* Adam Young <ayoung@redhat.com>
*
* Copyright (C) 2010 Red Hat
* see file 'COPYING' for use and warranty information
@@ -340,8 +341,6 @@ function ipa_entity_setup(container) {
facet.refresh();
}
function ipa_facet_create_action_panel(container) {
var that = this;
@@ -349,7 +348,9 @@ function ipa_facet_create_action_panel(container) {
var action_panel = $('<div/>', {
"class": "action-panel",
html: $('<h3>Actions</h3>')
html: $('<h3>',{
text: IPA.metadata[entity_name].label
})
}).appendTo(container);
function build_link(other_facet,label,other_entity){
@@ -387,9 +388,21 @@ function ipa_facet_create_action_panel(container) {
var entity = IPA.get_entity(entity_name);
var facet_name = ipa_current_facet(entity);
for (var i=0; i<entity.facets.length; i++) {
var other_facet = entity.facets[i];
var other_facet_name = other_facet.name;
var other_facet = entity.facets[0];
var other_facet_name = other_facet.name;
var main_facet = build_link(other_facet,other_facet.label)
/*assumeing for now that entities with only a single facet
do not have search*/
if (entity.facets.length > 0 ){
main_facet.text( 'List ' + IPA.metadata[entity_name].label);
}
main_facet.appendTo(ul);
ul.append($('<li><span class="action-controls"/></li>'));
for (var i=1; i<entity.facets.length; i++) {
other_facet = entity.facets[i];
other_facet_name = other_facet.name;
if (other_facet.label) {
ul.append(build_link(other_facet,other_facet.label));

View File

@@ -98,10 +98,13 @@ function ipa_hbacsvc_search_facet(spec) {
var ul = $('ul', action_panel);
/*Note that we add the rules at the top of the action panel
so that the HBAC entities always show in the same order.*/
$('<li/>', {
title: 'hbac',
text: 'HBAC Rules'
}).appendTo(ul);
}).prependTo(ul);
$('<li/>', {
title: 'hbacsvcgroup',

View File

@@ -109,15 +109,18 @@ function ipa_hbacsvcgroup_search_facet(spec) {
var ul = $('ul', action_panel);
$('<li/>', {
title: 'hbac',
text: 'HBAC Rules'
}).appendTo(ul);
/*Note that we add these at the top of the action panel
so that the HBAC entities always show in the same order.*/
$('<li/>', {
title: 'hbacsvc',
text: 'HBAC Services'
}).appendTo(ul);
}).prependTo(ul);
$('<li/>', {
title: 'hbac',
text: 'HBAC Rules'
}).prependTo(ul);
that.search_facet_create(container);

View File

@@ -322,17 +322,24 @@ span.main-separator{
float: left;
margin-top: 5em;
margin-left: 2.5em;
padding-left: 0.5em;
padding-bottom: 1em;
width: 17.5em;
}
.action-panel ul {
list-style-type:none;
padding: 0;
}
.action-panel h3{
margin: 0;
background: #e8e8e8;
}
.action-panel li {
height: 2em;
height: auto;
padding: 0.2em;
}
@@ -346,6 +353,7 @@ span.main-separator{
color: black;
text-decoration: underline;
cursor: pointer;
margin-left:2em;
}
.action-panel li.entity-facet-disabled {

View File

@@ -54,8 +54,7 @@ function ipa_search_widget(spec) {
var action_panel = that.facet.get_action_panel();
var ul = $('ul', action_panel);
var li = $('<li/>').prependTo(ul);
var li = $('.action-controls',action_panel);
var search_buttons = $('<span/>', {
'class': 'search-buttons'

View File

@@ -101,7 +101,7 @@ function ipa_sudocmd_search_facet(spec) {
$('<li/>', {
title: 'sudorule',
text: 'SUDO Rules'
}).appendTo(ul);
}).prependTo(ul);
$('<li/>', {
title: 'sudocmdgroup',

View File

@@ -109,15 +109,18 @@ function ipa_sudocmdgroup_search_facet(spec) {
var ul = $('ul', action_panel);
$('<li/>', {
title: 'sudorule',
text: 'SUDO Rules'
}).appendTo(ul);
/*Make sure that these go at the top of the action panel
and in the same order as on the other SUDO entity pages */
$('<li/>', {
title: 'sudocmd',
text: 'SUDO Command'
}).appendTo(ul);
}).prependTo(ul);
$('<li/>', {
title: 'sudorule',
text: 'SUDO Rules'
}).prependTo(ul);
that.search_facet_create(container);