From 3ccaba6da83e553bdf456d3b8742bc1737782502 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 28 2018 12:54:52 +0000 Subject: Move the api keys settings into their own template Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/settings.html b/pagure/templates/settings.html index 33925c5..4bdb9ac 100644 --- a/pagure/templates/settings.html +++ b/pagure/templates/settings.html @@ -208,134 +208,7 @@ {% endif %}
-

- API Keys - - - -

-
-
-

- API keys are tokens used to authenticate you on pagure. They can also - be used to grant access to 3rd party application to behave on this - project on your name. -

-

- These are your personal tokens; they are not visible to the other - admins of this repository. -

-

- These keys are valid for 60 days. -

-

- These keys are private to your project, make sure to store in a safe - place and do not share it. -

- {% if repo.tokens %} - {% for token in repo.tokens %} - {% if token.user.username == g.fas_user.username %} -
-
-
- - - {{ token.description or '' }} - -
-
- - - {{token.acls_list_pretty|length}} ACLs - - - -
- - - - {% if token.expired %} - - - Expired on {{ token.expiration.date() }} - - - {% else %} - - - Active until {{ token.expiration.date() }} - - - {% endif %} - {% if not token.expired %} -
- - {{ form.csrf_token }} -
- {% else %} -
- - {{ form.csrf_token }} -
- {% endif %} -
-
- {% endif %} - {% endfor %} - {% endif %} -
-
+ {% include 'settings_api_keys.html' %}
diff --git a/pagure/templates/settings_api_keys.html b/pagure/templates/settings_api_keys.html new file mode 100644 index 0000000..470a63b --- /dev/null +++ b/pagure/templates/settings_api_keys.html @@ -0,0 +1,128 @@ + +

+ API Keys + + + +

+
+
+

+ API keys are tokens used to authenticate you on pagure. They can also + be used to grant access to 3rd party application to behave on this + project on your name. +

+

+ These are your personal tokens; they are not visible to the other + admins of this repository. +

+

+ These keys are valid for 60 days. +

+

+ These keys are private to your project, make sure to store in a safe + place and do not share it. +

+ {% if repo.tokens %} + {% for token in repo.tokens %} + {% if token.user.username == g.fas_user.username %} +
+
+
+ + + {{ token.description or '' }} + +
+
+ + + {{token.acls_list_pretty|length}} ACLs + + + +
+ + + {% if token.expired %} + + + Expired on {{ token.expiration.date() }} + + + {% else %} + + + Active until {{ token.expiration.date() }} + + + {% endif %} + {% if not token.expired %} +
+ + {{ form.csrf_token }} +
+ {% else %} +
+ + {{ form.csrf_token }} +
+ {% endif %} +
+
+ {% endif %} + {% endfor %} + {% endif %} +
+