From 23fa8e458c4cd308b57750554d84792ccc114d24 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 28 2018 12:54:52 +0000 Subject: Hide expired API keys by default but add a button to show them Fixes https://pagure.io/pagure/issue/3687 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/static/pagure.css b/pagure/static/pagure.css index 025b390..621db34 100644 --- a/pagure/static/pagure.css +++ b/pagure/static/pagure.css @@ -242,7 +242,7 @@ th[data-sort] { margin-left:2em; } -.hidden, .milestone_inactive{ +.hidden, .milestone_inactive, .expired_api_keys{ display: none; } @@ -338,4 +338,4 @@ th[data-sort] { .line-height-1{ line-height: 1em; -} \ No newline at end of file +} diff --git a/pagure/templates/settings.html b/pagure/templates/settings.html index 4bdb9ac..45e772f 100644 --- a/pagure/templates/settings.html +++ b/pagure/templates/settings.html @@ -1309,6 +1309,17 @@ $('.milestone_order_bottom').click(function(e) { } }); +$('#show_old_keys').click(function(e) { + var _el = $('.expired_api_keys') + if (_el.css('display') == 'none'){ + _el.css('display', 'flex'); + $('#show_old_keys').text('Hide old API keys'); + } else { + $('#show_old_keys').text('Show old API keys'); + _el.hide(); + } +}); + {% if config.get('ENABLE_GIVE_PROJECTS', True) and repo.user.user == g.fas_user.username and not repo.is_fork %} diff --git a/pagure/templates/settings_api_keys.html b/pagure/templates/settings_api_keys.html index 470a63b..c78f1c5 100644 --- a/pagure/templates/settings_api_keys.html +++ b/pagure/templates/settings_api_keys.html @@ -1,17 +1,29 @@ -

- API Keys - - -

+ + + + +

@@ -33,7 +45,7 @@ {% if repo.tokens %} {% for token in repo.tokens %} {% if token.user.username == g.fas_user.username %} -

+