From eae6ca6e07b59ccc72de88c1b2cc57945897c8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Sun, 3 Oct 2021 15:13:45 +0200 Subject: [PATCH] Merge API view with integrations view (#165) --- bookmarks/templates/settings/api.html | 25 ------------ .../templates/settings/integrations.html | 15 ++++++- bookmarks/templates/settings/nav.html | 4 -- bookmarks/tests/test_settings_api_view.py | 40 ------------------- .../tests/test_settings_integrations_view.py | 18 +++++++++ bookmarks/urls.py | 1 - bookmarks/views/settings.py | 8 +--- 7 files changed, 33 insertions(+), 78 deletions(-) delete mode 100644 bookmarks/templates/settings/api.html delete mode 100644 bookmarks/tests/test_settings_api_view.py diff --git a/bookmarks/templates/settings/api.html b/bookmarks/templates/settings/api.html deleted file mode 100644 index a36b892..0000000 --- a/bookmarks/templates/settings/api.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "bookmarks/layout.html" %} - -{% block content %} -
- - {% include 'settings/nav.html' %} - -
-

API Token

-

The following token can be used to authenticate 3rd-party applications against the REST API:

-
-
-
- -
-
-
-

Please treat this token as you would any other credential. Any party with access to this - token can access and manage all your bookmarks.

-

If you think that a token was compromised you can revoke (delete) it in the admin panel. After deleting the token, a new one will be generated when you reload this settings page.

-
- -
- -{% endblock %} diff --git a/bookmarks/templates/settings/integrations.html b/bookmarks/templates/settings/integrations.html index 5f9746a..42adcac 100644 --- a/bookmarks/templates/settings/integrations.html +++ b/bookmarks/templates/settings/integrations.html @@ -5,7 +5,6 @@ {% include 'settings/nav.html' %} - {# Integrations section #}

Browser Extension

The browser extension allows you to quickly add new bookmarks without leaving the page that you are on. The extension is available in the official extension stores for:

@@ -29,5 +28,19 @@ class="btn btn-primary">📎 Add bookmark
+
+

REST API

+

The following token can be used to authenticate 3rd-party applications against the REST API:

+
+
+
+ +
+
+
+

Please treat this token as you would any other credential. Any party with access to this + token can access and manage all your bookmarks.

+

If you think that a token was compromised you can revoke (delete) it in the admin panel. After deleting the token, a new one will be generated when you reload this settings page.

+
{% endblock %} diff --git a/bookmarks/templates/settings/nav.html b/bookmarks/templates/settings/nav.html index e26564b..3e394d2 100644 --- a/bookmarks/templates/settings/nav.html +++ b/bookmarks/templates/settings/nav.html @@ -1,7 +1,6 @@ {% url 'bookmarks:settings.index' as index_url %} {% url 'bookmarks:settings.general' as general_url %} {% url 'bookmarks:settings.integrations' as integrations_url %} -{% url 'bookmarks:settings.api' as api_url %}