Massimo,
from my point of view - a simple user - the web2py core must remain tied to 
its conventions and use standard protocols.
As you say, "bootstrap twitter" is one of the possible choices and then we 
will do? we will have so many switches as are the web frameworks?
For my little experience in web framework - above all those having 
javascript plugin - the html layout and css style are indispensable to each 
other.
We are discussing about the menu, but there are also the grids, forms and 
so on:should, therefore, change the code for sqlform.grid, 
sqlform.smartgrid, sqlform, or also apply a javascript function to fit this 
elements to the conventions of the preferred framework?
For me, the best choice is to have a "welcome app" as a basis for 
introducing own web2py features with its own css and layout 
and, if deemed appropriate, make an entry in the welcome app menu that link 
to different layouts inspired from several web framework (bootstrap, 
skeleton and so on) wich the user can choose to apply and adapt for his/her 
application.


Il giorno sabato 26 maggio 2012 16:37:05 UTC+2, Massimo Di Pierro ha 
scritto:
>
> For now this is in trunk. Your implementation looks good.
>
> For me the problem whether we want to do this or not. Most of the 
> conventions implemented in web2py core are web2py own conventions or 
> standard protocol.  Bootstrap is a css library. very popular today but will 
> disappear tomorrow as a better one comes out. Now everybody will use it. Is 
> it a good idea to include code which is designed exclusively for bootstap 
> conventions and specifically refers to bootstrap css classes? Or is it 
> better to handle it from the layout only using js?
>
> So we need to think about this some more. I cannot promise this will stay 
> in web2py 2.0 in this form.
>
> Massimo
>
>
>
> On Saturday, 26 May 2012 08:53:53 UTC-5, Paolo Caruccio wrote:
>>
>> Here attached the html.py with modified class MENU.
>> This is only a draft not deeply tested. 
>>
>> Il giorno sabato 26 maggio 2012 03:40:26 UTC+2, Massimo Di Pierro ha 
>> scritto:
>>>
>>> We can include this in MENU and eliminate the JS. What do you think?
>>>
>>> On Friday, 25 May 2012 15:52:50 UTC-5, Niphlod wrote:
>>>>
>>>> I may be a little late....I implemented it for my app but never used 
>>>> because my menu has only 4 items :-P
>>>> include bootstrap.css and add to css this (took from 
>>>> https://github.com/twitter/bootstrap/issues/424)
>>>>
>>>> .nav li.dropdown ul.dropdown-menu li:HOVER ul {
>>>>         display:block;
>>>>         position:absolute;
>>>>         left:100%;
>>>>         -webkit-border-radius: 3px;
>>>>         -moz-border-radius: 3px;
>>>>         border-radius: 3px;
>>>>     }
>>>>     .nav li.dropdown ul.dropdown-menu ul {
>>>>         display: none;
>>>>         float:right;
>>>>         position: relative;
>>>>         top: auto;
>>>>         margin-top: -30px;
>>>>     }
>>>>
>>>>     .nav li.dropdown ul.dropdown-menu .dropdown-menu::before {
>>>>         content: '';
>>>>         display: inline-block;
>>>>         border-top: 7px solid transparent;
>>>>         border-bottom: 7px solid transparent;
>>>>         border-right:7px solid #CCC;
>>>>         border-right-color: rgba(0, 0, 0, 0.2);
>>>>         position: absolute;
>>>>         top: 9px;
>>>>         left: -14px;
>>>>     }
>>>>
>>>>     .nav li.dropdown ul.dropdown-menu .dropdown-menu::after {
>>>>         content: '';
>>>>         display: inline-block;
>>>>         border-top: 6px solid transparent;
>>>>         border-bottom: 6px solid transparent;
>>>>         border-right:6px solid white;
>>>>         position: absolute;
>>>>         top: 10px;
>>>>         left: -12px;
>>>>     }
>>>>
>>>>
>>>> def twitter_menu(menu, level=0):
>>>>     """
>>>>     Generates twitter bootstrap's compliant menu
>>>>     """
>>>>     lis = []
>>>>     for li in menu:
>>>>         (text, active, href) = li[:3]
>>>>         sub =  len(li) > 3 and li[3] or []
>>>>         if len(sub) == 0:
>>>>             li_class = None
>>>>             el = LI(A(text, _href=href), _class=li_class)
>>>>         else:
>>>>             li_class = 'dropdown'
>>>>             caret = level == 0 and B(_class='caret') or 
>>>> I(_class='icon-chevron-right')
>>>>             sub_ul = twitter_menu(sub, level=level+1)
>>>>             el = LI(A(text, caret, _href=href, 
>>>> _class="dropdown-toggle", **{'_data-toggle' : 'dropdown'}), sub_ul, 
>>>> _class=li_class)
>>>>         lis.append(el)
>>>>
>>>>     if level == 0:
>>>>         return UL(*lis, _class='nav')
>>>>     else:
>>>>         return UL(*lis, _class="dropdown-menu")
>>>>
>>>>

Reply via email to