From fd9f62319379e75f6e9001f0cb93c96ab4945907 Mon Sep 17 00:00:00 2001 From: crunk Date: Mon, 28 Mar 2022 18:33:48 +0200 Subject: [PATCH] downloadable public themes on index --- verse/start.py | 12 +++++++++++- verse/static/css/style.css | 3 +++ verse/templates/distribusiworkflow/editcss.html | 2 +- verse/templates/distribusiworkflow/theme.html | 2 +- verse/templates/index.html | 5 ++++- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/verse/start.py b/verse/start.py index 82d6346..3a4e063 100644 --- a/verse/start.py +++ b/verse/start.py @@ -5,6 +5,7 @@ from flask import ( redirect, url_for, session, + send_from_directory, Blueprint, ) from flask_login import ( @@ -17,6 +18,7 @@ from flask_wtf.csrf import CSRFError from app import create_app, login_manager from usermodel import User +from distribusimodel import Distribusis # Use upload form to populate filters from forms.uploadform import UploadForm @@ -107,6 +109,15 @@ def theme(): return ThemeSelector() +@APP.route("/publicthemes/") +def publicthemes(path): + distribusi = Distribusis.query.filter_by(distribusiname=path).first() + publicthemefolder = f"publicthemes/{distribusi.distribusiname}/" + cssfile = f"{publicthemefolder}/{distribusi.publictheme}.css" + print(cssfile) + return send_from_directory("themes", cssfile, as_attachment=True) + + @APP.route("/editor", methods=["GET", "POST"]) @login_required def editor(): @@ -156,7 +167,6 @@ def forgotpassword(): @APP.route("/resetpassword/", methods=["GET", "POST"]) def resetpassword(path): - print(path) return ResetPassword(path) diff --git a/verse/static/css/style.css b/verse/static/css/style.css index 75923df..ee67d83 100644 --- a/verse/static/css/style.css +++ b/verse/static/css/style.css @@ -66,6 +66,9 @@ div#upload form { #distribusiverse { margin-bottom: 11em; } +#distribusi-index { + padding-left: 1em; +} div#buttons{ position: fixed; diff --git a/verse/templates/distribusiworkflow/editcss.html b/verse/templates/distribusiworkflow/editcss.html index fe83e96..4b850b5 100644 --- a/verse/templates/distribusiworkflow/editcss.html +++ b/verse/templates/distribusiworkflow/editcss.html @@ -1,5 +1,5 @@
-

(Optional) Step 3: Edit

+

Step 3: Edit Custom CSS (Optional)

{% if files_uploaded or distribusi_live %}

Go to CSS editor

{% else %} diff --git a/verse/templates/distribusiworkflow/theme.html b/verse/templates/distribusiworkflow/theme.html index 1c448a1..3a371d1 100644 --- a/verse/templates/distribusiworkflow/theme.html +++ b/verse/templates/distribusiworkflow/theme.html @@ -1,5 +1,5 @@
-

(Optional) Step 2: Choose a theme

+

Step 2: Choose a theme (Optional)

Select your Theme here. If you want to make own custom css, skip and go to step 3.

Don't forget to press Save

diff --git a/verse/templates/index.html b/verse/templates/index.html index afcbcc0..0235083 100644 --- a/verse/templates/index.html +++ b/verse/templates/index.html @@ -56,13 +56,16 @@

List of distribusis

{% include 'filtermenu.html' %} -