{{extend 'default.mobile/layout.html'}} {{ def A_info(*a,**b): b['_data-role'] = 'button' b['_data-icon'] = 'info' b['_data-theme'] = 'b' return A(*a,**b) def A_gear(*a,**b): b['_data-role'] = 'button' b['_data-icon'] = 'gear' return A(*a,**b) def A_delete(*a,**b): b['_data-role'] = 'button' b['_data-icon'] = 'delete' return A(*a,**b) def A_check(*a,**b): b['_data-role'] = 'button' b['_data-icon'] = 'check' return A(*a,**b) def all(items): return reduce(lambda a,b:a and b,items,True) def peekfile(path,file): return A_info(file.replace('\\\\','/'),_href=URL('peek', args=(app, path, file))) def editfile(path,file): return A_gear(SPAN(T('Edit')),_href=URL('edit', args=(app, path, file))) def testfile(path,file): return A_check(SPAN(T('Run tests')), _href=URL('test', args=(app, file))) def editlanguagefile(path,file): return A_gear(SPAN(T('Edit')),_href=URL('edit_language', args=(app, path, file))) def file_upload_form(location): form=FORM(T("upload file:")," ", INPUT(_type="file",_name="file")," ",T("and rename it:")," ", INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()), INPUT(_type="hidden",_name="location",_value=location), INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)), INPUT(_type="submit",_value=T("upload")),_action=URL('upload_file')) return form def file_create_form(location): form=FORM(T("create file with filename:")," ", INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()), INPUT(_type="hidden",_name="location",_value=location), INPUT(_type="hidden",_name="sender",_value=URL('design',args=app))) return form def upload_plugin_form(app): form=FORM(T("upload plugin file:")," ", INPUT(_type="file",_name="pluginfile"), INPUT(_type="submit",_value=T("upload"))) return form def deletefile(arglist): return A_delete(SPAN(T('Delete')), _href=URL('delete',args=arglist,vars=dict(sender=request.function+'/'+app))) }} {{block sectionclass}}design {{=app}}{{end}}

{{=T("Models")}}

{{if not models:}}

{{=T("There are no models")}}

{{else:}}
{{=button(URL(a=app,c='appadmin',f='index'), T('database administration'))}} {{if os.access(os.path.join(request.folder,'..',app,'databases','sql.log'),os.R_OK):}} {{=button(URL('peek/%s/databases/sql.log'%app), 'sql.log')}} {{pass}}
{{pass}} {{for m in models:}} {{=peekfile('models',m)}} {{=editfile('models',m)}} {{=deletefile([app, 'models', m])}}
{{pass}}
{{=file_create_form('%s/models/' % app)}}
{{ controller_functions=[] for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functions[c]] }}

{{=T("Controllers")}}

{{if not controllers:}}

{{=T("There are no controllers")}}

{{else:}}
{{=button(URL('test',args=app), T("test"))}} {{=button(URL('edit',args=[app,'cron','crontab']), T("crontab"))}}
{{pass}} {{for c in controllers:}} {{=peekfile('controllers',c)}} {{=editfile('controllers',c)}} {{=deletefile([app, 'controllers', c])}} {{=testfile('controllers',c)}}
{{pass}}
{{=file_create_form('%s/controllers/' % app)}}

{{=T("Views")}}

{{=button(LAYOUTS_APP, T("download layouts"))}}
{{if not views:}}

{{=T("There are no views")}}

{{pass}} {{for c in views:}} {{=peekfile('views',c)}} {{=editfile('views',c)}} {{=deletefile([app, 'views', c])}}
{{pass}}
{{=file_create_form('%s/views/' % app)}}

{{=T("Languages")}}

{{=button(URL('update_languages/'+app), T('update all languages'))}}
{{if not languages:}}

{{=T("There are no translators")}}

{{pass}} {{for file in languages:}} {{=peekfile('languages',file)}} {{=editlanguagefile('languages',file)}} {{=deletefile([app, 'languages', file])}}
{{pass}}
{{=file_create_form('%s/languages/' % app)}}

{{=T("Static files")}}

{{if not statics:}}

{{=T("There are no static files")}}

{{pass}}
    {{ tree={} for file in statics+['']: items=file.partition('/') if not items[0] in tree: tree[items[0]] = [] pass tree[items[0]].append(items[2]) pass }} {{for k, v in sorted(tree.items()):}} {{if k:}}
  • {{=k}}

      {{if len(v) == 1 and v[0] =='':}} {{=peekfile('static', k)}} {{=editfile('static', k)}} {{=deletefile([app, 'static', k])}}
    {{continue}} {{for f in v:}} {{=peekfile('static/'+k, f)}} {{=editfile('static/'+k, f)}} {{=deletefile([app, 'static/'+k, f])}}
    {{pass}}
{{pass}} {{pass}}
{{=file_create_form('%s/static/' % app)}} {{#=file_upload_form('%s/static/' % app)}}

{{=T("Modules")}}

{{if not modules:}}

{{=T("There are no modules")}}

{{pass}} {{for m in modules:}} {{=peekfile('modules',m)}} {{=editfile('modules',m)}} {{if m!='__init__.py':}}{{=deletefile([app, 'modules', m])}}{{pass}} {{pass}}
{{=file_create_form('%s/modules/' % app)}} {{#=file_upload_form('%s/modules/' % app)}}

{{=T("Plugins")}}

{{=button(PLUGINS_APP, T('download plugins'))}}
{{if plugins:}}
{{for plugin in plugins:}} {{=button(URL('plugin', args=[app, plugin]), 'plugin_%s' % plugin)}} {{pass}}
{{else:}}

{{=T('There are no plugins')}}

{{pass}}
{{=upload_plugin_form(app)}}