-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(global): setup inital global settings page (#121)
- Loading branch information
Showing
8 changed files
with
157 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""empty message | ||
Revision ID: 6e10d0ad5159 | ||
Revises: 863f81a1b742 | ||
Create Date: 2024-02-27 16:25:21.514371 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '6e10d0ad5159' | ||
down_revision = '863f81a1b742' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('globalset', schema=None) as batch_op: | ||
batch_op.alter_column('settingid', | ||
existing_type=sa.INTEGER(), | ||
type_=sa.String(), | ||
existing_nullable=False) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('globalset', schema=None) as batch_op: | ||
batch_op.alter_column('settingid', | ||
existing_type=sa.String(), | ||
type_=sa.INTEGER(), | ||
existing_nullable=False) | ||
|
||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""empty message | ||
Revision ID: 863f81a1b742 | ||
Revises: a0d95191a5c0 | ||
Create Date: 2024-02-26 17:25:06.957539 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '863f81a1b742' | ||
down_revision = 'a0d95191a5c0' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('globalset', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('settingid', sa.Integer(), nullable=False)) | ||
batch_op.add_column(sa.Column('setting', sa.String(), nullable=False)) | ||
batch_op.drop_column('timezonename') | ||
batch_op.drop_column('id') | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('globalset', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False)) | ||
batch_op.add_column(sa.Column('timezonename', sa.VARCHAR(), autoincrement=False, nullable=False)) | ||
batch_op.drop_column('setting') | ||
batch_op.drop_column('settingid') | ||
|
||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""empty message | ||
Revision ID: a0d95191a5c0 | ||
Revises: 4994f94014b5 | ||
Create Date: 2024-02-23 18:49:45.470611 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'a0d95191a5c0' | ||
down_revision = '4994f94014b5' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('globalset', | ||
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), | ||
sa.Column('timezonename', sa.String(), nullable=False), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('globalset') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from flask_wtf import FlaskForm | ||
from wtforms import SelectField | ||
import pytz | ||
|
||
|
||
class SettingsForm(FlaskForm): | ||
timezone = SelectField('Timezone', choices=[ | ||
(tz, tz) for tz in pytz.all_timezones]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<h1>Settings</h1> | ||
<form method="POST"> | ||
{{ form.hidden_tag() }} | ||
<div class="form-group"> | ||
<label for="timezone">{{ form.timezone.label }}</label> | ||
{{ form.timezone(class="form-control") }} | ||
</div> | ||
<button type="submit" class="btn btn-primary btn-lg">Save</button> | ||
</form> | ||
{% endblock %} |