diff --git a/tildes/alembic/versions/89d583f29f29_setting_for_opening_internal_external_.py b/tildes/alembic/versions/89d583f29f29_setting_for_opening_internal_external_.py new file mode 100644 index 0000000..dabd5b8 --- /dev/null +++ b/tildes/alembic/versions/89d583f29f29_setting_for_opening_internal_external_.py @@ -0,0 +1,26 @@ +"""Setting for opening internal & external links in new tabs + +Revision ID: 89d583f29f29 +Revises: becc33b73339 +Create Date: 2018-07-20 23:27:00.751921 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '89d583f29f29' +down_revision = 'becc33b73339' +branch_labels = None +depends_on = None + + +def upgrade(): + op.alter_column('users', 'open_links_new_tab', new_column_name='open_new_tab_external') + op.add_column('users', sa.Column('open_new_tab_internal', sa.Boolean(), server_default='false', nullable=False)) + + +def downgrade(): + op.alter_column('users', 'open_new_tab_external', new_column_name='open_links_new_tab') + op.drop_column('users', 'open_new_tab_internal') diff --git a/tildes/scss/modules/_settings.scss b/tildes/scss/modules/_settings.scss index a7f1417..3e226dd 100644 --- a/tildes/scss/modules/_settings.scss +++ b/tildes/scss/modules/_settings.scss @@ -4,4 +4,8 @@ li { margin-bottom: 1rem; } + + .sub li { + margin-bottom: unset; + } } diff --git a/tildes/tildes/models/user/user.py b/tildes/tildes/models/user/user.py index 9265bd6..73bf80f 100644 --- a/tildes/tildes/models/user/user.py +++ b/tildes/tildes/models/user/user.py @@ -82,7 +82,9 @@ class User(DatabaseModel): Boolean, nullable=False, server_default='false') auto_mark_notifications_read: bool = Column( Boolean, nullable=False, server_default='false') - open_links_new_tab: bool = Column( + open_new_tab_external: bool = Column( + Boolean, nullable=False, server_default='false') + open_new_tab_internal: bool = Column( Boolean, nullable=False, server_default='false') is_banned: bool = Column(Boolean, nullable=False, server_default='false') is_admin: bool = Column(Boolean, nullable=False, server_default='false') diff --git a/tildes/tildes/templates/macros/topics.jinja2 b/tildes/tildes/templates/macros/topics.jinja2 index f3b6dbc..daa1c06 100644 --- a/tildes/tildes/templates/macros/topics.jinja2 +++ b/tildes/tildes/templates/macros/topics.jinja2 @@ -13,12 +13,12 @@ {% if topic.is_text_type %} {{ topic.title }} {% elif topic.is_link_type %} {{ topic.title }} {% endif %} @@ -64,7 +64,7 @@
Open links in new tabs