Can you please email it to me as an attachment? Thanks.
On Mar 24, 11:16 pm, "mr.freeze" <nfre...@gmail.com> wrote:
> This just adds a convenience link to view the page when editing a
> view. It avoids some mousing around and clicking:
>
> Index: applications/admin/controllers/default.py
> ===================================================================
> --- applications/admin/controllers/default.py (revision 797)
> +++ applications/admin/controllers/default.py (working copy)
> @@ -506,12 +506,14 @@
> response.flash = T('failed to reload module')
>
> edit_controller = None
> -
> + view_link = None
> if filetype == 'html' and request.args >= 3:
> cfilename = os.path.join(request.args[0], 'controllers',
> request.args[2] + '.py')
> if os.path.exists(apath(cfilename)):
> edit_controller = URL(r=request, f='edit', args=
> [cfilename])
> + view = request.args[3].replace('.html','')
> + view_link = A('view',_href=URL(request.args
> [0],request.args[2],view))
>
> if len(request.args) > 2 and request.args[1] == 'controllers':
> controller = (request.args[2])[:-3]
> @@ -540,6 +542,7 @@
> saved_on=saved_on,
> controller=controller,
> functions=functions,
> + view_link=view_link,
> editarea_preferences=editarea_preferences)
>
> def resolve():
> Index: applications/admin/views/default/edit.html
> ===================================================================
> --- applications/admin/views/default/edit.html (revision 797)
> +++ applications/admin/views/default/edit.html (working copy)
> @@ -19,6 +19,9 @@
> {{if functions:}}
> exposes {{=XML(', '.join([A(f,_href=URL(a=app,c=controller,f=f)).xml
> () for f in functions]))}}
> {{pass}}
> +{{if view_link:}}
> +{{=view_link}}
> +{{pass}}
> </div>
>
> {{if edit_controller:}}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---