No more committing straight to master. Moving all development to dev branch.
@ -60,14 +60,10 @@ def check_valid_login():
|
|||||||
@main.route("/")
|
@main.route("/")
|
||||||
@main.route("/home", methods=["GET"])
|
@main.route("/home", methods=["GET"])
|
||||||
def home():
|
def home():
|
||||||
tags_form = TagsForm()
|
|
||||||
tags_form.tags.choices += [
|
|
||||||
(tag.name, tag.name) for tag in Tags.query.order_by(Tags.name).all()
|
|
||||||
]
|
|
||||||
settings = Settings.query.first()
|
settings = Settings.query.first()
|
||||||
if not check_groups(settings.home_access_groups, current_user):
|
if not check_groups(settings.home_access_groups, current_user):
|
||||||
return redirect(url_for("error_pages.unauthorized"))
|
return redirect(url_for("error_pages.unauthorized"))
|
||||||
return render_template("main/home.html", tags_form=tags_form)
|
return render_template("main/home.html")
|
||||||
|
|
||||||
|
|
||||||
@public_route
|
@public_route
|
||||||
|
@ -5,6 +5,7 @@ from flask_login import current_user
|
|||||||
from dashmachine import app
|
from dashmachine import app
|
||||||
from dashmachine.main.models import Apps
|
from dashmachine.main.models import Apps
|
||||||
from dashmachine.main.utils import check_groups
|
from dashmachine.main.utils import check_groups
|
||||||
|
from dashmachine.main.forms import TagsForm
|
||||||
from dashmachine.settings_system.models import Settings
|
from dashmachine.settings_system.models import Settings
|
||||||
from dashmachine.paths import static_folder, backgrounds_images_folder
|
from dashmachine.paths import static_folder, backgrounds_images_folder
|
||||||
from dashmachine.cssmin import cssmin
|
from dashmachine.cssmin import cssmin
|
||||||
@ -75,13 +76,18 @@ def process_css_sources(process_bundle=None, src=None, app_global=False):
|
|||||||
@app.context_processor
|
@app.context_processor
|
||||||
def context_processor():
|
def context_processor():
|
||||||
apps = []
|
apps = []
|
||||||
|
tags = []
|
||||||
apps_db = Apps.query.all()
|
apps_db = Apps.query.all()
|
||||||
for app_db in apps_db:
|
for app_db in apps_db:
|
||||||
if not app_db.groups:
|
if not app_db.groups:
|
||||||
app_db.groups = None
|
app_db.groups = None
|
||||||
if check_groups(app_db.groups, current_user):
|
if check_groups(app_db.groups, current_user):
|
||||||
apps.append(app_db)
|
apps.append(app_db)
|
||||||
|
tags += app_db.tags.split(",")
|
||||||
|
|
||||||
|
tags_form = TagsForm()
|
||||||
|
tags_form.tags.choices += [(tag, tag) for tag in tags]
|
||||||
|
print(tags_form.tags.choices)
|
||||||
settings = Settings.query.first()
|
settings = Settings.query.first()
|
||||||
if settings.background == "random":
|
if settings.background == "random":
|
||||||
if len(os.listdir(backgrounds_images_folder)) < 1:
|
if len(os.listdir(backgrounds_images_folder)) < 1:
|
||||||
@ -97,4 +103,5 @@ def context_processor():
|
|||||||
process_css_sources=process_css_sources,
|
process_css_sources=process_css_sources,
|
||||||
apps=apps,
|
apps=apps,
|
||||||
settings=settings,
|
settings=settings,
|
||||||
|
tags_form=tags_form,
|
||||||
)
|
)
|
||||||
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 311 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 5.2 KiB |
@ -1 +1 @@
|
|||||||
version = "v0.4"
|
version = "v0.41"
|
||||||
|