Commit 3f718decafbe51e5fb60ad99d8a9261203320fdf
1 parent
43073816
Exists in
dev
minor fix
fix favicon completely remove counter cookie
Showing
7 changed files
with
11 additions
and
22 deletions
Show diff stats
aprendizations/learnapp.py
| @@ -52,7 +52,6 @@ class LearnApp(): | @@ -52,7 +52,6 @@ class LearnApp(): | ||
| 52 | 'number': ..., | 52 | 'number': ..., |
| 53 | 'name': ..., | 53 | 'name': ..., |
| 54 | 'state': StudentState(), | 54 | 'state': StudentState(), |
| 55 | - # 'counter': ... | ||
| 56 | }, ... | 55 | }, ... |
| 57 | } | 56 | } |
| 58 | ''' | 57 | ''' |
| @@ -174,10 +173,8 @@ class LearnApp(): | @@ -174,10 +173,8 @@ class LearnApp(): | ||
| 174 | if pw_ok: | 173 | if pw_ok: |
| 175 | if uid in self.online: | 174 | if uid in self.online: |
| 176 | logger.warning('User "%s" already logged in', uid) | 175 | logger.warning('User "%s" already logged in', uid) |
| 177 | - counter = self.online[uid]['counter'] # FIXME | ||
| 178 | else: | 176 | else: |
| 179 | logger.info('User "%s" logged in', uid) | 177 | logger.info('User "%s" logged in', uid) |
| 180 | - counter = 0 | ||
| 181 | 178 | ||
| 182 | # get topics for this student and set its current state | 179 | # get topics for this student and set its current state |
| 183 | query = select(StudentTopic).where(StudentTopic.student_id == uid) | 180 | query = select(StudentTopic).where(StudentTopic.student_id == uid) |
| @@ -195,7 +192,6 @@ class LearnApp(): | @@ -195,7 +192,6 @@ class LearnApp(): | ||
| 195 | 'state': StudentState(uid=uid, state=state, | 192 | 'state': StudentState(uid=uid, state=state, |
| 196 | courses=self.courses, deps=self.deps, | 193 | courses=self.courses, deps=self.deps, |
| 197 | factory=self.factory), | 194 | factory=self.factory), |
| 198 | - 'counter': counter + 1, # count simultaneous logins FIXME | ||
| 199 | } | 195 | } |
| 200 | 196 | ||
| 201 | else: | 197 | else: |
| @@ -494,10 +490,6 @@ class LearnApp(): | @@ -494,10 +490,6 @@ class LearnApp(): | ||
| 494 | 490 | ||
| 495 | return factory | 491 | return factory |
| 496 | 492 | ||
| 497 | - # def get_login_counter(self, uid: str) -> int: | ||
| 498 | - # '''login counter''' | ||
| 499 | - # return int(self.online[uid]['counter']) | ||
| 500 | - | ||
| 501 | def get_student_name(self, uid: str) -> str: | 493 | def get_student_name(self, uid: str) -> str: |
| 502 | '''Get the username''' | 494 | '''Get the username''' |
| 503 | return self.online[uid].get('name', '') | 495 | return self.online[uid].get('name', '') |
aprendizations/serve.py
| @@ -18,7 +18,7 @@ import uuid | @@ -18,7 +18,7 @@ import uuid | ||
| 18 | import tornado.httpserver | 18 | import tornado.httpserver |
| 19 | import tornado.ioloop | 19 | import tornado.ioloop |
| 20 | import tornado.web | 20 | import tornado.web |
| 21 | -from tornado.escape import to_unicode, utf8 | 21 | +from tornado.escape import to_unicode |
| 22 | 22 | ||
| 23 | # this project | 23 | # this project |
| 24 | from aprendizations.renderer_markdown import md_to_html | 24 | from aprendizations.renderer_markdown import md_to_html |
| @@ -122,7 +122,6 @@ class CoursesHandler(BaseHandler): | @@ -122,7 +122,6 @@ class CoursesHandler(BaseHandler): | ||
| 122 | '''Render available courses''' | 122 | '''Render available courses''' |
| 123 | uid = self.current_user | 123 | uid = self.current_user |
| 124 | self.render('courses.html', | 124 | self.render('courses.html', |
| 125 | - appname=APP_NAME, | ||
| 126 | uid=uid, | 125 | uid=uid, |
| 127 | name=self.app.get_student_name(uid), | 126 | name=self.app.get_student_name(uid), |
| 128 | courses=self.app.get_courses(), | 127 | courses=self.app.get_courses(), |
| @@ -150,7 +149,6 @@ class CourseHandler2(BaseHandler): | @@ -150,7 +149,6 @@ class CourseHandler2(BaseHandler): | ||
| 150 | self.redirect('/courses') | 149 | self.redirect('/courses') |
| 151 | 150 | ||
| 152 | self.render('maintopics-table2.html', | 151 | self.render('maintopics-table2.html', |
| 153 | - appname=APP_NAME, | ||
| 154 | uid=uid, | 152 | uid=uid, |
| 155 | name=self.app.get_student_name(uid), | 153 | name=self.app.get_student_name(uid), |
| 156 | state=self.app.get_student_state(uid), | 154 | state=self.app.get_student_state(uid), |
| @@ -213,7 +211,6 @@ class TopicHandler(BaseHandler): | @@ -213,7 +211,6 @@ class TopicHandler(BaseHandler): | ||
| 213 | self.redirect('/topics') | 211 | self.redirect('/topics') |
| 214 | 212 | ||
| 215 | self.render('topic.html', | 213 | self.render('topic.html', |
| 216 | - appname=APP_NAME, | ||
| 217 | uid=uid, | 214 | uid=uid, |
| 218 | name=self.app.get_student_name(uid), | 215 | name=self.app.get_student_name(uid), |
| 219 | course_id=self.app.get_current_course_id(uid), | 216 | course_id=self.app.get_current_course_id(uid), |
| @@ -407,7 +404,6 @@ class RankingsHandler(BaseHandler): | @@ -407,7 +404,6 @@ class RankingsHandler(BaseHandler): | ||
| 407 | course_id = self.get_query_argument('course', default=current_course) | 404 | course_id = self.get_query_argument('course', default=current_course) |
| 408 | rankings = self.app.get_rankings(uid, course_id) | 405 | rankings = self.app.get_rankings(uid, course_id) |
| 409 | self.render('rankings.html', | 406 | self.render('rankings.html', |
| 410 | - appname=APP_NAME, | ||
| 411 | uid=uid, | 407 | uid=uid, |
| 412 | name=self.app.get_student_name(uid), | 408 | name=self.app.get_student_name(uid), |
| 413 | rankings=rankings, | 409 | rankings=rankings, |
aprendizations/templates/courses.html
aprendizations/templates/login.html
| @@ -3,7 +3,8 @@ | @@ -3,7 +3,8 @@ | ||
| 3 | <head> | 3 | <head> |
| 4 | <meta charset="utf-8" /> | 4 | <meta charset="utf-8" /> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | 5 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 6 | - <meta name="author" content="Miguel Barão"> | 6 | + <meta name="author" content="Miguel Barão" /> |
| 7 | + <link rel="icon" href="favicon.ico"> | ||
| 7 | 8 | ||
| 8 | {% include include-libs.html %} | 9 | {% include include-libs.html %} |
| 9 | 10 |
aprendizations/templates/maintopics-table.html
| @@ -5,8 +5,8 @@ | @@ -5,8 +5,8 @@ | ||
| 5 | <head> | 5 | <head> |
| 6 | <meta charset="utf-8" /> | 6 | <meta charset="utf-8" /> |
| 7 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | 7 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 8 | - <meta name="author" content="Miguel Barão"> | ||
| 9 | - <link rel="icon" href="/static/favicon.ico"> | 8 | + <meta name="author" content="Miguel Barão" /> |
| 9 | + <link rel="icon" href="favicon.ico"> | ||
| 10 | 10 | ||
| 11 | {% include include-libs.html %} | 11 | {% include include-libs.html %} |
| 12 | 12 |
aprendizations/templates/rankings.html
| @@ -5,15 +5,15 @@ | @@ -5,15 +5,15 @@ | ||
| 5 | <head> | 5 | <head> |
| 6 | <meta charset="utf-8" /> | 6 | <meta charset="utf-8" /> |
| 7 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | 7 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 8 | - <meta name="author" content="Miguel Barão"> | ||
| 9 | - <link rel="icon" href="/static/favicon.ico"> | 8 | + <meta name="author" content="Miguel Barão" /> |
| 9 | + <link rel="icon" href="favicon.ico"> | ||
| 10 | 10 | ||
| 11 | {% include include-libs.html %} | 11 | {% include include-libs.html %} |
| 12 | 12 | ||
| 13 | <link rel="stylesheet" href="{{static_url('css/maintopics.css')}}"> | 13 | <link rel="stylesheet" href="{{static_url('css/maintopics.css')}}"> |
| 14 | <script defer src="{{static_url('js/maintopics.js')}}"></script> | 14 | <script defer src="{{static_url('js/maintopics.js')}}"></script> |
| 15 | 15 | ||
| 16 | - <title>{{appname}}</title> | 16 | + <title>aprendizations</title> |
| 17 | </head> | 17 | </head> |
| 18 | <!-- ===================================================================== --> | 18 | <!-- ===================================================================== --> |
| 19 | <body> | 19 | <body> |
aprendizations/templates/topic.html
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | <meta charset="utf-8" /> | 4 | <meta charset="utf-8" /> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | 5 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 6 | <meta name="author" content="Miguel Barão" /> | 6 | <meta name="author" content="Miguel Barão" /> |
| 7 | - <link rel="icon" href="/static/favicon.ico"> | 7 | + <link rel="icon" href="favicon.ico"> |
| 8 | 8 | ||
| 9 | {% include include-libs.html %} | 9 | {% include include-libs.html %} |
| 10 | 10 | ||
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | <link rel="stylesheet" href="{{static_url('css/topic.css')}}" /> | 13 | <link rel="stylesheet" href="{{static_url('css/topic.css')}}" /> |
| 14 | <script defer src="{{static_url('js/topic.js')}}"></script> | 14 | <script defer src="{{static_url('js/topic.js')}}"></script> |
| 15 | 15 | ||
| 16 | - <title>{{appname}}</title> | 16 | + <title>aprendizations</title> |
| 17 | </head> | 17 | </head> |
| 18 | <!-- ===================================================================== --> | 18 | <!-- ===================================================================== --> |
| 19 | <body> | 19 | <body> |