commit 06db3518cac83a68ba50fc46f4ae6f0e12f90612
parent 412325db64ae974bc748357565ce78c6c972498c
Author: parazyd <parazyd@dyne.org>
Date: Mon, 21 Jan 2019 22:16:57 +0100
Unify success_.html pages.
Diffstat:
6 files changed, 21 insertions(+), 70 deletions(-)
diff --git a/diaspora.py b/diaspora.py
@@ -215,7 +215,7 @@ def edit():
('abstract', request.form['Abstract']),
]
sql_update_row_where(vals, 'id', request.form['Id'])
- return render_template('success_edit.html')
+ return render_template('success.html', msg='Story redacted!')
@app.route('/view')
@@ -242,7 +242,8 @@ def delete():
if story_id:
story_id = story_id[0][0]
sql_delete_row_where('id', story_id)
- return render_template('success_delete.html')
+ return render_template('success.html',
+ msg="We're sorry you deleted your story.")
return render_template('fail.html',
msg='No story is linked to your delete key.')
@@ -317,12 +318,12 @@ def dashboard():
add_id = request.args.get('approveid')
if add_id:
sql_update_row_where([('visible', 1)], 'id', add_id)
- return render_template('success_approve.html')
+ return render_template('success.html', msg='Story approved!')
hide_id = request.args.get('hideid')
if hide_id:
sql_update_row_where([('visible', 0)], 'id', hide_id)
- return render_template('success_hide.html')
+ return render_template('success.html', msg='Story hidden.')
act = request.args.get('list', 'pending')
diff --git a/templates/success.html b/templates/success.html
@@ -0,0 +1,16 @@
+{% include 'header.html' %}
+
+ <title>Success | Diaspora Diaries</title>
+
+{% include 'nav.html' %}
+
+ <main role="main" class="container cover">
+
+ <h1 class="cover-heading">Success.</h1>
+ <hr>
+
+ <p class="lead">{{ msg }}</p>
+
+ </main>
+
+{% include 'footer.html' %}
diff --git a/templates/success_approve.html b/templates/success_approve.html
@@ -1,16 +0,0 @@
-{% include 'header.html' %}
-
- <title>Approved | Diaspora Diaries</title>
-
-{% include 'nav.html' %}
-
- <main role="main" class="container cover">
-
- <h1 class="cover-heading">Story approved!</h1>
- <hr>
-
- <p class="lead">You can return to the <a href="/dashboard?list=pending">dashboard</a> now.</p>
-
- </main>
-
-{% include 'footer.html' %}
diff --git a/templates/success_delete.html b/templates/success_delete.html
@@ -1,18 +0,0 @@
-{% include 'header.html' %}
-
- <title>Deleted | Diaspora Diaries</title>
-
-{% include 'nav.html' %}
-
- <main role="main" class="container cover">
-
- <h1 class="cover-heading">Story deleted!</h1>
- <hr>
-
- <p class="lead">We're sorry you deleted your story.</p>
-
- <p class="lead">You can return to the <a href="/">homepage</a> now.</p>
-
- </main>
-
-{% include 'footer.html' %}
diff --git a/templates/success_edit.html b/templates/success_edit.html
@@ -1,16 +0,0 @@
-{% include 'header.html' %}
-
- <title>Redacted | Diaspora Diaries</title>
-
-{% include 'nav.html' %}
-
- <main role="main" class="container cover">
-
- <h1 class="cover-heading">Story redacted!</h1>
- <hr>
-
- <p class="lead">You can return to the <a href="/dashboard">dashboard</a> now.</p>
-
- </main>
-
-{% include 'footer.html' %}
diff --git a/templates/success_hide.html b/templates/success_hide.html
@@ -1,16 +0,0 @@
-{% include 'header.html' %}
-
- <title>Hidden | Diaspora Diaries</title>
-
-{% include 'nav.html' %}
-
- <main role="main" class="container cover">
-
- <h1 class="cover-heading">Story hidden.</h1>
- <hr>
-
- <p class="lead">You can return to the <a href="/dashboard?list=published">dashboard</a> now.</p>
-
- </main>
-
-{% include 'footer.html' %}