From 779eb3697c0c2fb4f8825db12a7969d0fef6ca10 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 13 Aug 2022 20:35:25 +0100 Subject: [PATCH] Implement updating network registration --- app/urls.py | 11 +++ core/lib/manage/threshold.py | 17 ++++ .../manage/threshold/irc/network/actions.html | 81 ++++++++----------- .../irc/network/modals/registration.html | 47 +++++++++++ .../manage/threshold/irc/network/network.html | 2 + .../threshold/irc/overview/actions.html | 3 + core/views/manage/threshold/irc.py | 60 +++++++++++++- 7 files changed, 169 insertions(+), 52 deletions(-) create mode 100644 core/templates/manage/threshold/irc/network/modals/registration.html diff --git a/app/urls.py b/app/urls.py index d141095..60053c7 100644 --- a/app/urls.py +++ b/app/urls.py @@ -29,6 +29,7 @@ from core.views.manage.threshold.irc import ( from core.views.manage.threshold.irc import ( ThresholdIRCActions, ThresholdIRCActionsAddNetwork, + ThresholdIRCActionsRegistration, ThresholdIRCAliases, ThresholdIRCAliasesEdit, ThresholdIRCNetworkActions, @@ -131,6 +132,16 @@ urlpatterns = [ ThresholdIRCActionsAddNetwork.as_view(), name="threshold_irc_actions_add-network", ), + path( + "manage/threshold/irc/actions/registration//", + ThresholdIRCActionsRegistration.as_view(), + name="threshold_irc_actions_registration_net", + ), + path( + "manage/threshold/irc/actions/registration/", + ThresholdIRCActionsRegistration.as_view(), + name="threshold_irc_actions_registration", + ), path( "manage/threshold/irc/network//", ThresholdIRCNetwork.as_view(), diff --git a/core/lib/manage/threshold.py b/core/lib/manage/threshold.py index aadaf16..99d3303 100644 --- a/core/lib/manage/threshold.py +++ b/core/lib/manage/threshold.py @@ -217,3 +217,20 @@ def get_irc_list_info(net): payload = {} listinfo = threshold_request(url, payload, method="GET") return listinfo + + +def irc_get_unreg(net=None): + if net: + url = f"irc/reg/{net}" + else: + url = "irc/reg" + payload = {} + unreg = threshold_request(url, payload, method="GET") + return unreg + + +def irc_confirm_accounts(tokens): + url = "irc/reg" + payload = tokens + updated = threshold_request(url, payload, method="PUT") + return updated diff --git a/core/templates/manage/threshold/irc/network/actions.html b/core/templates/manage/threshold/irc/network/actions.html index 5d82e9e..685483e 100644 --- a/core/templates/manage/threshold/irc/network/actions.html +++ b/core/templates/manage/threshold/irc/network/actions.html @@ -29,6 +29,19 @@ Auto + -
-
-
-
-
- - - - -
-
- -
-
-
+
+
+
+ + + + +
+
+ +
-
- -
-
- - - - -
-
- -
-
- -
-
- +
\ No newline at end of file diff --git a/core/templates/manage/threshold/irc/network/modals/registration.html b/core/templates/manage/threshold/irc/network/modals/registration.html new file mode 100644 index 0000000..e27bf1f --- /dev/null +++ b/core/templates/manage/threshold/irc/network/modals/registration.html @@ -0,0 +1,47 @@ +{% load index %} +{% load static %} + + + + + + + + + + + diff --git a/core/templates/manage/threshold/irc/network/network.html b/core/templates/manage/threshold/irc/network/network.html index a3e2fb8..434ab5d 100644 --- a/core/templates/manage/threshold/irc/network/network.html +++ b/core/templates/manage/threshold/irc/network/network.html @@ -112,4 +112,6 @@ +
+
{% endblock %} diff --git a/core/templates/manage/threshold/irc/overview/actions.html b/core/templates/manage/threshold/irc/overview/actions.html index 1cc4e1c..d80ed21 100644 --- a/core/templates/manage/threshold/irc/overview/actions.html +++ b/core/templates/manage/threshold/irc/overview/actions.html @@ -30,6 +30,9 @@