Small patch - not deeply tested - to make the menu working when javascript 
is disabled.

Il giorno venerdì 25 maggio 2012 22:06:38 UTC+2, Massimo Di Pierro ha 
scritto:
>
> I managed to fix it. Now the carets and class are added automatically via 
> JS and there is no need to tweak menus.
>
> Cons: nested menus break if JS disabled.
>
> Anyway, I feel this is a big step closer to web2py 2.0.
>
> massimo
>
> On Friday, 25 May 2012 14:53:24 UTC-5, Massimo Di Pierro wrote:
>>
>> I added this trunk but with one change. Instead of the attached menu.py 
>> (which is not backward compatible), I added some jQuery code layout.html 
>> that attempts to reproduce the same effect. It works something is wrong 
>> with alignment and I cannot figure out what. Can you take a look?
>>
>> Massimo
>>
>> On Thursday, 24 May 2012 18:16:37 UTC-5, Paolo Caruccio wrote:
>>>
>>> Andrew, I played a bit on this subject. Please replace the below files 
>>> (before backup them) with attached ones:
>>>
>>> 1. welcome > models > menu.py (check the changes in response.menu)
>>> 2. welcome > views > layout.html (heavily changed)
>>> 3. welcome > static > css > web2py.css (find the comment "bootswatch" to 
>>> see the changes)
>>>
>>> Now, if you download a css from bootswatch.com or built it from  
>>> http://stylebootstrap.info, replacing default one you shouldn't have 
>>> problems. For the menu I used one of solutions that Anthony proposed.
>>>
>>> In attachement also some images to show how several themes are rendered 
>>> in several modern browsers.
>>>
>>> Last notes:
>>> a) this is an experiment. You have to obtain official changes from 
>>> web2py developers
>>> b) my enviroment: windows 7, python 2.7.2, web2py version 2.0.00 
>>> (2012-05-23 09:27:57) dev
>>>
>>>
>>> Il giorno lunedì 21 maggio 2012 20:42:38 UTC+2, Andrew ha scritto:
>>>>
>>>> Hello,
>>>> I'm trying a few bootswatch themes over a new "welcome" app.    see 
>>>> http://bootswatch.com/
>>>> The first thing I noticed is that the menus don't display correctly.  
>>>>
>>>> Is anyone playing with this ?  Seeing that web2py uses bootstrap, it 
>>>> would be great to drop in a bootswatch theme.
>>>>
>>>>
Title: {{=response.title or request.application}}
{{=response.flash or ''}}
{{if left_sidebar_enabled:}} {{pass}}
{{block center}} {{include}} {{end}}
{{if right_sidebar_enabled:}}
{{block right_sidebar}}

Right Sidebar

{{end}}
{{pass}}
{{block footer}} {{end}}
{{if response.google_analytics_id:}} {{pass}}
.nav > li.dropdown > a:after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #000000;
    content: "";
    display: inline-block;
    height: 0;
    opacity: 0.7;
    vertical-align: top;
    width: 0;

    margin-left: 2px;
    margin-top: 8px;

    border-bottom-color: #FFFFFF;
    border-top-color: #FFFFFF;
}


ul.dropdown-menu li.dropdown > a:after {
    border-left: 4px solid #000;
    border-right: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-top: 4px solid transparent;
    content: "";
    display: inline-block;
    height: 0;
    opacity: 0.7;
    vertical-align: top;
    width: 0;

    margin-left: 8px;
    margin-top: 6px;
}

ul.nav li.dropdown:hover ul.dropdown-menu {
   display: block;    
}

Reply via email to