Commit bcf1d9ebbc359107926e0b3a60fe1966f813042e

Authored by Miguel Barão
1 parent 08a26dd3
Exists in master and in 1 other branch dev

- cleanup for inclusion in master branch

1 1
2 BUGS: 2 BUGS:
3 3
  4 +- servidor http com redirect para https.
4 - servir imagens/ficheiros. 5 - servir imagens/ficheiros.
5 - topicos virtuais nao deveriam aparecer. na construção da árvore os sucessores seriam ligados directamente aos predecessores. 6 - topicos virtuais nao deveriam aparecer. na construção da árvore os sucessores seriam ligados directamente aos predecessores.
6 7
config/logger-debug.yaml
@@ -19,22 +19,22 @@ loggers: @@ -19,22 +19,22 @@ loggers:
19 handlers: ['default'] 19 handlers: ['default']
20 level: 'DEBUG' 20 level: 'DEBUG'
21 21
22 - 'app': 22 + 'factory':
23 handlers: ['default'] 23 handlers: ['default']
24 level: 'DEBUG' 24 level: 'DEBUG'
25 propagate: False 25 propagate: False
26 26
27 - 'learnapp': 27 + 'knowledge':
28 handlers: ['default'] 28 handlers: ['default']
29 level: 'DEBUG' 29 level: 'DEBUG'
30 propagate: False 30 propagate: False
31 31
32 - 'questions': 32 + 'learnapp':
33 handlers: ['default'] 33 handlers: ['default']
34 level: 'DEBUG' 34 level: 'DEBUG'
35 propagate: False 35 propagate: False
36 36
37 - 'questionfactory': 37 + 'questions':
38 handlers: ['default'] 38 handlers: ['default']
39 level: 'DEBUG' 39 level: 'DEBUG'
40 propagate: False 40 propagate: False
@@ -43,14 +43,3 @@ loggers: @@ -43,14 +43,3 @@ loggers:
43 handlers: ['default'] 43 handlers: ['default']
44 level: 'DEBUG' 44 level: 'DEBUG'
45 propagate: False 45 propagate: False
46 -  
47 - 'knowledge':  
48 - handlers: ['default']  
49 - level: 'DEBUG'  
50 - propagate: False  
51 -  
52 - # 'root':  
53 - # handlers: ['default']  
54 - # level: 'DEBUG'  
55 - # propagate: False  
56 - #  
57 \ No newline at end of file 46 \ No newline at end of file
@@ -3,19 +3,16 @@ @@ -3,19 +3,16 @@
3 # python standard library 3 # python standard library
4 from os import path 4 from os import path
5 import sys 5 import sys
6 -import json  
7 import base64 6 import base64
8 import uuid 7 import uuid
9 -import concurrent.futures  
10 import logging.config 8 import logging.config
11 import argparse 9 import argparse
12 10
13 # user installed libraries 11 # user installed libraries
14 -import markdown  
15 import tornado.ioloop 12 import tornado.ioloop
16 import tornado.web 13 import tornado.web
17 import tornado.httpserver 14 import tornado.httpserver
18 -from tornado import template, gen 15 +from tornado import template #, gen
19 16
20 # this project 17 # this project
21 from learnapp import LearnApp 18 from learnapp import LearnApp
@@ -34,7 +31,7 @@ class WebApplication(tornado.web.Application): @@ -34,7 +31,7 @@ class WebApplication(tornado.web.Application):
34 (r'/question', QuestionHandler), # each question 31 (r'/question', QuestionHandler), # each question
35 (r'/topic/(.+)', TopicHandler), # page for doing a topic 32 (r'/topic/(.+)', TopicHandler), # page for doing a topic
36 (r'/', RootHandler), # show list of topics 33 (r'/', RootHandler), # show list of topics
37 - # (r'/file/(.+)', FileHandler), 34 + # (r'/file/(.+)', FileHandler), # FIXME
38 ] 35 ]
39 settings = { 36 settings = {
40 'template_path': path.join(path.dirname(__file__), 'templates'), 37 'template_path': path.join(path.dirname(__file__), 'templates'),
@@ -199,9 +196,8 @@ class QuestionHandler(BaseHandler): @@ -199,9 +196,8 @@ class QuestionHandler(BaseHandler):
199 def finished_topic(self, user): # FIXME user unused 196 def finished_topic(self, user): # FIXME user unused
200 return { 197 return {
201 'method': 'finished_topic', 198 'method': 'finished_topic',
202 - 'params': {  
203 - 'question': f'<img src="/static/trophy.png" alt="trophy" class="img-fluid mx-auto d-block" width="30%">',  
204 - # 'progress': 1.0, 199 + 'params': { # FIXME no html here please!
  200 + 'question': f'<img src="/static/trophy.png" alt="trophy" class="img-fluid mx-auto d-block" width="30%">'
205 } 201 }
206 } 202 }
207 203
templates/login.html
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html lang="en"> 2 <html lang="en">
3 <head> 3 <head>
4 - <title>GotIT</title> 4 + <title>iLearn</title>
5 <link rel="icon" href="/static/favicon.ico"> 5 <link rel="icon" href="/static/favicon.ico">
6 6
7 <meta charset="utf-8"> 7 <meta charset="utf-8">
templates/maintopics.html
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <!DOCTYPE html> 3 <!DOCTYPE html>
4 <html lang="pt-PT"> 4 <html lang="pt-PT">
5 <head> 5 <head>
6 - <title>DoIT</title> 6 + <title>iLearn</title>
7 <link rel="icon" href="/static/favicon.ico"> 7 <link rel="icon" href="/static/favicon.ico">
8 8
9 <meta charset="utf-8"> 9 <meta charset="utf-8">
templates/question.html
1 {% autoescape %} 1 {% autoescape %}
2 2
3 -<h1 class="page-header">{{ question['title'] }}</h1> 3 +<h4 class="page-header">{{ question['title'] }}</h4>
4 4
5 <div id="text"> 5 <div id="text">
6 {{ md(question['text']) }} 6 {{ md(question['text']) }}
templates/topic.html
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 - <title>GotIT</title> 4 + <title>iLearn</title>
5 <link rel="icon" href="/static/favicon.ico"> 5 <link rel="icon" href="/static/favicon.ico">
6 6
7 <meta charset="utf-8"> 7 <meta charset="utf-8">