jbellomy / bots

Automatically exported from code.google.com/p/bots
0 stars 0 forks source link

add: disable default choices in menu #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
added the possibility to disable the default choices in the menu.
this is needed because navigation in touch-screens interfaces does not work
(when you want to open a menu, the default choice is used).
this is possible by adding user group 'touchscreen', and make a user meber of 
this group.

Original issue reported on code.google.com by hjebb...@gmail.com on 14 Apr 2012 at 2:20

GoogleCodeExporter commented 9 years ago
This was not working for me. Two problems.

1. The logic is reversed in menu.html. 
{% if bots_touchscreen %} should be {% if not bots_touchscreen %}

2. The context processor does not work, maybe django version dependent. 
if 'touchscreen' in request.user.groups.all():
changed to
if 'touchscreen' in request.user.groups.values_list('name',flat=True):
got this from 
http://stackoverflow.com/questions/2245895/is-there-a-simple-to-get-group-names-
of-a-user-in-django

Original comment by mjg1964 on 26 Apr 2012 at 2:00

GoogleCodeExporter commented 9 years ago
Can also remove the asterisk indicating default choice, for touchscreen. 

Original comment by mjg1964 on 26 Apr 2012 at 2:15

Attachments:

GoogleCodeExporter commented 9 years ago
2. Gives an error if user not in any groups. change to fix that.

Original comment by mjg1964 on 26 Apr 2012 at 2:55

Attachments:

GoogleCodeExporter commented 9 years ago
Still got an error, this is better (try/except)

Original comment by mjg1964 on 26 Apr 2012 at 4:53

Attachments:

GoogleCodeExporter commented 9 years ago
will check this!
tested this, thought it worked. working with this in development.  maybe I not 
looking right.

kind regards,
Henk-Jan Ebbers

On 04/26/2012 04:00 AM, bots@googlecode.com wrote:

Original comment by hjebb...@gmail.com on 26 Apr 2012 at 4:54

GoogleCodeExporter commented 9 years ago
yes, changed this.
probably I tested this with django 1.1, and did not test enough with 1.3
will test 1.1 later on.

kind regards,
Henk-Jan Ebbers
www.ebbersconsult.com
t: 0031 30 2888358

Bots Open Source EDI Translator: http://bots.sourceforge.net

On 04/26/2012 06:53 AM, bots@googlecode.com wrote:

Original comment by hjebb...@gmail.com on 26 Apr 2012 at 4:54

GoogleCodeExporter commented 9 years ago

Original comment by hjebb...@gmail.com on 10 Sep 2013 at 12:45