From c22eb0f08182b88fcf9e8e45685e95c5f93b1845 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 20 Sep 2016 11:23:59 +0100 Subject: [PATCH] Reorganise templates for API keys page This adds another layer of folder structure to the templates to match the new URLs, which have another layer of hierarchy. --- app/main/views/api_keys.py | 8 ++++---- app/templates/views/{api-keys.html => api/keys.html} | 0 app/templates/views/{api-keys => api/keys}/create.html | 0 app/templates/views/{api-keys => api/keys}/revoke.html | 0 app/templates/views/{api-keys => api/keys}/show.html | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename app/templates/views/{api-keys.html => api/keys.html} (100%) rename app/templates/views/{api-keys => api/keys}/create.html (100%) rename app/templates/views/{api-keys => api/keys}/revoke.html (100%) rename app/templates/views/{api-keys => api/keys}/show.html (100%) diff --git a/app/main/views/api_keys.py b/app/main/views/api_keys.py index e4ed63c14..577b73e39 100644 --- a/app/main/views/api_keys.py +++ b/app/main/views/api_keys.py @@ -12,7 +12,7 @@ from app.notify_client.api_key_api_client import KEY_TYPE_NORMAL, KEY_TYPE_TEST, @user_has_permissions('manage_api_keys') def api_keys(service_id): return render_template( - 'views/api-keys.html', + 'views/api/keys.html', keys=api_key_api_client.get_api_keys(service_id=service_id)['apiKeys'] ) @@ -38,10 +38,10 @@ def create_api_key(service_id): key_name=form.key_name.data, key_type=form.key_type.data ) - return render_template('views/api-keys/show.html', secret=secret, + return render_template('views/api/keys/show.html', secret=secret, key_name=form.key_name.data) return render_template( - 'views/api-keys/create.html', + 'views/api/keys/create.html', form=form ) @@ -53,7 +53,7 @@ def revoke_api_key(service_id, key_id): key_name = api_key_api_client.get_api_keys(service_id=service_id, key_id=key_id)['apiKeys'][0]['name'] if request.method == 'GET': return render_template( - 'views/api-keys/revoke.html', + 'views/api/keys/revoke.html', key_name=key_name ) elif request.method == 'POST': diff --git a/app/templates/views/api-keys.html b/app/templates/views/api/keys.html similarity index 100% rename from app/templates/views/api-keys.html rename to app/templates/views/api/keys.html diff --git a/app/templates/views/api-keys/create.html b/app/templates/views/api/keys/create.html similarity index 100% rename from app/templates/views/api-keys/create.html rename to app/templates/views/api/keys/create.html diff --git a/app/templates/views/api-keys/revoke.html b/app/templates/views/api/keys/revoke.html similarity index 100% rename from app/templates/views/api-keys/revoke.html rename to app/templates/views/api/keys/revoke.html diff --git a/app/templates/views/api-keys/show.html b/app/templates/views/api/keys/show.html similarity index 100% rename from app/templates/views/api-keys/show.html rename to app/templates/views/api/keys/show.html