[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Freeipa-devel] [PATCH] admiyo-0131-facet-nesting




From c3deab7a6b52d01b559ee657b2c2e09a1c04d9f5 Mon Sep 17 00:00:00 2001
From: Adam Young <ayoung redhat com>
Date: Thu, 6 Jan 2011 17:14:13 -0500
Subject: [PATCH] facet nesting

correctly nest the facet groups
change 'parent' to 'member of' for facet group
---
 install/static/entity.js   |   23 ++++++++++++++++++-----
 install/static/ipa.css     |   17 ++++++++++++++++-
 ipalib/plugins/baseldap.py |    2 +-
 ipalib/plugins/host.py     |    2 +-
 ipalib/plugins/netgroup.py |    2 +-
 5 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/install/static/entity.js b/install/static/entity.js
index a6f31e84b238276f1343bf3b1d909d7a97403749..7f8d1ec87e59c3ea4eeca5b75fd0f66f478d7901 100644
--- a/install/static/entity.js
+++ b/install/static/entity.js
@@ -520,22 +520,35 @@ function ipa_facet_create_action_panel(container) {
                     }
                     var li = facet_groups[facet_group];
                     var link =  build_link(other_facet, other_facet.label)
+                    link.addClass('facet-group-member');
                     li.after(link );
+                    /*
+                      If we are on the current facet, we make the text black, non-clickable,
+                      add an icon and make suer the action controls are positioned underneath it.
+                     */
                     if ( other_facet.name === ipa_current_facet( entity)){
                         var text = link.text();
                         link.text('');
                         link.append($('<ul>').
-                                    append('<li>'+ text+'</li>').
+                                    append($('<li />',{
+                                        'class': 'entity-facet-selected',
+                                        html:  $('<span />',{
+                                            'class':'input_link',
+                                            html:'<span class="ui-icon ui-icon-triangle-1-e" />'+ text
+                                        })})).
                                     append($('<li/>',{
                                         html:$('<span />',{
-                                            class:"action-controls"})})));
+                                            class:"action-controls"
+                                        })
+                                    }))
+                                   );
                     }
                     facet_groups[facet_group] = li.next();
-
                 } else {
-                    ul.append(build_link(other_facet, other_facet.label));
+                    var innerlist = $('<ul/>').appendTo(ul);
+                    innerlist.append(build_link(other_facet, other_facet.label));
                     if ( other_facet.name === ipa_current_facet( entity)){
-                        ul.append($('<li><span class="action-controls"/></li>'));
+                        innerlist.append($('<li class="entity-facet"><span class="action-controls"  /></li>'));
                     }
                 }
             }
diff --git a/install/static/ipa.css b/install/static/ipa.css
index 85ec91f39e1780e048206f3ebeef496bae2d259b..455781b1c0f6021411c1e420208907ec22f5702e 100644
--- a/install/static/ipa.css
+++ b/install/static/ipa.css
@@ -465,12 +465,20 @@ span.main-separator{
     text-transform: none;
 }
 
+.action-panel li.entity-facet-selected {
+    font-family: "FreeWayBold", "Liberation Sans", Arial, Sans;
+    color: black;
+    text-transform: uppercase;
+    cursor: pointer;
+}
+
 .action-panel li.entity-facet-disabled {
     font-family: "Liberation Sans",Arial,sans-serif;
     color: gray;
     cursor: default;
     text-decoration: none;
     text-transform: none;
+
 }
 
 .action-panel li.entity-facet-relation-label {
@@ -479,8 +487,14 @@ span.main-separator{
     cursor: default;
     text-transform: uppercase;
     font-size: 1.2em;
+    margin-left:1.8em;
 }
 
+.action-panel li.facet-group-member {
+    margin-left:3.6em;
+}
+
+
 .action-button {
     background: none;
     background-image:none;
@@ -489,7 +503,8 @@ span.main-separator{
 }
 
 .action-controls {
-    padding-left: 2em;
+    position: relative;
+    display:inline;
 }
 
 .client {
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 688f35badf6dc1ae614cb4fc26865aeabe9caba1..ecc3fd0b94ee329ee608f02a187309afaf29d938 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -250,7 +250,7 @@ class LDAPObject(Object):
     relationships = {
         # attribute: (label, inclusive param prefix, exclusive param prefix)
         'member': ('Member', '', 'no_'),
-        'memberof': ('Parent', 'in_', 'not_in_'),
+        'memberof': ('Member Of', 'in_', 'not_in_'),
         'memberindirect': (
             'Indirect Member', None, 'no_indirect_'
         ),
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 3b0b8eef453e6e08f40bd4f2d15fa7ab0c5cf404..9cc9978637a79a0356082dcb6031427e32d19990 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -171,7 +171,7 @@ class host(LDAPObject):
     }
     bindable = True
     relationships = {
-        'memberof': ('Parent', 'in_', 'not_in_'),
+        'memberof': ('Member Of', 'in_', 'not_in_'),
         'enrolledby': ('Enrolled by', 'enroll_by_', 'not_enroll_by_'),
         'managedby': ('Managed by', 'man_by_', 'not_man_by_'),
     }
diff --git a/ipalib/plugins/netgroup.py b/ipalib/plugins/netgroup.py
index ce9a51b6c8f4704b9bef5c4c8c1b3866aee8b138..e8c59a570b384c2360188f2dc904d452246e6c64 100644
--- a/ipalib/plugins/netgroup.py
+++ b/ipalib/plugins/netgroup.py
@@ -87,7 +87,7 @@ class netgroup(LDAPObject):
     }
     relationships = {
         'member': ('Member', '', 'no_'),
-        'memberof': ('Parent', 'in_', 'not_in_'),
+        'memberof': ('Member Of', 'in_', 'not_in_'),
         'memberindirect': (
             'Indirect Member', None, 'no_indirect_'
         ),
-- 
1.7.3.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]