Commit 38d5021f7304c42450247a880fafc77e2be31292
1 parent
7ed4aa65
Exists in
master
correção do template
Showing
4 changed files
with
19 additions
and
16 deletions
Show diff stats
wscacicneo/__init__.py
... | ... | @@ -30,6 +30,7 @@ def main(global_config, **settings): |
30 | 30 | config.add_static_view('static', 'static', cache_max_age=3600) |
31 | 31 | config.add_route('master', 'master') |
32 | 32 | config.add_route('blankmaster', 'blankmaster') |
33 | + config.add_route('root', '/') | |
33 | 34 | |
34 | 35 | config.add_route('home', 'home') |
35 | 36 | config.add_route('graficop', 'graficop') |
... | ... | @@ -40,7 +41,8 @@ def main(global_config, **settings): |
40 | 41 | #Órgão |
41 | 42 | config.add_route('orgao', 'orgao') |
42 | 43 | config.add_route('post_orgao', 'post_orgao') |
43 | - config.add_route('edit_orgao', 'edit_orgao') | |
44 | + config.add_route('put_orgao', 'put_orgao') | |
45 | + config.add_route('editorgao', 'editar/{orgao}') | |
44 | 46 | config.add_route('listorgao', 'listorgao') |
45 | 47 | config.add_route('delete_orgao', 'delete_orgao') |
46 | 48 | # |
... | ... | @@ -64,9 +66,6 @@ def main(global_config, **settings): |
64 | 66 | config.add_route('sobre', 'sobre') |
65 | 67 | config.add_route('perfil', 'perfil') |
66 | 68 | config.add_route('configapi','configapi') |
67 | - #editar Órgão | |
68 | - config.add_route('editarorgao','editarorgao') | |
69 | - # | |
70 | 69 | config.add_route('notify','notify') |
71 | 70 | config.add_route('processador','processador') |
72 | 71 | config.add_route('configcoleta','configcoleta') | ... | ... |
wscacicneo/templates/blankmaster.pt
... | ... | @@ -11,9 +11,9 @@ |
11 | 11 | <meta name="author" content="adley"> |
12 | 12 | <metal:content define-slot="head" /> |
13 | 13 | <!-- Stylesheets --> |
14 | - <link href="static/macadmin/css/bootstrap.min.css" rel="stylesheet"> | |
14 | + <link href="${request.route_url('root')}/static/macadmin/css/bootstrap.min.css" rel="stylesheet"> | |
15 | 15 | <!-- Font awesome icon --> |
16 | - <link rel="stylesheet" href="static/macadmin/css/font-awesome.min.css"> | |
16 | + <link rel="stylesheet" href="${request.route_url('root')}/static/macadmin/css/font-awesome.min.css"> | |
17 | 17 | <!-- jQuery UI --> |
18 | 18 | <link rel="stylesheet" href="static/macadmin/css/jquery-ui.css"> |
19 | 19 | <!-- Calendar --> |
... | ... | @@ -87,4 +87,4 @@ |
87 | 87 | |
88 | 88 | </body> |
89 | 89 | |
90 | -</html> | |
91 | 90 | \ No newline at end of file |
91 | +</html> | ... | ... |
wscacicneo/templates/editarorgao.pt
1 | 1 | <metal:main use-macro="load: master.pt"> |
2 | - <!-- Insere JavaScript --> | |
3 | - <script metal:fill-slot="javascript" type="text/javascript" src="static/js/editarorgao.js"></script> | |
4 | - | |
5 | - <div metal:fill-slot="conteudo" id="widgets"> | |
6 | -</div> | |
2 | + <metal:content fill-slot="conteudo"> | |
3 | + </metal:content> | |
4 | + <metal:content fill-slot="javascript"> | |
5 | + </metal:content> | |
7 | 6 | </metal:main> | ... | ... |
wscacicneo/views.py
... | ... | @@ -30,6 +30,11 @@ def blankmaster(request): |
30 | 30 | def master(request): |
31 | 31 | return {'project': 'WSCacicNeo'} |
32 | 32 | |
33 | +@view_config(route_name='root') | |
34 | +def root(request): | |
35 | + return {'project': 'WSCacicNeo'} | |
36 | + | |
37 | + | |
33 | 38 | @view_config(route_name='home', renderer='templates/home.pt') |
34 | 39 | def home(request): |
35 | 40 | return {'project': 'WSCacicNeo'} |
... | ... | @@ -140,8 +145,8 @@ def bot(request): |
140 | 145 | def configapi(request): |
141 | 146 | return {'project': 'WSCacicNeo'} |
142 | 147 | |
143 | -@view_config(route_name='editarorgao', renderer='templates/editarorgao.pt') | |
144 | -def editarorgao(request): | |
148 | +@view_config(route_name='editorgao', renderer='templates/editarorgao.pt') | |
149 | +def editorgao(request): | |
145 | 150 | return {'project': 'WSCacicNeo'} |
146 | 151 | |
147 | 152 | @view_config(route_name='notify', renderer='templates/notify.pt') |
... | ... | @@ -198,8 +203,8 @@ def post_orgao(request): |
198 | 203 | |
199 | 204 | return Response(str(id_doc)) |
200 | 205 | |
201 | -@view_config(route_name='edit_orgao') | |
202 | -def edit_orgao(request): | |
206 | +@view_config(route_name='put_orgao') | |
207 | +def put_orgao(request): | |
203 | 208 | """ |
204 | 209 | Edita um doc apartir do id |
205 | 210 | """ | ... | ... |