Commit ac45791abfbee474a791f1704ebed9523acd0917

Authored by Miguel Barão
1 parent 3f718dec
Exists in dev

refactor templates

- common head for all templates
- remove appname from templates
aprendizations/serve.py
... ... @@ -23,7 +23,6 @@ from tornado.escape import to_unicode
23 23 # this project
24 24 from aprendizations.renderer_markdown import md_to_html
25 25 from aprendizations.learnapp import LearnException
26   -from aprendizations import APP_NAME
27 26  
28 27  
29 28 # setup logger for this module
... ... @@ -180,7 +179,6 @@ class CourseHandler(BaseHandler):
180 179 self.redirect('/courses')
181 180  
182 181 self.render('maintopics-table.html',
183   - appname=APP_NAME,
184 182 uid=uid,
185 183 name=self.app.get_student_name(uid),
186 184 state=self.app.get_student_state(uid),
... ...
aprendizations/templates/courses.html
... ... @@ -3,19 +3,12 @@
3 3 <!DOCTYPE html>
4 4 <html lang="pt-PT">
5 5 <head>
6   - <meta charset="utf-8" />
7   - <meta name="viewport" content="width=device-width, initial-scale=1">
8   - <meta name="author" content="Miguel Barão">
9   - <link rel="icon" href="favicon.ico">
10   -
  6 + {% include include-head.html %}
11 7 {% include include-libs.html %}
12 8  
13 9 <link rel="stylesheet" href="{{static_url('css/maintopics.css')}}">
14 10 <link rel="stylesheet" href="{{static_url('css/sticky-footer-navbar.css')}}">
15   -
16 11 <script defer src="{{static_url('js/maintopics.js')}}"></script>
17   -
18   - <title>aprendizations</title>
19 12 </head>
20 13  
21 14 <body>
... ...
aprendizations/templates/include-head.html 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +<meta charset="utf-8" />
  2 +<meta name="viewport" content="width=device-width, initial-scale=1">
  3 +<meta name="author" content="Miguel Barão">
  4 +<link rel="icon" href="favicon.ico">
  5 +<title>aprendizations</title>
... ...
aprendizations/templates/login.html
1 1 <!DOCTYPE html>
2 2 <html lang="en">
3 3 <head>
4   - <meta charset="utf-8" />
5   - <meta name="viewport" content="width=device-width, initial-scale=1" />
6   - <meta name="author" content="Miguel Barão" />
7   - <link rel="icon" href="favicon.ico">
8   -
  4 + {% include include-head.html %}
9 5 {% include include-libs.html %}
10 6  
11 7 <style>
... ... @@ -23,10 +19,7 @@
23 19 }
24 20 }
25 21 </style>
26   -
27 22 <link href="{{static_url('css/signin.css')}}" rel="stylesheet">
28   -
29   - <title>aprendizations</title>
30 23 </head>
31 24 <body class="text-center">
32 25  
... ...
aprendizations/templates/maintopics-table.html
... ... @@ -3,17 +3,11 @@
3 3 <!DOCTYPE html>
4 4 <html lang="pt">
5 5 <head>
6   - <meta charset="utf-8" />
7   - <meta name="viewport" content="width=device-width, initial-scale=1" />
8   - <meta name="author" content="Miguel Barão" />
9   - <link rel="icon" href="favicon.ico">
10   -
  6 + {% include include-head.html %}
11 7 {% include include-libs.html %}
12 8  
13 9 <link rel="stylesheet" href="{{static_url('css/maintopics.css')}}">
14 10 <script defer src="{{static_url('js/maintopics.js')}}"></script>
15   -
16   - <title>{{appname}}</title>
17 11 </head>
18 12 <!-- ===================================================================== -->
19 13 <body>
... ...
aprendizations/templates/rankings.html
... ... @@ -3,17 +3,11 @@
3 3 <!DOCTYPE html>
4 4 <html lang="pt">
5 5 <head>
6   - <meta charset="utf-8" />
7   - <meta name="viewport" content="width=device-width, initial-scale=1" />
8   - <meta name="author" content="Miguel Barão" />
9   - <link rel="icon" href="favicon.ico">
10   -
  6 + {% include include-head.html %}
11 7 {% include include-libs.html %}
12 8  
13 9 <link rel="stylesheet" href="{{static_url('css/maintopics.css')}}">
14 10 <script defer src="{{static_url('js/maintopics.js')}}"></script>
15   -
16   - <title>aprendizations</title>
17 11 </head>
18 12 <!-- ===================================================================== -->
19 13 <body>
... ...
aprendizations/templates/topic.html
1 1 <!DOCTYPE html>
2 2 <html lang="pt-PT">
3 3 <head>
4   - <meta charset="utf-8" />
5   - <meta name="viewport" content="width=device-width, initial-scale=1" />
6   - <meta name="author" content="Miguel Barão" />
7   - <link rel="icon" href="favicon.ico">
8   -
  4 + {% include include-head.html %}
9 5 {% include include-libs.html %}
10 6  
11 7 <!-- local -->
12 8 <link rel="stylesheet" href="{{static_url('css/github.css')}}" />
13 9 <link rel="stylesheet" href="{{static_url('css/topic.css')}}" />
14 10 <script defer src="{{static_url('js/topic.js')}}"></script>
15   -
16   - <title>aprendizations</title>
17 11 </head>
18 12 <!-- ===================================================================== -->
19 13 <body>
... ...