diff --git a/src/test/unit/web_interface/test_app_add_comment.py b/src/test/unit/web_interface/test_app_add_comment.py index f0b49e0af..c4deaa8f3 100644 --- a/src/test/unit/web_interface/test_app_add_comment.py +++ b/src/test/unit/web_interface/test_app_add_comment.py @@ -11,15 +11,6 @@ def add_comment_to_object(_, comment, author, time): @pytest.mark.WebInterfaceUnitTestConfig(database_mock_class=DbMock) class TestAppAddComment: - def test_app_add_comment_get_not_in_db(self, test_client): - rv = test_client.get('/comment/abc_123') - assert b'Error: UID not found in database' in rv.data - - def test_app_add_comment_get_valid_uid(self, test_client): - rv = test_client.get(f'/comment/{TEST_FW.uid}') - assert b'Error: UID not found in database' not in rv.data - assert b'Add Comment' in rv.data - def test_app_add_comment_put(self, test_client): data = {'comment': 'this is the test comment', 'author': 'test author'} rv = test_client.post( diff --git a/src/web_interface/components/miscellaneous_routes.py b/src/web_interface/components/miscellaneous_routes.py index d552b5bf6..cffa21b08 100644 --- a/src/web_interface/components/miscellaneous_routes.py +++ b/src/web_interface/components/miscellaneous_routes.py @@ -57,12 +57,6 @@ def post_comment(self, uid): self.db.editing.add_comment_to_object(uid, comment, author, round(time())) return redirect(url_for('show_analysis', uid=uid)) - @roles_accepted(*PRIVILEGES['comment']) - @AppRoute('/comment/', GET) - def show_add_comment(self, uid): - error = not self.db.frontend.exists(uid) - return render_template('add_comment.html', uid=uid, error=error) - @roles_accepted(*PRIVILEGES['delete']) @AppRoute('/admin/delete_comment//', GET) def delete_comment(self, uid, timestamp): diff --git a/src/web_interface/templates/add_comment.html b/src/web_interface/templates/add_comment.html deleted file mode 100644 index d96886b42..000000000 --- a/src/web_interface/templates/add_comment.html +++ /dev/null @@ -1,68 +0,0 @@ -{% extends "base.html" %} - -{% set active_page = "Database" %} - - -{% block body %} - - -
-
- -

Add Comment

-
for {{ uid | replace_uid_with_hid_link | safe }}
- {% if error %} -

Error: UID not found in database

- {% endif %} -
-
- -
-
-
- -
- -
- -
-
- -
- -
- -
-
- - {% if current_user.is_authenticated %} - - {% endif %} - -
-
- -
-
- -
-
-

Please note: it will take some time before the comment is saved and will show up on the page. Please try reloading the analysis page after a short while.

-
-
- -
- -
-
-{% endblock %} diff --git a/src/web_interface/templates/show_analysis.html b/src/web_interface/templates/show_analysis.html index 8e295d20b..c8b245fa4 100644 --- a/src/web_interface/templates/show_analysis.html +++ b/src/web_interface/templates/show_analysis.html @@ -381,11 +381,11 @@ Comments {# Add Comment Button #} -
- -
+ {# Show Comments Button #}
@@ -397,6 +397,45 @@ + + + +
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ + {% if current_user.is_authenticated %} + + {% endif %} + +
+
+ +
+ + + {% if firmware.comments %}