From ae3c092238a38bfd116d140e5157febe419d75d8 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 13 Mar 2019 16:49:30 +0100 Subject: [PATCH] add user settings for Sources --- passbook/core/models.py | 6 +++ passbook/core/templates/overview/base.html | 2 +- passbook/core/templates/user/base.html | 10 ++++ .../templatetags/passbook_user_settings.py | 16 +++++- passbook/oauth_client/models.py | 12 ++++- .../templates/account/dyn_extra/10_pre.html | 6 --- .../account/dyn_extra/11_facebook.html | 6 --- .../account/dyn_extra/12_twitter.html | 6 --- .../account/dyn_extra/13_google.html | 7 --- .../account/dyn_extra/15_github.html | 6 --- .../account/dyn_extra/16_discord.html | 7 --- .../account/dyn_extra/17_reddit.html | 7 --- .../templates/account/dyn_extra/19_post.html | 6 --- .../mod/auth/oauth/client/settings.html | 54 ------------------- .../templates/oauth_client/user.html | 18 +++++++ passbook/oauth_client/urls.py | 4 +- passbook/oauth_client/views/user.py | 20 +++++++ 17 files changed, 84 insertions(+), 109 deletions(-) delete mode 100644 passbook/oauth_client/templates/account/dyn_extra/10_pre.html delete mode 100644 passbook/oauth_client/templates/account/dyn_extra/11_facebook.html delete mode 100644 passbook/oauth_client/templates/account/dyn_extra/12_twitter.html delete mode 100644 passbook/oauth_client/templates/account/dyn_extra/13_google.html delete mode 100644 passbook/oauth_client/templates/account/dyn_extra/15_github.html delete mode 100644 passbook/oauth_client/templates/account/dyn_extra/16_discord.html delete mode 100644 passbook/oauth_client/templates/account/dyn_extra/17_reddit.html delete mode 100644 passbook/oauth_client/templates/account/dyn_extra/19_post.html delete mode 100644 passbook/oauth_client/templates/mod/auth/oauth/client/settings.html create mode 100644 passbook/oauth_client/templates/oauth_client/user.html create mode 100644 passbook/oauth_client/views/user.py diff --git a/passbook/core/models.py b/passbook/core/models.py index c9c9ad7ac..41ab18e3d 100644 --- a/passbook/core/models.py +++ b/passbook/core/models.py @@ -186,6 +186,12 @@ class Source(PolicyModel): """Return additional Info, such as a callback URL. Show in the administration interface.""" return None + def has_user_settings(self): + """Entrypoint to integrate with User settings. Can either return False if no + user settings are available, or a tuple or string, string, string where the first string + is the name the item has, the second string is the icon and the third is the view-name.""" + return False + def __str__(self): return self.name diff --git a/passbook/core/templates/overview/base.html b/passbook/core/templates/overview/base.html index 07aed11a0..973f5c136 100644 --- a/passbook/core/templates/overview/base.html +++ b/passbook/core/templates/overview/base.html @@ -26,7 +26,7 @@