Commit f2cb442c8f66ffa8a917b8c7dfba9b524b4b983c
1 parent
38b1c333
Exists in
master
perquenas correções no html
Showing
5 changed files
with
51 additions
and
26 deletions
Show diff stats
wscacicneo/security.py
1 | 1 | #!/usr/env python |
2 | -# -*- coding: utf-8 -*- | |
2 | +# -*- coding: utf-8 -*-asdasd | |
3 | + | |
3 | 4 | # # 1. carregar usuário da sessão |
4 | 5 | # # 2. carregar objeto usuário |
5 | 6 | # # 3. pegar grupo do usuário |
... | ... | @@ -9,16 +10,16 @@ from wscacicneo.model.user import User |
9 | 10 | |
10 | 11 | def groupfinder(userid, request): |
11 | 12 | user_obj = User( |
12 | - nome = 'asdasd', | |
13 | - matricula = 'asdasd', | |
14 | - email = 'asdsad', | |
15 | - orgao = 'asdsad', | |
16 | - telefone = 'sdasd', | |
17 | - cargo = 'asdasdasd', | |
18 | - setor = 'asdasd', | |
19 | - permissao = 'asdasd', | |
20 | - senha = 'sadasdasd', | |
21 | - favoritos = ['asdasdasdasd'] | |
13 | + nome = 'usuario', | |
14 | + matricula = '000000', | |
15 | + email = 'usuario@gov.br', | |
16 | + orgao = 'mpog', | |
17 | + telefone = '(11)1111-1111', | |
18 | + cargo = 'adm', | |
19 | + setor = 'ti', | |
20 | + permissao = 'Administrador', | |
21 | + senha = '123', | |
22 | + favoritos = ['favoritos'] | |
22 | 23 | ) |
23 | 24 | usuario = user_obj.search_user_by_email(userid) |
24 | 25 | permissao = usuario.results[0].permissao | ... | ... |
wscacicneo/templates/cadastro_coleta.pt
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | <label class="col-lg-2 control-label">Orgão:</label> |
10 | 10 | <div class="col-lg-5"> |
11 | 11 | <select id="orgao" class="form-control"> |
12 | + <option></option> | |
12 | 13 | <option tal:repeat="doc orgao_doc">${doc.nome}</option> |
13 | 14 | </select> |
14 | 15 | </div> |
... | ... | @@ -21,15 +22,16 @@ |
21 | 22 | </div> |
22 | 23 | <br/> |
23 | 24 | <div class="form-group"> |
24 | - <div style="margin-left: 200px;font-size: 150%;">Software List</div> | |
25 | + <div style="margin-left: 200px;font-size: 150%;">Lista de Softwares</div> | |
25 | 26 | </div> |
26 | 27 | <div class="form-group"> |
27 | - <label class="col-lg-2 control-label">softwarelist:</label> | |
28 | - <div class="col-lg-5"> | |
29 | - <input type="text" id="softwarelist" class="form-control" placeholder="softwarelist"> | |
28 | + <label class="col-lg-2 control-label">Lista de Softwares:</label> | |
29 | + <button class="add_field_button">Add More Fields</button> | |
30 | + <div class="col-lg-5 input_fields_wrap"> | |
31 | + <input type="text" id="softwarelist" class="form-control" placeholder="software"> | |
30 | 32 | </div> |
31 | 33 | </div> |
32 | - | |
34 | + | |
33 | 35 | <br/> |
34 | 36 | <div class="form-group"> |
35 | 37 | <div style="margin-left: 200px;font-size: 150%;">Sistema Operacional</div> |
... | ... | @@ -54,7 +56,7 @@ |
54 | 56 | </div> |
55 | 57 | </div> |
56 | 58 | <div class="form-group"> |
57 | - <div style="margin-left: 200px;font-size: 150%;">win32_bios</div> | |
59 | + <div style="margin-left: 200px;font-size: 150%;">BIOS</div> | |
58 | 60 | </div> |
59 | 61 | <div class="form-group"> |
60 | 62 | <label class="col-lg-2 control-label">win32_bios_manufacturer:</label> |
... | ... | @@ -64,7 +66,7 @@ |
64 | 66 | </div> |
65 | 67 | <br/> |
66 | 68 | <div class="form-group"> |
67 | - <div style="margin-left: 200px;font-size: 150%;">win32_processor</div> | |
69 | + <div style="margin-left: 200px;font-size: 150%;">Processador</div> | |
68 | 70 | </div> |
69 | 71 | <div class="form-group"> |
70 | 72 | <label class="col-lg-2 control-label">win32_processor_manufacturer:</label> |
... | ... | @@ -94,11 +96,32 @@ |
94 | 96 | <button type="button" id="enviar" class="btn btn-sm" style="margin-left: 315px;" >Enviar</button> |
95 | 97 | <button type="button" id="limpar" class="btn btn-sm">Limpar</button> |
96 | 98 | </div> |
99 | + | |
100 | + | |
97 | 101 | </form> |
98 | 102 | |
99 | 103 | </metal:content> |
100 | 104 | <metal:content fill-slot="javascript"> |
101 | 105 | <script type="text/javascript"> |
106 | + $(document).ready(function() { | |
107 | + var max_fields = 10; //maximum input boxes allowed | |
108 | + var wrapper = $(".input_fields_wrap"); //Fields wrapper | |
109 | + var add_button = $(".add_field_button"); //Add button ID | |
110 | + | |
111 | + var x = 1; //initlal text box count | |
112 | + $(add_button).click(function(e){ //on add input button click | |
113 | + e.preventDefault(); | |
114 | + if(x < max_fields){ //max input box allowed | |
115 | + x++; //text box increment | |
116 | + $(wrapper).append('<div><input type="text" id="softwarelist" class="form-control" placeholder="software"/><a href="#" class="remove_field">Remove</a></div>'); //add input box | |
117 | + } | |
118 | + }); | |
119 | + | |
120 | + $(wrapper).on("click",".remove_field", function(e){ //user click on remove text | |
121 | + e.preventDefault(); $(this).parent('div').remove(); x--; | |
122 | + }) | |
123 | + }); | |
124 | + | |
102 | 125 | $('#limpar').click(function(){ |
103 | 126 | $('#data_coleta').val('') |
104 | 127 | $('#softwarelist').val('') | ... | ... |
wscacicneo/templates/master.pt
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 | <i class="fa fa-home"></i> |
102 | 102 | </h2> |
103 | 103 | <h2 class="pull-left" id="dashlocation"> |
104 | - Você está em: ${request.path} | |
104 | + ${request.path} | |
105 | 105 | </h2> |
106 | 106 | |
107 | 107 | |
... | ... | @@ -133,8 +133,8 @@ |
133 | 133 | <metal:content fill-slot="javascript"> |
134 | 134 | <script type="text/javascript"> |
135 | 135 | $( document ).ready(function() { |
136 | - var string = $('#dashlocation').text().replace("/wscacicneo/", ""); | |
137 | - $('#dashlocation').text(string); | |
136 | + var string = $('#dashlocation').text().split("/"); | |
137 | + $('#dashlocation').text(string[2]); | |
138 | 138 | }); |
139 | 139 | </script> |
140 | 140 | <metal:content define-slot="javascript"/> | ... | ... |
wscacicneo/templates/menu.pt
... | ... | @@ -9,16 +9,17 @@ |
9 | 9 | </li> |
10 | 10 | <li class="has_sub" > |
11 | 11 | <a href="#"><i class="fa fa-file-o"></i> Orgão <span class="pull-right"><i class="fa fa-chevron-right"></i></span></a> |
12 | - <ul | |
13 | -> <li><a href="${request.route_url('root')}orgao/cadastro">Cadastrar Orgão</a></li> | |
14 | - <li><a href="${request.route_url('root')}orgao/lista">Listar Orgãos</a></li> | |
12 | + <ul> | |
15 | 13 | <li><a href="${request.route_url('root')}notificacoes/lista">Notificações</a></li> |
14 | + <li><a href="${request.route_url('root')}orgao/lista">Listar Orgãos</a></li> | |
15 | + <li><a href="${request.route_url('root')}coleta/cadastro">Cadastrar Coleta</a></li> | |
16 | + <li><a href="${request.route_url('root')}orgao/cadastro">Cadastrar Orgão</a></li> | |
16 | 17 | </ul> |
17 | 18 | <li class="has_sub"> |
18 | 19 | <a href="#"><i class="fa fa-file-o"></i> Usuário <span class="pull-right"><i class="fa fa-chevron-right"></i></span></a> |
19 | 20 | <ul> |
20 | - <li><a href="${request.route_url('root')}usuario/cadastro">Cadastrar Usuário</a></li> | |
21 | 21 | <li><a href="${request.route_url('root')}usuario/lista">Listar Usuários</a></li> |
22 | + <li><a href="${request.route_url('root')}usuario/cadastro">Cadastrar Usuário</a></li> | |
22 | 23 | </ul> |
23 | 24 | </li> |
24 | 25 | </ul> | ... | ... |
wscacicneo/utils/utils.py