From a02a58a8db5ad220c1671c960df0279081fec0e7 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Mon, 20 Jun 2022 12:22:29 +0100 Subject: [PATCH] Editor styling --- ref-test/app/__init__.py | 4 +- ref-test/app/editor/static/css/editor.css | 46 +++ .../app/editor/templates/editor/index.html | 266 +++++++++--------- 3 files changed, 178 insertions(+), 138 deletions(-) create mode 100644 ref-test/app/editor/static/css/editor.css diff --git a/ref-test/app/__init__.py b/ref-test/app/__init__.py index 60c082d..a2cb575 100644 --- a/ref-test/app/__init__.py +++ b/ref-test/app/__init__.py @@ -31,7 +31,7 @@ def create_app(): def _check_cookie_consent(): if request.cookies.get('cookie_consent'): return - if any([ request.path.startswith(x) for x in [ '/admin/static/', '/root/', '/quiz/static', '/cookies/' ] ]): + if any([ request.path.startswith(x) for x in [ '/admin/static/', '/root/', '/quiz/static', '/cookies/', '/admin/editor/static' ] ]): return flash(f'Cookie Consent: This web site only stores minimal, functional cookies. It does not store any tracking information. By using this site, you consent to this use of cookies. For more information, see our privacy policy.', 'cookie_alert') @@ -46,11 +46,13 @@ def create_app(): from .api.views import api from .quiz.views import quiz from .views import views + from .editor.views import editor app.register_blueprint(admin, url_prefix='/admin') app.register_blueprint(api, url_prefix='/api') app.register_blueprint(views) app.register_blueprint(quiz) + app.register_blueprint(editor, url_prefix='/admin/editor') install_app(app) diff --git a/ref-test/app/editor/static/css/editor.css b/ref-test/app/editor/static/css/editor.css new file mode 100644 index 0000000..eee5d22 --- /dev/null +++ b/ref-test/app/editor/static/css/editor.css @@ -0,0 +1,46 @@ +.accordion-button { + color: inherit; + background-color: inherit; + display: block; + border: 1px solid rgb(0 0 0 / .3); + height: 60px; +} + +.editor-controls { + width: fit-content; + display: block; + margin: 10px auto; +} + +.editor-controls a { + margin: 0 10px; + z-index: 10; +} + +.accordion-button div { + margin: 0; + position: absolute; + top: 50%; + transform: translate(0, -50%); +} + +.accordion-button a { + transform: translate(-50%, -50%); + top: 50%; + right: 0%; + position: absolute; +} + +.accordion-button::after { + content: none; +} + +.accordion-error { + background-color: #bb2d3b; + color: white; +} + +.accordion-error:not(.collapsed) { + background-color: #bb2d3b; + color: white; +} \ No newline at end of file diff --git a/ref-test/app/editor/templates/editor/index.html b/ref-test/app/editor/templates/editor/index.html index cf55228..8fed972 100644 --- a/ref-test/app/editor/templates/editor/index.html +++ b/ref-test/app/editor/templates/editor/index.html @@ -1,148 +1,140 @@ {% extends "editor/components/base.html" %} +{% block style %} + +{% endblock %} + {% block content %} -

Dashboard

-
-
-
-
-
-
Current Exams
- {% if current_tests %} -
- - - - - - - - - {% for test in current_tests %} - - - - - {% endfor %} - -
- Exam Code - - Expiry Date -
- {{ test.get_code() }} - - {{ test.end_date.strftime('%d %b %Y') }} -
-
- View Exams - {% else %} -
- There are currently no active exams. -
- Create Exam - {% endif %} +

Editor

+
+
+
+

+ -

+ +
+
+
+
+ Question 1 + +
+
+ Question Type + +
+ +
    +
    + 0 + +
    +
    + 1 + +
    +
+
+ Cancel + Done +
+
+ Correct + +
+
+ Tags + +
+
+
+
-
-
-
-
Recent Results
- {% if recent_results %} -
- - - - - - - - - - {% for result in recent_results %} - - - - - - {% endfor %} - -
- Name - - Date Submitted - - Result -
- {{ result.get_surname() }}, {{ result.get_first_name() }} - - {{ result.end_time.strftime('%d %b %Y %H:%M') }} - - {{ (100*result.result['score']/result.result['max'])|round|int }}% ({{ result.result.grade }}) -
-
- View Results - {% else %} -
- There are currently no exam results to preview. -
- {% endif %} +
+

+ -

+ +
+
+
+
+

+ +

+
+
+
+
+ Question 1 + +
+
+ Question Type + +
+ +
    +
    + 0 + +
    +
    + 1 + +
    +
+
+ Cancel + Done +
+
+ Correct + +
+
+ Tags + +
+
+
+
+
+
+
+
-
-
-
-
-
Upcoming Exams
- {% if upcoming_tests %} -
- - - - - - - - - {% for test in upcoming_tests %} - - - - - {% endfor %} - -
- Exam Code - - Expiry Date -
- {{ test.get_code() }} - - {{ test.end_date.strftime('%d %b %Y') }} -
-
- View Exams - {% else %} -
- There are currently no upcoming exams. -
- Create Exam - {% endif %} -
-
-
-
-
-
-
Help
-

This web app was developed by Vivek Santayana. If there are any issues with the app, any bugs you need to report, or any features you would like to request, please feel free to open an issue at the Git Repository.

- Open an Issue -
-
-
+ {% include "editor/components/client-alerts.html" %} +
+ Cancel + Done
+{% endblock %} + +{% block script %} + {% endblock %} \ No newline at end of file