Commit 5c9ee59b0852c3cc4679f481757ad98b87e73655

Authored by Miguel Barao
1 parent 704d1d69
Exists in master and in 1 other branch dev

- fixed /static path in some templates

BUGS.md
1 1  
2 2 # BUGS
3 3  
4   -- argumentos da linha de comando a funcionar.
5 4 - usar thread.Lock para aceder a variaveis de estado.
6 5 - permitir adicionar imagens nas perguntas.
  6 +- debug mode: log levels not working
7 7  
8 8 # TODO
9 9  
... ... @@ -22,6 +22,7 @@
22 22  
23 23 # FIXED
24 24  
  25 +- argumentos da linha de comando a funcionar.
25 26 - configuracao dos logs cherrypy para se darem bem com os outros
26 27 - browser e ip usados gravado no test.
27 28 - botões allow all/deny all.
... ...
questions.py
... ... @@ -48,6 +48,7 @@ else:
48 48  
49 49 # ---------------------------------------------------------------------------
50 50 # Runs a script and returns its stdout parsed as yaml, or None on error.
  51 +# Note: requires python 3.5+
51 52 # ---------------------------------------------------------------------------
52 53 def run_script(script, stdin='', timeout=5):
53 54 try:
... ...
serve.py
... ... @@ -234,8 +234,9 @@ if __name__ == '__main__':
234 234 # --- parse command line arguments and build base test
235 235 arg = parse_arguments()
236 236  
237   - if arg.debug:
  237 + if arg.debug: # FIXME log.level DEBUG not working
238 238 LOGGER_CONF = path.join(SERVER_PATH, 'config/logger-debug.yaml')
  239 + filename = path.abspath(path.expanduser(arg.testfile[0]))
239 240  
240 241 # --- Setup logging
241 242 with open(LOGGER_CONF,'r') as f:
... ... @@ -244,10 +245,6 @@ if __name__ == '__main__':
244 245 # --- start application
245 246 from app import App
246 247  
247   - # FIXME do not send args that were not defined in the commandline
248   - # this means options should be like --show-ref=true|false
249   - # and have no default value
250   - filename = path.abspath(path.expanduser(arg.testfile[0]))
251 248 try:
252 249 app = App(filename, vars(arg))
253 250 except:
... ... @@ -275,8 +272,6 @@ if __name__ == '__main__':
275 272  
276 273 'tools.secureheaders.on': True,
277 274 'tools.staticdir.root': SERVER_PATH,
278   - 'tools.staticdir.dir': 'static', # where to get js,css,jpg,...
279   - 'tools.staticdir.on': True,
280 275 },
281 276 '/adminwebservice': {
282 277 'request.dispatch': cherrypy.dispatch.MethodDispatcher(),
... ... @@ -284,9 +279,9 @@ if __name__ == '__main__':
284 279 'tools.response_headers.headers': [('Content-Type', 'text/plain')],
285 280 },
286 281 '/static': {
287   - 'tools.auth.on': False, # everything in /static is public
  282 + 'tools.auth.on': False, # everything in /static is public
288 283 'tools.staticdir.on': True,
289   - 'tools.staticdir.dir': 'static', # where to get js,css,jpg,...
  284 + 'tools.staticdir.dir': 'static',# where to get js, css, ...
290 285 },
291 286 }
292 287  
... ...
templates/admin.html
... ... @@ -5,14 +5,14 @@
5 5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 6 <meta name="viewport" content="width=device-width, initial-scale=1">
7 7 <title> Admin </title>
8   - <link rel="icon" href="favicon.ico">
  8 + <link rel="icon" href="/static/favicon.ico">
9 9  
10 10 <!-- Bootstrap -->
11   - <link rel="stylesheet" href="/css/bootstrap.min.css">
12   - <link rel="stylesheet" href="/css/bootstrap-theme.min.css"> <!-- optional -->
  11 + <link rel="stylesheet" href="/static/css/bootstrap.min.css">
  12 + <link rel="stylesheet" href="/static/css/bootstrap-theme.min.css"> <!-- optional -->
13 13  
14   - <script src="/js/jquery.min.js"></script>
15   - <script src="/js/bootstrap.min.js"></script>
  14 + <script src="/static/js/jquery.min.js"></script>
  15 + <script src="/static/js/bootstrap.min.js"></script>
16 16  
17 17 <style>
18 18 /* Fixes navigation panel overlaying content */
... ... @@ -31,7 +31,7 @@
31 31 }
32 32 </style>
33 33  
34   - <script src="/js/admin.js"></script>
  34 + <script src="/static/js/admin.js"></script>
35 35 </head>
36 36 <!-- ===================================================================== -->
37 37 <body>
... ...
templates/test.html
... ... @@ -14,7 +14,7 @@
14 14 });
15 15 </script>
16 16  
17   - <script type="text/javascript" src="/js/mathjax/MathJax.js?config=TeX-AMS_CHTML-full">
  17 + <script type="text/javascript" src="/static/js/mathjax/MathJax.js?config=TeX-AMS_CHTML-full">
18 18 </script>
19 19  
20 20 <!-- Bootstrap -->
... ... @@ -330,7 +330,7 @@
330 330 </div>
331 331 </div>
332 332  
333   -<script src="/js/tabkey_in_textarea.js"></script>
334   -<script src="/js/prevent_enter_submit.js"></script>
  333 +<script src="/static/js/tabkey_in_textarea.js"></script>
  334 +<script src="/static/js/prevent_enter_submit.js"></script>
335 335 </body>
336 336 </html>
... ...