From 29f0d02327c1c81b1f90793147ee13b6a20846f3 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 20:54:19 +0800 Subject: [PATCH 01/13] app/main.py: bootstrap elements. --- app/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index b13df3e..2d0237f 100644 --- a/app/main.py +++ b/app/main.py @@ -110,7 +110,7 @@ def get_today_article(user_word_list, articleID): d = reading break - s = '

According to your word list, your level is %4.2f and we have chosen an article with a difficulty level of %4.2f for you.

' % (user_level, text_level) + s = '

According to your word list, your level is %4.2f and we have chosen an article with a difficulty level of %4.2f for you.

' % (user_level, text_level) s += '

%s

' % (d['date']) s += '

%s

' % (d['text']) s += '

%s

' % (d['source']) @@ -336,6 +336,7 @@ def userpage(username): page = '\n' page += '\n' page += '\n' # forbid treating numbers as cell numbers in smart phones + page += '' page += 'EnglishPal Study Room for %s' % (username) page += '

English Pal for %s 登出

' % (username) page += '

下一篇

' % (username) @@ -393,6 +394,7 @@ def userpage(username): page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) elif isinstance(d[word], int): # d[word] is a frequency. to migrate from old format. page += '%s%d\n' % (youdao_link(word), word, freq) + page += '' return page ### Sign-up, login, logout ### From adfc2796dac1b6b1b5d9d7d26a91e3a00174b341 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 20:59:08 +0800 Subject: [PATCH 02/13] app/main.py: use a different color for badge. --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 2d0237f..6049ba6 100644 --- a/app/main.py +++ b/app/main.py @@ -110,7 +110,7 @@ def get_today_article(user_word_list, articleID): d = reading break - s = '

According to your word list, your level is %4.2f and we have chosen an article with a difficulty level of %4.2f for you.

' % (user_level, text_level) + s = '

According to your word list, your level is %4.2f and we have chosen an article with a difficulty level of %4.2f for you.

' % (user_level, text_level) s += '

%s

' % (d['date']) s += '

%s

' % (d['text']) s += '

%s

' % (d['source']) From 1936d2aec5327c1e8ea30c0eaa46f47e0e9fec4f Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:02:17 +0800 Subject: [PATCH 03/13] app/main.py: use alert while showing vocabulary level. --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 6049ba6..2f8822a 100644 --- a/app/main.py +++ b/app/main.py @@ -110,7 +110,7 @@ def get_today_article(user_word_list, articleID): d = reading break - s = '

According to your word list, your level is %4.2f and we have chosen an article with a difficulty level of %4.2f for you.

' % (user_level, text_level) + s = '' % (user_level, text_level) s += '

%s

' % (d['date']) s += '

%s

' % (d['text']) s += '

%s

' % (d['source']) From e9c7d0fc00bd402c2a23d45f23c4848ffc61949a Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:03:57 +0800 Subject: [PATCH 04/13] app/main.py: use a green alert bar. --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 2f8822a..5ba9f9b 100644 --- a/app/main.py +++ b/app/main.py @@ -110,7 +110,7 @@ def get_today_article(user_word_list, articleID): d = reading break - s = '' % (user_level, text_level) + s = '' % (user_level, text_level) s += '

%s

' % (d['date']) s += '

%s

' % (d['text']) s += '

%s

' % (d['source']) From fbf054d1740849b34ad5a043edac9acad699edcf Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:10:27 +0800 Subject: [PATCH 05/13] =?UTF-8?q?app/main.py:=20move=20alert=20bar=20above?= =?UTF-8?q?=20=E9=98=85=E8=AF=BB=E6=96=87=E7=AB=A0=E5=B9=B6=E5=9B=9E?= =?UTF-8?q?=E7=AD=94=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 5ba9f9b..0cc0233 100644 --- a/app/main.py +++ b/app/main.py @@ -340,8 +340,8 @@ def userpage(username): page += 'EnglishPal Study Room for %s' % (username) page += '

English Pal for %s 登出

' % (username) page += '

下一篇

' % (username) - page += '

阅读文章并回答问题

\n' page += '
%s
' % (get_today_article(user_freq_record, session['articleID'])) + page += '

阅读文章并回答问题

\n' page += '

收集生词吧 (可以在正文中划词,也可以复制黏贴)

' page += '
' % (username) page += '
' From 22af30bc88817af38a4be0800d8fb3056c6b2819 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:12:04 +0800 Subject: [PATCH 06/13] =?UTF-8?q?app/main.py:=20move=20alert=20bar=20above?= =?UTF-8?q?=20=E9=98=85=E8=AF=BB=E6=96=87=E7=AB=A0=E5=B9=B6=E5=9B=9E?= =?UTF-8?q?=E7=AD=94=E9=97=AE=E9=A2=98=20(revision).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 0cc0233..188cd84 100644 --- a/app/main.py +++ b/app/main.py @@ -339,9 +339,9 @@ def userpage(username): page += '' page += 'EnglishPal Study Room for %s' % (username) page += '

English Pal for %s 登出

' % (username) + page += '

阅读文章并回答问题

\n' page += '

下一篇

