From cbf7cda1d62862f1ad92e48555a93430f3bdf28e Mon Sep 17 00:00:00 2001 From: sanoussi Date: Wed, 15 Apr 2020 21:02:26 +0800 Subject: [PATCH 1/4] new_functionality_recentlyuploaded_files_is_added(barkay sanoussi sanoussi--201732120151 ahamed sabuj--201732120141 hossain arif--201732120157 agonza lewis conrad--201732120140) --- service.py | 5 +++ templates/recentlyuploaded.html | 54 +++++++++++++++++++++++++++++++++ templates/template.html | 3 ++ 3 files changed, 62 insertions(+) create mode 100644 templates/recentlyuploaded.html diff --git a/service.py b/service.py index ab2fdbb..ebcd9ca 100644 --- a/service.py +++ b/service.py @@ -687,6 +687,11 @@ def author(author_id): comments = Comment.query.order_by(Comment.time.desc()).filter_by(author_id=author_id).all() return render_template('author.html', articles=articles, comments=comments, Tool=Tool) +@app.route('/recent') +def example(): + articles = Article.query.order_by(Article.time).all() + return render_template("recentlyuploaded.html", articles=articles) + if __name__ == '__main__': app.run(debug=True) diff --git a/templates/recentlyuploaded.html b/templates/recentlyuploaded.html new file mode 100644 index 0000000..9dfb363 --- /dev/null +++ b/templates/recentlyuploaded.html @@ -0,0 +1,54 @@ +{% extends "template.html" %} + +{% block content %} + + {% if articles%} + + + + + + + + + + + + {% for article in articles %} + + + + + + + {% endfor %} + +
subjecttitleauthortimepopulation
{{ article.subject.name }}{{ article.title }}{{ article.time.strftime("%Y-%m-%d %H:%M") }}
+ + {% endif %} + + + {% if comments%} + + + + + + + + + + + {% for comment in comments %} + + + + + + + {% endfor %} + +
article_titlecommenttimeauthor
{{ comment.article.title }}{{ comment.time.strftime("%Y-%m-%d %H:%M") }}{{ Tool.email_display_filter(comment.author.mail) }}
+ {% endif %} + +{% endblock %} \ No newline at end of file diff --git a/templates/template.html b/templates/template.html index 662c63c..eaf01e6 100644 --- a/templates/template.html +++ b/templates/template.html @@ -49,6 +49,9 @@ + From 6eddf9c8bf47c4670f0e09e269253dd1b8f7c57f Mon Sep 17 00:00:00 2001 From: sanoussi Date: Sat, 18 Apr 2020 14:41:09 +0800 Subject: [PATCH 2/4] correction_new_functionality_recentlyuploaded_files_is_added(barkay sanoussi sanoussi--201732120151 ahamed sabuj--201732120141 hossain arif--201732120157 agonza lewis conrad--201732120140) --- service.py | 4 +-- templates/recentlyuploaded.html | 60 +++++++-------------------------- templates/template.html | 6 ++-- 3 files changed, 17 insertions(+), 53 deletions(-) diff --git a/service.py b/service.py index ebcd9ca..ebec19f 100644 --- a/service.py +++ b/service.py @@ -688,8 +688,8 @@ def author(author_id): return render_template('author.html', articles=articles, comments=comments, Tool=Tool) @app.route('/recent') -def example(): - articles = Article.query.order_by(Article.time).all() +def sort_articles(): + articles = Article.query.order_by(Article.time.desc()).all() return render_template("recentlyuploaded.html", articles=articles) if __name__ == '__main__': diff --git a/templates/recentlyuploaded.html b/templates/recentlyuploaded.html index 9dfb363..84b64ca 100644 --- a/templates/recentlyuploaded.html +++ b/templates/recentlyuploaded.html @@ -1,54 +1,18 @@ {% extends "template.html" %} - {% block content %} - {% if articles%} - - - - - - - - - - - {% for article in articles %} - - - - - - - {% endfor %} - -
subjecttitleauthortimepopulation
{{ article.subject.name }}{{ article.title }}{{ article.time.strftime("%Y-%m-%d %H:%M") }}
- + + subject + title + time + + {% for article in articles %} + {{ article.subject.name }} + {{ article.title }} + {{ article.time.strftime("%Y-%m-%d %H:%M") }} + + {% endfor %} + {% endif %} - - - {% if comments%} - - - - - - - - - - - {% for comment in comments %} - - - - - - - {% endfor %} - -
article_titlecommenttimeauthor
{{ comment.article.title }}{{ comment.time.strftime("%Y-%m-%d %H:%M") }}{{ Tool.email_display_filter(comment.author.mail) }}
- {% endif %} - {% endblock %} \ No newline at end of file diff --git a/templates/template.html b/templates/template.html index eaf01e6..6e5ea42 100644 --- a/templates/template.html +++ b/templates/template.html @@ -48,9 +48,9 @@ - +