[Freeipa-devel] [PATCH] admiyo-0226-Added-a-container-for-the-facet

Adam Young ayoung at redhat.com
Thu Apr 28 01:47:21 UTC 2011


On 04/27/2011 09:09 PM, Adam Young wrote:
> On 04/27/2011 04:39 PM, Endi Sukma Dewata wrote:
>> On 4/27/2011 12:56 PM, Adam Young wrote:
>>>
>>
>> Currently we have this DOM structure:
>>
>> <div id='user' class='entity-container'>
>> <div class='entity-header'>
>> <div class='entity-title'/>
>> <span class='action-controls'/>
>> <div class='entity-title'/>
>> <input id='pkey' type='hidden'/>
>> <span class='entity-search'/>
>> <div class='entity-container-user' class='entity-container'>
>> <div class='entity-tabs'/>
>> <div class='content'>
>> <div id='search_container' class='facet_container'>
>> </div>
>> </div>
>> </div>
>> </div>
>>
>> 1. The nested entity-container is confusing and probably will make 
>> CSS adjustment harder. The entity content should be in the same level 
>> as entity header.
>>
>> 2. The _container suffix for the facet container name is unnecessary 
>> because it already has a facet_container class.
>>
>> 3. The use of id attribute could lead to conflicts. It's better to 
>> use a name attribute and a class. Querying the element can be done 
>> with this selector:
>>
>>    $('.facet[name=search]', ...)
>>
>> 4. Rename action-controls to entity-controls for consistency.
>>
>> 5. Rename facet_container to facet-container for consistency.
>>
>> 6. The hidden pkey can be stored in the entity object instead of DOM.
>>
>> The DOM structure will look like this:
>>
>> <div name='user' class='entity'>
>> <div class='entity-header'>
>> <div class='entity-title'/>
>> <div class='entity-controls'/>
>> <div class='entity-search'/>
>> <div class='entity-tabs'/>
>> </div>
>> <div class='entity-content'>
>> <div name='search' class='facet'>
>> <div class='facet-header'/>
>> <div class='facet-content'/>
>> </div>
>> <div name='details' class='facet'/>
>> </div>
>> </div>
>>
>> What do you think? We can do this in a separate patch if it's too 
>> complicated.
>>
>
>
> Very clean:  I like it a lot.  I'd like to do it as a separate patch, 
> just to keep clear what we are doing.

The more I think about it, the more I think that this structure can be 
created by the navigation code, and then passed to the entity to 
populate. The entity-header function moves to navigation.js, but does 
not have a reference to the entity yet.  When an entity tab gets 
activated, we then populate this structure.  everything can get created 
on demand.

I'm assuming that entity-search is for the search bar, and not the 
search facet:  search facet still goes inside the entity-content, right?

>
>
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel




More information about the Freeipa-devel mailing list