' % (username) page += '
%s
' % (get_today_article(user_freq_record, session['articleID'])) - page += '

阅读文章并回答问题

\n' page += '

收集生词吧 (可以在正文中划词,也可以复制黏贴)

' page += '' % (username) page += '
' From aad7f8016e3dd210eccc70ca9e58de47838cbc45 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:16:38 +0800 Subject: [PATCH 07/13] app/main.py: change link to button. --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 188cd84..eb9d1e2 100644 --- a/app/main.py +++ b/app/main.py @@ -340,7 +340,7 @@ def userpage(username): page += 'EnglishPal Study Room for %s' % (username) page += '

English Pal for %s 登出

' % (username) page += '

阅读文章并回答问题

\n' - page += '

下一篇

' % (username) + page += '

下一篇

' % (username) page += '
%s
' % (get_today_article(user_freq_record, session['articleID'])) page += '

收集生词吧 (可以在正文中划词,也可以复制黏贴)

' page += '' % (username) From 20386033bccab4266a2e9cab6136f44fc970ebca Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:18:35 +0800 Subject: [PATCH 08/13] app/main.py: green button may look better, more consistent. --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index eb9d1e2..efd0f2c 100644 --- a/app/main.py +++ b/app/main.py @@ -340,7 +340,7 @@ def userpage(username): page += 'EnglishPal Study Room for %s' % (username) page += '

English Pal for %s 登出

' % (username) page += '

阅读文章并回答问题

\n' - page += '

下一篇

' % (username) + page += '

下一篇

' % (username) page += '
%s
' % (get_today_article(user_freq_record, session['articleID'])) page += '

收集生词吧 (可以在正文中划词,也可以复制黏贴)

' page += '' % (username) From bef218953be33d83dfe80371d3aae779355afdd8 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:22:09 +0800 Subject: [PATCH 09/13] app/main.py: adjust badge color. --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index efd0f2c..2e9e7f7 100644 --- a/app/main.py +++ b/app/main.py @@ -110,7 +110,7 @@ def get_today_article(user_word_list, articleID): d = reading break - s = '' % (user_level, text_level) + s = '' % (user_level, text_level) s += '

%s

' % (d['date']) s += '

%s

' % (d['text']) s += '

%s

' % (d['source']) From 61a848e7d4bf7d6d6588021e71345d5a597c1446 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:30:19 +0800 Subject: [PATCH 10/13] app/main.py: use alert for total number of articles. --- app/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 2e9e7f7..db06ced 100644 --- a/app/main.py +++ b/app/main.py @@ -230,6 +230,8 @@ def mainpage(): + + EnglishPal 英文单词高效记 @@ -242,7 +244,7 @@ def mainpage(): page += '

登录 成为会员 使用说明

\n' #page += '

advertisement

' % (get_random_image(path_prefix + 'static/img/')) page += '

%s

' % (get_random_ads()) - page += '

共有文章%d篇' % (total_number_of_essays()) + page += '

' % (total_number_of_essays()) page += '

粘帖1篇文章 (English only)

' page += '' page += '
' @@ -257,6 +259,7 @@ def mainpage(): break page += '%s %d\n' % (youdao_link(x[0]), x[0], x[1]) + page += ' ' page += '' return page From e65b443f014a1708ad4860db3145dea57c8d27b4 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:41:55 +0800 Subject: [PATCH 11/13] app/main.py: use buttons instead of links for familiar, unfamiliar and delete. --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index db06ced..e6d50cb 100644 --- a/app/main.py +++ b/app/main.py @@ -392,7 +392,7 @@ def userpage(username): session['time'] = 0 # discard anchor if isinstance(d[word], list): # d[word] is a list of dates if freq > 1: - page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) + page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) else: page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) elif isinstance(d[word], int): # d[word] is a frequency. to migrate from old format. From c40f9b61a3952e28267cf5da42f60982c81cf914 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:43:42 +0800 Subject: [PATCH 12/13] app/main.py: use buttons instead of links for familiar, unfamiliar and delete (for all words). --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index e6d50cb..42b4397 100644 --- a/app/main.py +++ b/app/main.py @@ -394,7 +394,7 @@ def userpage(username): if freq > 1: page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) else: - page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) + page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) elif isinstance(d[word], int): # d[word] is a frequency. to migrate from old format. page += '%s%d\n' % (youdao_link(word), word, freq) page += '' From 58383a51ad3afc2ecd7b53224e0a4e759a2f6366 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Sat, 31 Jul 2021 21:51:48 +0800 Subject: [PATCH 13/13] app/main.py: use buttons for all words (strange?). --- app/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 42b4397..634338a 100644 --- a/app/main.py +++ b/app/main.py @@ -392,9 +392,9 @@ def userpage(username): session['time'] = 0 # discard anchor if isinstance(d[word], list): # d[word] is a list of dates if freq > 1: - page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) + page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) else: - page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) + page += '

%s(%d) 熟悉 不熟悉 删除

\n' % (youdao_link(word), word, '; '.join(d[word]), freq,username, word,username,word, username,word) elif isinstance(d[word], int): # d[word] is a frequency. to migrate from old format. page += '%s%d\n' % (youdao_link(word), word, freq) page += ''