[web2py] Re: How to get dropdown options working on nav-bar

2016-09-14 Thread Dave S
On Wednesday, September 14, 2016 at 1:00:45 PM UTC-7, Peter wrote:
>
>
> That may be from the Bootstrap2 days.
>>
>
> I put some time in last night trying to understand the how/why and think I 
> have a handle on it, thanks again for the pointers Dave.
>

I'm always happy to help, and sometimes my help works out.  Glad you're in 
good shape now.

/dps


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to get dropdown options working on nav-bar

2016-09-14 Thread Peter


> That may be from the Bootstrap2 days.
>

I put some time in last night trying to understand the how/why and think I 
have a handle on it, thanks again for the pointers Dave.

It may be useful to other noobs so my lessons learned...

I started to develop using an existing Free CSS Template (that is 
apparently from years back).
It was of huge benefit to me in getting started quickly because I could 
largely see much of how it worked and was able to copy the approach for new 
models views and controllers keeping the look and feel consistent.

Then this issue regarding menu dropdowns came up... and sure enough the 
Free CSS Template has its own Oxidation/*.css files 

My 'old' Free css Template is has/uses...

   

   - base.css
   - calendar.css
   - demo_table.css
   - fullcalendar.css
   - jqModal.css
   - Oxidation/base.css
   - Oxidation/calendar.css
   - Oxidation/demo_table.css
   - Oxidation/fullcalendar.css
   - Oxidation/jqModal.css

whereas the latest version of web2py by default has/uses 
   
   - bootstrap.min.css
   - calendar.css
   - web2py-bootstrap3.css
   - web2py.css 

I went a step further and migrated some of my existing MVC code to a new 
clean default web2py app and the menu code worked without change i.e. the 
dropdowns appeared as originally intended/expected.  (lots of other things 
broke though).

For now I will work with what I have but v2 if I ever get there will be a 
migration to a build using the latest defaults in web2py and maybe even 
stupid.css!

Thanks again Dave!








 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to get dropdown options working on nav-bar

2016-09-13 Thread Dave S


On Tuesday, September 13, 2016 at 3:28:24 PM UTC-7, Peter wrote:
>
>
> Thanks Dave,
> stupid.css doesn't look so stupid! but there will be a learning curve for 
> me to understand it and the more I look at the more I need to understand 
> css better.
>
>
Start with 
> 
instead of the random page.

I learned HTML4 and CSS in a course using a text by Patrick Carey, but had 
cut my teeth with basic HTML via online examples and reading the W3 docs 
(there is explanations in some of them, so they aren't as dry as most 
specs).  I'm getting my HTML5 from htmlgoodies.com, which has a few CSS 
examples.


> The change to Bootstrap3 limited the nesting levels of submenus ... only 1 
>> sub-level now, I believe.  This was a reflection of the popularity of 
>> portable devices, where a tree of menus runs out of screen space.
>>
>
> If I understand the terminology correctly I am only looking for 1 sub 
> level.
>
> Something like
>
> MenuItem1  MenuItem2MenuItem3MenuItem4
>   SubItem3.1
>   SubItem3.2
>   SubItem3.3
>
> and I may be wrong but the bootstrap section in gluon/tools.py seems to 
> support it 
>
> else:
> self.bar = LI(Anr(T('Log In'),
>   _href='#', _class="dropdown-toggle",
>   data={'toggle': 'dropdown'}), self.bar,
>   _class='dropdown')
>
>
>
That may be from the Bootstrap2 days.  You can try grabbing BS2 from some 
archive, and allegedly not have problems except where W2P has had to make 
changes for classes that were obsoleted.  I haven't used BS2 since the 
change to BS3, though.

 

> Any other clues on how to invoke this? 
> i.e. get the sub items to appear (vertically under MenuItem3) on mouse 
> over or click to toggle on MenuItem3 ?
>
> P
>
>
 /dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to get dropdown options working on nav-bar

2016-09-13 Thread Peter

Thanks Dave,
stupid.css doesn't look so stupid! but there will be a learning curve for 
me to understand it and the more I look at the more I need to understand 
css better.


The change to Bootstrap3 limited the nesting levels of submenus ... only 1 
> sub-level now, I believe.  This was a reflection of the popularity of 
> portable devices, where a tree of menus runs out of screen space.
>

If I understand the terminology correctly I am only looking for 1 sub level.

Something like

MenuItem1  MenuItem2MenuItem3MenuItem4
  SubItem3.1
  SubItem3.2
  SubItem3.3

and I may be wrong but the bootstrap section in gluon/tools.py seems to 
support it 

else:
self.bar = LI(Anr(T('Log In'),
  _href='#', _class="dropdown-toggle",
  data={'toggle': 'dropdown'}), self.bar,
  _class='dropdown')


Any other clues on how to invoke this? 
i.e. get the sub items to appear (vertically under MenuItem3) on mouse over 
or click to toggle on MenuItem3 ?

P

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to get dropdown options working on nav-bar

2016-09-13 Thread Dave S


On Tuesday, September 13, 2016 at 1:02:54 PM UTC-7, Peter wrote:
>
> I am trying to get a menu item to display additional selectable drop down 
> options...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *default.pyif auth.user:response.menu=[   ( 'Home' 
>   , False , url( 'index'  ) , []),   ( 'Companies' 
>  , False , url( 'list_companies' ) , []),   ( 'Contacts'   
> , False , url( 'list_persons'   ) , []),   ( 'Activities' , 
> False , url( 'list_tasks' ) , []),   ( 'Invoices'   , 
> False , url( 'list_invoices'  ) , []),   ( 'Payments'   , 
> False , url( 'list_payments' ) , [ ( 'Activity' 
>   , False , url( 'list_unpaid_activities' ) , []),  
>( 'Invoice', False , url( 'list_unpaid_invoices' ) , []),
>   ]),  
>  ( 'Reports', False , url( 'list_reports' ) , [])  
> ]layout.html*
>   
>{{=MENU(response.menu)}}
>   
>
>
> The result from above code produces the submenu options permanently below 
> the parent option and horizontally aligned (see attached).
>
>
> I have read through the online doc but the references are not helping me, 
> I can see gluon.tools auth has navbar with methods ''menu'', ''bootstrap3'' 
> and ''bare'' but I have no idea how to assign response.menu (or invoke the 
> MENU wrapper) correctly?
>
> Does the menu need to be custom coded (as per the comments section under 
> the 'bare' function in navbar) or is there something I am doing wrong in 
> the code above?   
>
> any help would be appreciated! Thanks.
>
>

The change to Bootstrap3 limited the nesting levels of submenus ... only 1 
sub-level now, I believe.  This was a reflection of the popularity of 
portable devices, where a tree of menus runs out of screen space.

I think that the Stupid.css layout allows you to have multiple nesting 
levels, and you can look at the new version of the "examples" app for 
ideas.  (There's also a demo site where Massimo did a little showing-off 
with stupid.css:

for some random ideas)

Of course, if you have an existing app, converting to stupid.css may be 
messy, but the other choice seems to be to do some custom scripting.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.