Skip to content

Commit

Permalink
mobile admin, thanks Angelo
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed Dec 10, 2011
1 parent ac82f1e commit f0f8c8c
Show file tree
Hide file tree
Showing 21 changed files with 313 additions and 319 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version 1.99.3 (2011-12-09 20:46:02) stable
Version 1.99.3 (2011-12-09 20:55:52) stable
4 changes: 2 additions & 2 deletions applications/admin/controllers/default.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# coding: utf8

EXPERIMENTAL_STUFF = False
EXPERIMENTAL_STUFF = True

if EXPERIMENTAL_STUFF:
is_mobile=request.user_agent().is_mobile
is_mobile = True #request.user_agent().is_mobile
if is_mobile:
response.view = response.view.replace(
'default/','default.mobile/')
Expand Down
17 changes: 15 additions & 2 deletions applications/admin/models/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@

import os

def A_button(*a,**b):
b['_data-role'] = 'button'
b['_data-inline'] = 'true'
return A(*a,**b)

def button(href, label):
return A(SPAN(label),_class='button',_href=href)
if request.user_agent().is_mobile:
ret = A_button(SPAN(label), _href=href)
else:
ret = A(SPAN(label),_class='button',_href=href)
return ret

def button_enable(href, app):
if os.path.exists(os.path.join(apath(app,r=request),'DISABLED')):
Expand All @@ -14,7 +23,11 @@ def button_enable(href, app):
return A(label,_class='button',_id=id,callback=href,target=id)

def sp_button(href, label):
return A(SPAN(label),_class='button special',_href=href)
if request.user_agent().is_mobile:
ret = A_button(SPAN(label), _href=href)
else:
ret = A(SPAN(label),_class='button special',_href=href)
return ret

def helpicon():
return IMG(_src=URL('static', 'images/help.png'), _alt='help')
Expand Down
8 changes: 4 additions & 4 deletions applications/admin/views/default.mobile/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

<h2>{{=T("About application")}} "{{=app}}"</h2>
<h3>{{=T("About")}} {{=app}}</h3>
<p class="controls">{{=button(URL('edit/%s/ABOUT' % (app)), T('Edit'))}}</p>
<div class="about_text legalese">{{=about}}</div>
<p>{{=button(URL('edit/%s/ABOUT' % (app)), T('Edit'))}}</p>
<div>{{=about}}</div>
<h3>{{=T('License for')}} {{=app}}</h3>
<p class="controls">{{=button(URL('edit/%s/LICENSE' % (app)), T('Edit'))}}</p>
<div class="license_text legalese">{{=license}}</div>
<p>{{=button(URL('edit/%s/LICENSE' % (app)), T('Edit'))}}</p>
<div>{{=license}}</div>
</ul>

4 changes: 2 additions & 2 deletions applications/admin/views/default.mobile/change_password.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{extend 'layout.html'}}
{{extend 'default.mobile/layout.html'}}

{{block sectionclass}}change_password{{end}}

<h2>Change Admin Password</h2>

<div class="pwform">
<div>
{{=form}}
</div>

4 changes: 2 additions & 2 deletions applications/admin/views/default.mobile/delete.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{extend 'layout.html'}}
{{extend 'default.mobile/layout.html'}}

{{block sectionclass}}delete{{end}}

<div class="center">
<div>
<h2>{{=T('Are you sure you want to delete file "%s"?', filename)}}</h2>
<p>{{=FORM(INPUT(_type='submit',_name='nodelete',_value=T('Abort')),INPUT(_type='hidden',_name='sender',_value=sender), _class="inline")}}{{=FORM(INPUT(_type='submit',_name='delete',_value=T('Delete')),INPUT(_type='hidden',_name='sender',_value=sender), _class="inline")}}</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions applications/admin/views/default.mobile/delete_plugin.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{extend 'layout.html'}}
{{extend 'default.mobile/layout.html'}}

{{block sectionclass}}delete_plugin{{end}}

<div class="center">
<div>
<h2>{{=T('Are you sure you want to delete plugin "%s"?', plugin)}}</h2>
<p>{{=FORM(INPUT(_type='submit',_name='nodelete',_value=T('NO')))}}</p>
<p>{{=FORM(INPUT(_type='submit',_name='delete',_value=T('YES')))}}</p>
Expand Down
Loading

0 comments on commit f0f8c8c

Please sign in to comment.