more text edits

This commit is contained in:
crunk 2024-04-21 21:28:44 +02:00
parent 67acc5ec56
commit cefdc8cd11
7 changed files with 24 additions and 35 deletions

View File

@ -48,9 +48,8 @@ def AutoFillInUploadForm(uploadform, current_distribusi):
).first() ).first()
uploadform.sitename.data = distribusi.distribusiname uploadform.sitename.data = distribusi.distribusiname
uploadform.sitename.render_kw = {"readonly": True} uploadform.sitename.render_kw = {"readonly": True}
uploadform.term.data = distribusi.term uploadform.category.data = distribusi.category
uploadform.course.data = distribusi.course uploadform.year.data = distribusi.year
uploadform.academicyear.data = distribusi.year
uploadform.tags.data = distribusi.tags uploadform.tags.data = distribusi.tags
return uploadform return uploadform

View File

@ -3,9 +3,10 @@ from __future__ import with_statement
import logging import logging
from logging.config import fileConfig from logging.config import fileConfig
from alembic import context
from flask import current_app from flask import current_app
from alembic import context
# this is the Alembic Config object, which provides # this is the Alembic Config object, which provides
# access to the values within the .ini file in use. # access to the values within the .ini file in use.
config = context.config config = context.config
@ -13,19 +14,17 @@ config = context.config
# Interpret the config file for Python logging. # Interpret the config file for Python logging.
# This line sets up loggers basically. # This line sets up loggers basically.
fileConfig(config.config_file_name) fileConfig(config.config_file_name)
logger = logging.getLogger("alembic.env") logger = logging.getLogger('alembic.env')
# add your model's MetaData object here # add your model's MetaData object here
# for 'autogenerate' support # for 'autogenerate' support
# from myapp import mymodel # from myapp import mymodel
# target_metadata = mymodel.Base.metadata # target_metadata = mymodel.Base.metadata
config.set_main_option( config.set_main_option(
"sqlalchemy.url", 'sqlalchemy.url',
str(current_app.extensions["migrate"].db.get_engine().url).replace( str(current_app.extensions['migrate'].db.get_engine().url).replace(
"%", "%%" '%', '%%'))
), target_metadata = current_app.extensions['migrate'].db.metadata
)
target_metadata = current_app.extensions["migrate"].db.metadata
# other values from the config, defined by the needs of env.py, # other values from the config, defined by the needs of env.py,
# can be acquired: # can be acquired:
@ -66,20 +65,20 @@ def run_migrations_online():
# when there are no changes to the schema # when there are no changes to the schema
# reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html # reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html
def process_revision_directives(context, revision, directives): def process_revision_directives(context, revision, directives):
if getattr(config.cmd_opts, "autogenerate", False): if getattr(config.cmd_opts, 'autogenerate', False):
script = directives[0] script = directives[0]
if script.upgrade_ops.is_empty(): if script.upgrade_ops.is_empty():
directives[:] = [] directives[:] = []
logger.info("No changes in schema detected.") logger.info('No changes in schema detected.')
connectable = current_app.extensions["migrate"].db.get_engine() connectable = current_app.extensions['migrate'].db.get_engine()
with connectable.connect() as connection: with connectable.connect() as connection:
context.configure( context.configure(
connection=connection, connection=connection,
target_metadata=target_metadata, target_metadata=target_metadata,
process_revision_directives=process_revision_directives, process_revision_directives=process_revision_directives,
**current_app.extensions["migrate"].configure_args, **current_app.extensions['migrate'].configure_args
) )
with context.begin_transaction(): with context.begin_transaction():

View File

@ -52,7 +52,7 @@ def index():
singledistribusi = { singledistribusi = {
"username": user.username, "username": user.username,
"publictheme": distribusi.publictheme, "publictheme": distribusi.publictheme,
"category": distribusi.term, "category": distribusi.category,
"year": distribusi.year, "year": distribusi.year,
"tags": distribusi.tags.split(","), "tags": distribusi.tags.split(","),
} }

View File

@ -1,5 +1,5 @@
/* Dropdown Button */ /* Dropdown Button */
/* for sorting on Academicyear, Term, Course /* for sorting on year and category
*/ */
button { button {
background-color: #E0B0FF; background-color: #E0B0FF;

View File

@ -4,7 +4,7 @@
<p><a href="/editor">Go to CSS editor</a></p> <p><a href="/editor">Go to CSS editor</a></p>
{% else %} {% else %}
<p> <p>
You need to upload your files first before you can a css theme You need to upload your files first before you can select a css theme
for your files. for your files.
</p> </p>
<p><a href="#upload">Go to Step 1</a></p> <p><a href="#upload">Go to Step 1</a></p>

View File

@ -16,7 +16,7 @@
</fieldset> </fieldset>
{% else %} {% else %}
<p> <p>
You need to upload your files first before you can a css theme You need to upload your files first before you can select a css theme
for your files. for your files.
</p> </p>
<a href="#upload">Go to Step 1</a> <a href="#upload">Go to Step 1</a>
@ -35,7 +35,7 @@
</fieldset> </fieldset>
{% else %} {% else %}
<p> <p>
You need to upload your files first before you can a css theme You need to upload your files first before you can select a css theme
for your files. for your files.
</p> </p>
<a href="#upload">Go to Step 1</a> <a href="#upload">Go to Step 1</a>

View File

@ -11,28 +11,19 @@
{% endfor %} {% endfor %}
</fieldset> </fieldset>
<fieldset class="required"> <fieldset class="required">
{{ uploadform.academicyear.label }} {{ uploadform.year.label }}
<div class="selector-style"> <div class="selector-style">
{{ uploadform.academicyear }} {{ uploadform.year }}
{% for message in uploadform.academicyear.errors %} {% for message in uploadform.year.errors %}
<div class="error">{{ message }}</div> <div class="error">{{ message }}</div>
{% endfor %} {% endfor %}
</div> </div>
</fieldset> </fieldset>
<fieldset class="required"> <fieldset class="required">
{{ uploadform.term.label }} {{ uploadform.category.label }}
<div class="selector-style"> <div class="selector-style">
{{ uploadform.term }} {{ uploadform.category }}
{% for message in uploadform.term.errors %} {% for message in uploadform.category.errors %}
<div class="error">{{ message }}</div>
{% endfor %}
</div>
</fieldset>
<fieldset class="required">
{{ uploadform.course.label }}
<div class="selector-style">
{{ uploadform.course }}
{% for message in uploadform.course.errors %}
<div class="error">{{ message }}</div> <div class="error">{{ message }}</div>
{% endfor %} {% endfor %}
</div> </div>