1 | {{extend 'default.mobile/layout.html'}} |
---|
2 | {{ |
---|
3 | import os |
---|
4 | def A_info(*a,**b): |
---|
5 | b['_data-role'] = 'button' |
---|
6 | b['_data-icon'] = 'info' |
---|
7 | b['_data-theme'] = 'b' |
---|
8 | return A(*a,**b) |
---|
9 | |
---|
10 | def A_gear(*a,**b): |
---|
11 | b['_data-role'] = 'button' |
---|
12 | b['_data-icon'] = 'gear' |
---|
13 | return A(*a,**b) |
---|
14 | |
---|
15 | def A_delete(*a,**b): |
---|
16 | b['_data-role'] = 'button' |
---|
17 | b['_data-icon'] = 'delete' |
---|
18 | return A(*a,**b) |
---|
19 | |
---|
20 | def A_check(*a,**b): |
---|
21 | b['_data-role'] = 'button' |
---|
22 | b['_data-icon'] = 'check' |
---|
23 | return A(*a,**b) |
---|
24 | |
---|
25 | def all(items): |
---|
26 | return reduce(lambda a,b:a and b,items,True) |
---|
27 | def peekfile(path,file): |
---|
28 | return A_info(file.replace('\\\\','/'),_href=URL('peek', args=(app, path, file))) |
---|
29 | def editfile(path,file): |
---|
30 | return A_gear(SPAN(T('Edit')),_href=URL('edit', args=(app, path, file))) |
---|
31 | def testfile(path,file): |
---|
32 | return A_check(SPAN(T('Run tests')), _href=URL('test', args=(app, file))) |
---|
33 | def editlanguagefile(path,file): |
---|
34 | return A_gear(SPAN(T('Edit')),_href=URL('edit_language', args=(app, path, file))) |
---|
35 | def file_upload_form(location): |
---|
36 | form=FORM(T("upload file:")," ", |
---|
37 | INPUT(_type="file",_name="file")," ",T("and rename it:")," ", |
---|
38 | INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()), |
---|
39 | INPUT(_type="hidden",_name="location",_value=location), |
---|
40 | INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)), |
---|
41 | INPUT(_type="submit",_value=T("Submit")),_action=URL('upload_file')) |
---|
42 | return form |
---|
43 | def file_create_form(location): |
---|
44 | form=FORM(T("create file with filename:")," ", |
---|
45 | INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()), |
---|
46 | INPUT(_type="hidden",_name="location",_value=location), |
---|
47 | INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)), |
---|
48 | INPUT(_type="submit",_value=T("Submit")),_action=URL('create_file')) |
---|
49 | return form |
---|
50 | def upload_plugin_form(app): |
---|
51 | form=FORM(T("upload plugin file:")," ", |
---|
52 | INPUT(_type="file",_name="pluginfile"), |
---|
53 | INPUT(_type="submit",_value=T("Submit"))) |
---|
54 | return form |
---|
55 | def deletefile(arglist): |
---|
56 | return A_delete(SPAN(T('Delete')), _href=URL('delete',args=arglist,vars=dict(sender=request.function+'/'+app))) |
---|
57 | }} |
---|
58 | |
---|
59 | {{block sectionclass}}plugin{{end}} |
---|
60 | |
---|
61 | <h2> |
---|
62 | {{=T('Plugin "%s" in application', request.args(1))}} "{{=app}}" |
---|
63 | </h2> |
---|
64 | <div> |
---|
65 | <div data-role="controlgroup" data-type="horizontal"> |
---|
66 | {{=sp_button(URL('plugin',args=app), T("back"))}} |
---|
67 | {{=sp_button(URL('delete_plugin',args=request.args), T("delete plugin"))}} |
---|
68 | {{=sp_button(URL('pack_plugin',args=request.args), T("pack plugin"))}} |
---|
69 | </div> |
---|
70 | </div> |
---|
71 | |
---|
72 | <div data-role="collapsible-set" data-content-theme="c"> |
---|
73 | <!-- MODELS --> |
---|
74 | |
---|
75 | <div data-role="collapsible" data-content-theme="c"> |
---|
76 | <h3 id="models"> |
---|
77 | {{=T("Models")}} |
---|
78 | </h3> |
---|
79 | <div id="models_inner" > |
---|
80 | {{if not models:}} |
---|
81 | <p><strong>{{=T("There are no models")}}</strong></p> |
---|
82 | {{pass}} |
---|
83 | {{for m in models:}} |
---|
84 | <span data-role="controlgroup" data-type="horizontal"> |
---|
85 | {{=editfile('models',m)}} |
---|
86 | {{=deletefile([app, 'models', m])}} |
---|
87 | {{=peekfile('models',m)}} |
---|
88 | </span> |
---|
89 | {{pass}} |
---|
90 | </div> |
---|
91 | </div> |
---|
92 | |
---|
93 | <!-- FIND CONTROLLER FUNCTIONS --> |
---|
94 | {{ |
---|
95 | controller_functions=[] |
---|
96 | for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functions[c]] |
---|
97 | }} |
---|
98 | |
---|
99 | <!-- CONTROLLERS --> |
---|
100 | <div data-role="collapsible" data-content-theme="c"> |
---|
101 | <h3 id="controllers"> |
---|
102 | {{=T("Controllers")}} |
---|
103 | </h3> |
---|
104 | <div id="controllers_inner"> |
---|
105 | {{if not controllers:}} |
---|
106 | <p><strong>{{=T("There are no controllers")}}</strong></p> |
---|
107 | {{pass}} |
---|
108 | {{for c in controllers:}} |
---|
109 | <span data-role="controlgroup" data-type="horizontal"> |
---|
110 | {{=editfile('controllers',c)}} |
---|
111 | {{=deletefile([app,'controllers',c])}} |
---|
112 | {{=testfile('controllers',c)}} |
---|
113 | {{=peekfile('controllers',c)}} |
---|
114 | </span> |
---|
115 | {{pass}} |
---|
116 | </div> |
---|
117 | </div> |
---|
118 | |
---|
119 | <!-- VIEWS --> |
---|
120 | <div data-role="collapsible" data-content-theme="c"> |
---|
121 | <h3 class="component"> |
---|
122 | {{=T("Views")}} |
---|
123 | </h3> |
---|
124 | <div id="views_inner"> |
---|
125 | {{if not views:}} |
---|
126 | <p><strong>{{=T("There are no views")}}</strong></p> |
---|
127 | {{pass}} |
---|
128 | {{for c in views:}} |
---|
129 | <span data-role="controlgroup"> |
---|
130 | {{=peekfile('views',c)}} |
---|
131 | {{=editfile('views',c)}} |
---|
132 | {{=deletefile([app,'views',c])}} |
---|
133 | </span> |
---|
134 | {{pass}} |
---|
135 | </div> |
---|
136 | </div> |
---|
137 | |
---|
138 | <!-- STATIC --> |
---|
139 | <div data-role="collapsible" data-content-theme="c"> |
---|
140 | <h3 id="static"> |
---|
141 | {{=T("Static files")}} |
---|
142 | </h3> |
---|
143 | <div id="static_inner"> |
---|
144 | {{if not statics:}}<p><strong>{{=T("There are no static files")}}</strong></p>{{pass}} |
---|
145 | <ul data-role="listview" data-inset="true"> |
---|
146 | {{ |
---|
147 | from collections import OrderedDict |
---|
148 | tree=OrderedDict() |
---|
149 | for file in statics+['']: |
---|
150 | items=file.partition('/') |
---|
151 | if not items[0] in tree: |
---|
152 | tree[items[0]] = [] |
---|
153 | pass |
---|
154 | tree[items[0]].append(items[2]) |
---|
155 | pass |
---|
156 | }} |
---|
157 | {{for k, v in tree.iteritems():}} |
---|
158 | {{if k:}} |
---|
159 | <li><a>{{=k}}</a> |
---|
160 | <ul data-theme='c'> |
---|
161 | </br> |
---|
162 | {{if len(v) == 1 and v[0] =='':}} |
---|
163 | <span data-role="controlgroup"> |
---|
164 | {{=peekfile('static', k)}} |
---|
165 | {{=editfile('static', k)}} |
---|
166 | {{=deletefile([app, 'static', k])}} |
---|
167 | </br> |
---|
168 | </span> |
---|
169 | </ul> |
---|
170 | {{continue}} |
---|
171 | {{for f in v:}} |
---|
172 | <span data-role="controlgroup"> |
---|
173 | {{=peekfile('static/'+k, f)}} |
---|
174 | {{=editfile('static/'+k, f)}} |
---|
175 | {{=deletefile([app, 'static/'+k, f])}} |
---|
176 | </br> |
---|
177 | </span> |
---|
178 | {{pass}} |
---|
179 | </ul> |
---|
180 | </li> |
---|
181 | {{pass}} |
---|
182 | {{pass}} |
---|
183 | </ul> |
---|
184 | </div> |
---|
185 | </div> |
---|
186 | |
---|
187 | <!-- MODULES --> |
---|
188 | <div data-role="collapsible" data-content-theme="c"> |
---|
189 | <h3 id="modules" onclick="collapse('modules_inner');" class="component"> |
---|
190 | {{=T("Modules")}} |
---|
191 | </h3> |
---|
192 | <div id="modules_inner"> |
---|
193 | {{if not modules:}} |
---|
194 | <p><strong>{{=T("There are no modules")}}</strong></p> |
---|
195 | {{pass}} |
---|
196 | {{for m in modules:}} |
---|
197 | <span data-role="controlgroup"> |
---|
198 | {{=peekfile('modules',m)}} |
---|
199 | {{=editfile('modules',m)}} |
---|
200 | {{if m!='__init__.py':}}<a class="button" href="{{=URL('delete',args=[app,'modules',m],vars=dict(sender=request.function+'/'+app))}}">{{=T("delete")}}</a>{{pass}} |
---|
201 | </span> |
---|
202 | {{pass}} |
---|
203 | </div> |
---|
204 | </div> |
---|
205 | |
---|
206 | |
---|
207 | |
---|