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