From 8d983ba698df1915265bb719c104b91d9f84eceb Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 25 May 2023 06:04:45 +0300 Subject: Rework UI. Set resource publicly viewable by default. Reorganise the UI for resource creation. Add a checkbox that sets the resource as publicly viewable by default. --- wqflask/wqflask/oauth2/resources.py | 4 +- .../wqflask/templates/oauth2/create-resource.html | 79 +++++++++++++--------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/wqflask/wqflask/oauth2/resources.py b/wqflask/wqflask/oauth2/resources.py index ed419076..5f7faff9 100644 --- a/wqflask/wqflask/oauth2/resources.py +++ b/wqflask/wqflask/oauth2/resources.py @@ -1,6 +1,7 @@ import uuid -from flask import flash, request, url_for, redirect, Response, Blueprint +from flask import ( + flash, request, jsonify, url_for, redirect, Response, Blueprint) from .ui import render_ui from .checks import require_oauth2 @@ -38,7 +39,6 @@ def create_resource(): error, "Could not retrieve resource categories")), lambda cats: __render_template__(categories=cats)) - from flask import jsonify def __perr__(error): err = process_error(error) flash(f"{err['error']}: {err['error_description']}", "alert-danger") diff --git a/wqflask/wqflask/templates/oauth2/create-resource.html b/wqflask/wqflask/templates/oauth2/create-resource.html index 4cac7ce2..479f4152 100644 --- a/wqflask/wqflask/templates/oauth2/create-resource.html +++ b/wqflask/wqflask/templates/oauth2/create-resource.html @@ -25,41 +25,58 @@