[odrs-web] Add a delete button to the overview page



commit 9b0bb69dacb84b09ff741341de21cbfb5655b948
Author: Richard Hughes <richard hughsie com>
Date:   Wed Mar 16 15:32:03 2022 +0000

    Add a delete button to the overview page
    
    Based on https://gitlab.gnome.org/Infrastructure/odrs-web/-/merge_requests/12 -- thanks.

 app_data/odrs/templates/show-all.html | 8 ++++++--
 app_data/odrs/views_admin.py          | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/app_data/odrs/templates/show-all.html b/app_data/odrs/templates/show-all.html
index b2dde95..13d6ecb 100644
--- a/app_data/odrs/templates/show-all.html
+++ b/app_data/odrs/templates/show-all.html
@@ -36,9 +36,13 @@
 {% else %}
     <td><i>Unknown</i></td>
 {% endif %}
-    <td>{{format_truncate(r.summary, 30)}}</td>
     <td>
-      <a class="btn btn-info" href="{{url_for('.admin_show_review', review_id=r.review_id)}}">Details</a>
+      <p>{{format_truncate(r.summary, 30)}}</p>
+      <p>{{format_truncate(r.description, 30)}}</p>
+    </td>
+    <td>
+      <a class="btn btn-info btn-block" href="{{url_for('.admin_show_review', 
review_id=r.review_id)}}">Details</a>
+      <a class="btn btn-danger btn-block" href="{{url_for('.admin_delete_force', 
review_id=r.review_id)}}">Delete</a>
     </td>
   </tr>
 {% endfor %}
diff --git a/app_data/odrs/views_admin.py b/app_data/odrs/views_admin.py
index eabfd7d..e34d29e 100644
--- a/app_data/odrs/views_admin.py
+++ b/app_data/odrs/views_admin.py
@@ -400,7 +400,7 @@ def admin_delete_force(review_id):
     db.session.delete(review)
     db.session.commit()
     flash('Deleted review')
-    return redirect(url_for('.admin_show_all'))
+    return redirect(url_for('.odrs_show_reported'))
 
 @app.route('/admin/delete/<review_id>')
 @login_required


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]