1 | {{extend 'layout.html'}} |
---|
2 | {{ |
---|
3 | import os |
---|
4 | def all(items): |
---|
5 | return reduce(lambda a,b:a and b,items,True) |
---|
6 | def peekfile(path,file): |
---|
7 | return A(file.replace('\\\\','/'),_href=URL('peek', args=(app, path, file))) |
---|
8 | def editfile(path,file): |
---|
9 | return A(SPAN(T('Edit')),_class='button editbutton btn btn-mini',_href=URL('edit', args=(app, path, file))) |
---|
10 | def testfile(path,file): |
---|
11 | return A(TAG[''](IMG(_src=URL('static', 'images/test_icon.png'), _alt=T('test')), |
---|
12 | SPAN(T("Run tests in this file"))), |
---|
13 | _class='icon test', |
---|
14 | _href=URL('test', args=(app, file)), |
---|
15 | _rel="tooltip", |
---|
16 | **{'_data-placement':'right', |
---|
17 | '_data-original-title':T("Run tests in this file")}) |
---|
18 | def editlanguagefile(path,file): |
---|
19 | return A(SPAN(T('Edit')),_class='button editbutton btn-mini',_href=URL('edit_language', args=(app, path, file))) |
---|
20 | def file_upload_form(location): |
---|
21 | form=FORM(T("upload file:")," ", |
---|
22 | INPUT(_type="file",_name="file")," ",T("and rename it:")," ", |
---|
23 | INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()), |
---|
24 | INPUT(_type="hidden",_name="location",_value=location), |
---|
25 | INPUT(_type="hidden",_name="token",_value=session.token), |
---|
26 | INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)), |
---|
27 | INPUT(_type="submit",_value=T("Submit")),_action=URL('upload_file')) |
---|
28 | return form |
---|
29 | def file_create_form(location): |
---|
30 | form=FORM(T("create file with filename:")," ", |
---|
31 | INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()), |
---|
32 | INPUT(_type="hidden",_name="location",_value=location), |
---|
33 | INPUT(_type="hidden",_name="token",_value=session.token), |
---|
34 | INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)), |
---|
35 | INPUT(_type="submit",_value=T("Submit")),_action=URL('create_file')) |
---|
36 | return form |
---|
37 | def deletefile(arglist): |
---|
38 | return A(TAG[''](IMG(_src=URL('static', 'images/delete_icon.png')), |
---|
39 | SPAN(T('Delete this file (you will be asked to confirm deletion)'))), |
---|
40 | _href=URL('delete',args=arglist,vars=dict(sender=request.function+'/'+app+'/'+request.args[1])), |
---|
41 | _class='icon delete', |
---|
42 | _rel="tooltip", |
---|
43 | **{'_data-placement':'right', |
---|
44 | '_data-original-title':T('Delete this file (you will be asked to confirm deletion)')}) |
---|
45 | }} |
---|
46 | |
---|
47 | {{block sectionclass}}plugin{{end}} |
---|
48 | <!-- begin "plugin" block --> |
---|
49 | <h2>{{=T('Plugin "%s" in application', request.args(1))}} "{{=app}}"</h2> |
---|
50 | |
---|
51 | <!-- COLLAPSE/JUMP-TO BUTTONS --> |
---|
52 | <div class="right-full controls"> |
---|
53 | <p class="buttons-row"> |
---|
54 | <a class="button special btn btn-inverse" href="#" onclick="jQuery('h3>span').click();return false"><span>{{=T("collapse/expand all")}}</span></a> |
---|
55 | <span class="buttongroup"> |
---|
56 | {{=button('#models', T("models"))}} |
---|
57 | {{=button('#controllers', T("controllers"))}} |
---|
58 | {{=button('#views', T("views"))}} |
---|
59 | {{=button('#static', T("static"))}} |
---|
60 | {{=button('#modules', T("modules"))}} |
---|
61 | </span> |
---|
62 | <span class="buttongroup"> |
---|
63 | {{=sp_button(URL('design',args=request.args, anchor=request.vars.id), T("back"))}} |
---|
64 | {{=sp_button(URL('delete_plugin',args=request.args, vars=request.vars), T("delete plugin"))}} |
---|
65 | {{=sp_button(URL('pack_plugin',args=request.args), T("pack plugin"))}} |
---|
66 | </span> |
---|
67 | </p> |
---|
68 | </div> |
---|
69 | |
---|
70 | <!-- MODELS --> |
---|
71 | <h3 id="_models" rel="pagebookmark"> |
---|
72 | <span class="component" onclick="collapse('models_inner');">{{=T("Models")}}</span> |
---|
73 | <span id="models" class="hashstick"> </span><a href="#" class="tophashlink btn btn-mini btn-warning"><span>top</span></a> |
---|
74 | </h3> |
---|
75 | <div id="models_inner" class="component_contents"> |
---|
76 | {{if not models:}}<p><strong>{{=T("There are no models")}}</strong></p>{{else:}} |
---|
77 | <ul class="unstyled act-edit"> |
---|
78 | {{for m in models:}} |
---|
79 | <li> |
---|
80 | <span class="filetools controls"> |
---|
81 | {{=editfile('models',m)}} |
---|
82 | {{=deletefile([app, 'models', m])}} |
---|
83 | </span> |
---|
84 | <span class="file"> |
---|
85 | {{=peekfile('models',m)}} |
---|
86 | </span> |
---|
87 | <span class="extras"> |
---|
88 | {{if len(defines[m]):}}{{=T("defines tables")}} {{pass}}{{=XML(b', '.join([B(table).xml() for table in defines[m]]))}} |
---|
89 | </span> |
---|
90 | </li> |
---|
91 | {{pass}} |
---|
92 | </ul> |
---|
93 | {{pass}} |
---|
94 | </div> |
---|
95 | |
---|
96 | <!-- FIND CONTROLLER FUNCTIONS --> |
---|
97 | {{ |
---|
98 | controller_functions=[] |
---|
99 | for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functions[c]] |
---|
100 | }} |
---|
101 | |
---|
102 | <!-- CONTROLLERS --> |
---|
103 | <h3 id="_controllers" rel="pagebookmark"> |
---|
104 | <span class="component" onclick="collapse('controllers_inner');">{{=T("Controllers")}}</span> |
---|
105 | <span id="controllers" class="hashstick"> </span><a href="#" class="tophashlink btn btn-mini btn-warning"><span>top</span></a> |
---|
106 | </h3> |
---|
107 | <div id="controllers_inner" class="component_contents"> |
---|
108 | {{if not controllers:}}<p><strong>{{=T("There are no controllers")}}</strong></p>{{else:}} |
---|
109 | <ul class="unstyled act_edit"> |
---|
110 | {{for c in controllers:}} |
---|
111 | <li> |
---|
112 | <span class="filetools controls"> |
---|
113 | {{=editfile('controllers',c)}} |
---|
114 | {{=deletefile([app,'controllers',c])}} |
---|
115 | {{=testfile('controllers',c)}} |
---|
116 | </span> |
---|
117 | <span class="file"> |
---|
118 | {{=peekfile('controllers',c)}} |
---|
119 | </span> |
---|
120 | <span class="extras celled"> |
---|
121 | {{if functions[c]:}}{{=T("exposes")}} {{pass}}{{=XML(b', '.join([A(f,_href=URL(a=app,c=c[:-3],f=f)).xml() for f in functions[c]]))}} |
---|
122 | </span> |
---|
123 | </li> |
---|
124 | {{pass}} |
---|
125 | </ul> |
---|
126 | {{pass}} |
---|
127 | </div> |
---|
128 | |
---|
129 | <!-- VIEWS --> |
---|
130 | <h3 id="_views" rel="pagebookmark"> |
---|
131 | <span class="component" onclick="collapse('views_inner');">{{=T("Views")}}</span> |
---|
132 | <span id="views" class="hashstick"> </span><a href="#" class="tophashlink btn btn-mini btn-warning"><span>top</span></a> |
---|
133 | </h3> |
---|
134 | <div id="views_inner" class="component_contents"> |
---|
135 | {{if not views:}}<p><strong>{{=T("There are no views")}}</strong></p>{{else:}} |
---|
136 | <ul class="unstyled act_edit"> |
---|
137 | {{for c in views:}} |
---|
138 | <li> |
---|
139 | <span class="filetools controls"> |
---|
140 | {{=editfile('views',c)}} |
---|
141 | {{=deletefile([app, 'views', c])}} |
---|
142 | </span> |
---|
143 | <span class="file"> |
---|
144 | {{=peekfile('views',c)}} |
---|
145 | </span> |
---|
146 | <span class="extras celled"> |
---|
147 | {{if c in extend:}}{{=T("extends")}} <b>{{=extend[c]}}</b> {{pass}} |
---|
148 | {{if include[c]:}}{{=T("includes")}} {{pass}}{{=XML(b', '.join([B(f).xml() for f in include[c]]))}} |
---|
149 | </span> |
---|
150 | </li> |
---|
151 | {{pass}} |
---|
152 | </ul> |
---|
153 | {{pass}} |
---|
154 | </div> |
---|
155 | |
---|
156 | <!-- STATIC --> |
---|
157 | <h3 id="_static" rel="pagebookmark"> |
---|
158 | <span class="component" onclick="collapse('static_inner');">{{=T("Static files")}}</span> |
---|
159 | <span id="static" class="hashstick"> </span><a href="#" class="tophashlink btn btn-mini btn-warning"><span>top</span></a> |
---|
160 | </h3> |
---|
161 | <div id="static_inner" class="component_contents"> |
---|
162 | {{if not statics:}}<p><strong>{{=T("There are no static files")}}</strong></p>{{else:}} |
---|
163 | <ul class="unstyled act_edit"> |
---|
164 | {{ |
---|
165 | path=[] |
---|
166 | for file in statics+['']: |
---|
167 | items=file.split('/') |
---|
168 | file_path=items[:-1] |
---|
169 | filename=items[-1] |
---|
170 | while path!=file_path: |
---|
171 | if len(file_path)>=len(path) and all([v==file_path[k] for k,v in enumerate(path)]): |
---|
172 | path.append(file_path[len(path)]) |
---|
173 | thispath='static__'+'__'.join(path) |
---|
174 | }} |
---|
175 | <li class="folder"><i> </i> |
---|
176 | <a href="javascript:collapse('{{=thispath}}');" class="file">{{=path[-1]}}/</a> |
---|
177 | <ul id="{{=thispath}}" style="display: none;" class="sublist"> |
---|
178 | {{ |
---|
179 | else: |
---|
180 | path = path[:-1] |
---|
181 | }} |
---|
182 | </ul> |
---|
183 | </li> |
---|
184 | {{ |
---|
185 | pass |
---|
186 | pass |
---|
187 | if filename: |
---|
188 | }} |
---|
189 | <li> |
---|
190 | <span class="filetools controls"> |
---|
191 | {{=editfile('static',file)}} {{=deletefile([app,'static',file])}} |
---|
192 | </span> |
---|
193 | <span class="file"> |
---|
194 | <a href="{{=URL(a=app,c='static',f=file)}}">{{=filename}}</a> |
---|
195 | </span> |
---|
196 | </li> |
---|
197 | {{ |
---|
198 | pass |
---|
199 | pass |
---|
200 | }} |
---|
201 | </ul> |
---|
202 | {{pass}} |
---|
203 | </div> |
---|
204 | |
---|
205 | <!-- MODULES --> |
---|
206 | <h3 id="_modules" rel="pagebookmark"> |
---|
207 | <span class="component" onclick="collapse('modules_inner');">{{=T("Modules")}}</span> |
---|
208 | <span id="modules" class="hashstick"> </span><a href="#" class="tophashlink btn btn-mini btn-warning"><span>top</span></a> |
---|
209 | </h3> |
---|
210 | <div id="modules_inner" class="component_contents"> |
---|
211 | {{if not modules:}}<p><strong>{{=T("There are no modules")}}</strong></p>{{else:}} |
---|
212 | <ul class="unstyled act_edit"> |
---|
213 | {{for m in modules:}} |
---|
214 | <li> |
---|
215 | {{=editfile('modules',m)}} |
---|
216 | {{if m!='__init__.py':}}<a class="button btn" href="{{=URL('delete',args=[app,'modules',m],vars=dict(sender=request.function+'/'+app))}}">{{=T("delete")}}</a>{{pass}} |
---|
217 | {{=peekfile('modules',m)}} |
---|
218 | </li> |
---|
219 | {{pass}} |
---|
220 | </ul> |
---|
221 | {{pass}} |
---|
222 | </div> |
---|
223 | <!-- end "plugin" block --> |
---|