main #12

Merged
crunk merged 49 commits from Toolsheds/distribusi-verse:main into main 2024-07-03 13:48:57 +02:00
38 changed files with 1369 additions and 1376 deletions
Showing only changes of commit 2a018ab863 - Show all commits

View File

@ -43,7 +43,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format] [tool.ruff.format]
quote-style = "double" quote-style = "double"
indent-style = "tab" indent-style = "space"
docstring-code-format = true docstring-code-format = true
line-ending = "auto" line-ending = "auto"
skip-magic-trailing-comma = false skip-magic-trailing-comma = false

View File

@ -40,15 +40,7 @@ def describe_file(file_id):
describe_form = DescribeFilesForm( describe_form = DescribeFilesForm(
distribusi_file.id, distribusi_file.path, distribusi_file.type distribusi_file.id, distribusi_file.path, distribusi_file.type
) )
print(
f"file: {describe_form.file_path} description: {describe_form.description.data}"
)
print(
f"file: {describe_form.file_path} searchtags: {describe_form.searchtags.data}"
)
print(
f"file: {describe_form.file_path} alttext: {describe_form.alttext.data}"
)
distribusi = Distribusis.query.filter_by( distribusi = Distribusis.query.filter_by(
id=distribusi_file.distribusi id=distribusi_file.distribusi
).first() ).first()
@ -59,6 +51,7 @@ def describe_file(file_id):
) )
) )
@describer.route("/stash/<path:path>") @describer.route("/stash/<path:path>")
def send_stash_file(path): def send_stash_file(path):
return send_from_directory("stash", path) return send_from_directory("stash", path)

View File

@ -70,4 +70,4 @@ def add_distribusi_files(path):
_distribusi_file_with_type(distribusi, full_path) _distribusi_file_with_type(distribusi, full_path)
add_distribusi_files("2018-02-16-Extratonality") add_distribusi_files("2018-12-WttF-Mastodon-and-the-Fediverse")

View File

@ -14,7 +14,7 @@ from flask_login import current_user, login_required, logout_user
from flask_wtf.csrf import CSRFError from flask_wtf.csrf import CSRFError
from adminpage import AdminPage from adminpage import AdminPage
from app import db, create_app, login_manager from app import create_app, login_manager, db
from describer.describe_files import describer from describer.describe_files import describer
from distribusikan.distribusikan import distribusikan from distribusikan.distribusikan import distribusikan
from distribusikan.distribusisinfo import DistribusisInfo from distribusikan.distribusisinfo import DistribusisInfo
@ -29,7 +29,6 @@ from statuspengguna.registeruser import register_user
APP = create_app() APP = create_app()
stash_page = Blueprint("stash_page", __name__, static_folder="stash") stash_page = Blueprint("stash_page", __name__, static_folder="stash")
APP.register_blueprint(stash_page) APP.register_blueprint(stash_page)
APP.register_blueprint(describer, url_prefix="/describer") APP.register_blueprint(describer, url_prefix="/describer")
APP.register_blueprint(login_section, url_prefix="/login") APP.register_blueprint(login_section, url_prefix="/login")
APP.register_blueprint(register_user, url_prefix="/register") APP.register_blueprint(register_user, url_prefix="/register")
@ -59,6 +58,7 @@ def index():
"tags": distribusi.tags.split(","), "tags": distribusi.tags.split(","),
} }
distribusisindex[distribusi.distribusiname] = singledistribusi distribusisindex[distribusi.distribusiname] = singledistribusi
years = uploadform.year.choices years = uploadform.year.choices
categories = uploadform.category.choices categories = uploadform.category.choices
adminuser = is_adminuser() adminuser = is_adminuser()