From 3a0810adc919d82352fb8b877f9be9c7262d82f9 Mon Sep 17 00:00:00 2001 From: Daniel Muckerman Date: Sun, 1 Nov 2020 11:54:38 -0500 Subject: [PATCH] More CSS overhaul --- app.py | 18 ++++++++++++++- pocket/readitlater.db | Bin 188416 -> 188416 bytes static/style.css | 30 +++++++++++++++++++++++++ templates/article.j2 | 36 +++++++++++++++++++++++++----- templates/bookmarklet.j2 | 5 +++++ templates/fragments/cell.j2 | 40 ++++++++++++++++++++++++++++++++++ templates/fragments/navbar.j2 | 36 +++++++++++++++++++++++++++--- templates/list.j2 | 16 +++++--------- 8 files changed, 162 insertions(+), 19 deletions(-) create mode 100644 templates/fragments/cell.j2 diff --git a/app.py b/app.py index 5dc7691..21790e7 100644 --- a/app.py +++ b/app.py @@ -131,7 +131,9 @@ def read_article(article_id): conn = sqlite3.connect('pocket/readitlater.db') c = conn.cursor() - c.execute("SELECT * FROM articles where id=?", (article_id,)) + # c.execute("SELECT * FROM articles where id=?", (article_id,)) + c.execute("SELECT articles.id, url, content, title, byline, read FROM articles INNER JOIN saved_articles on saved_articles.article_id = articles.id WHERE articles.id=?", (article_id, )) + rows = c.fetchall() conn.commit() conn.close() @@ -217,6 +219,20 @@ def archive_article(article_id): return redirect(url_for('index')) +@ldap.login_required +@app.route('/unarchive/') +def unarchive_article(article_id): + conn = sqlite3.connect('pocket/readitlater.db') + c = conn.cursor() + + c.execute("UPDATE saved_articles SET read=0 WHERE user=? AND article_id=?", (session['user_id'], article_id)) + + conn.commit() + conn.close() + + return redirect(url_for('archived')) + + @app.route('/logout') def logout(): session.pop('user_id', None) diff --git a/pocket/readitlater.db b/pocket/readitlater.db index 8715a7592c3654d5da6ee690b7c5ba42b6eff96e..750d3684166289b1380fdf4363a5f278e74fdf08 100644 GIT binary patch delta 292 zcmZoTz};|wdxA8t3j+g#9uSKIvFJn%b4Hhq2@CnT`QI?G^WOl9F(_>25jf2+1!9T` z0|{;+Ai*I3Bt-au1S`YlkMhC-GFl6u{HOSf_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V^85Xs7R4I6_Im+>7XZ znV<&XRX$-u-{%Hb#ZfT+9u`SoYKKDG9_6s$slW4{pRH7w;b>xv^!WVw4Dnk2?N;cZ;!j$dr0UjjF#4td$!&tu~s z(z%DE0w~+p4cHs85b}vte9&oN(gzv~*<1~k{p_iBHhRd@e&Qy6l1MNb4}^P-f3U8N z=l`=jIWjr$v}n5bsa@_e{0*q2&s1@5Op>B0p}_iOJWnW{UijkDtAYi3dQq~;Jx%p! zd15(49jB#mOUpU`)OP9F{YoE+iHwkBa$9r&A3eVT{a+c3itke!e4ko37N(Ux0>?z@ fV>&-K#|Hw(DnD9sI - \ No newline at end of file diff --git a/templates/list.j2 b/templates/list.j2 index d57357d..f4c6d7f 100644 --- a/templates/list.j2 +++ b/templates/list.j2 @@ -32,16 +32,7 @@
{% for article in articles|reverse %} -
- {{ article[2] }} - {{ article[3] }} -
- - Archive -      - Delete - -
+ {% include "fragments/cell.j2" %} {% endfor %}
@@ -56,4 +47,9 @@ {{ super() }} {# #} + {% endblock %} \ No newline at end of file