diff --git a/tildes/alembic/versions/2512581c91b3_add_setting_to_open_links_in_new_tab.py b/tildes/alembic/versions/2512581c91b3_add_setting_to_open_links_in_new_tab.py new file mode 100644 index 0000000..a05b76b --- /dev/null +++ b/tildes/alembic/versions/2512581c91b3_add_setting_to_open_links_in_new_tab.py @@ -0,0 +1,26 @@ +"""Add setting to open links in new tab + +Revision ID: 2512581c91b3 +Revises: +Create Date: 2018-07-21 22:23:49.563318 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '2512581c91b3' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade(): + op.add_column('users', sa.Column('open_new_tab_external', sa.Boolean(), server_default='false', nullable=False)) + op.add_column('users', sa.Column('open_new_tab_internal', sa.Boolean(), server_default='false', nullable=False)) + + +def downgrade(): + op.drop_column('users', 'open_new_tab_internal') + op.drop_column('users', 'open_new_tab_external') diff --git a/tildes/scss/modules/_settings.scss b/tildes/scss/modules/_settings.scss index a7f1417..c6bfcae 100644 --- a/tildes/scss/modules/_settings.scss +++ b/tildes/scss/modules/_settings.scss @@ -4,4 +4,9 @@ li { margin-bottom: 1rem; } + + // Nested settings list + ul li { + margin-bottom: unset; + } } diff --git a/tildes/tildes/models/user/user.py b/tildes/tildes/models/user/user.py index a27d0dd..d4f9f40 100644 --- a/tildes/tildes/models/user/user.py +++ b/tildes/tildes/models/user/user.py @@ -82,6 +82,10 @@ class User(DatabaseModel): Boolean, nullable=False, server_default='false') auto_mark_notifications_read: bool = Column( Boolean, nullable=False, server_default='false') + 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') home_default_order: Optional[TopicSortOption] = Column( diff --git a/tildes/tildes/templates/macros/topics.jinja2 b/tildes/tildes/templates/macros/topics.jinja2 index 092ef4e..daa1c06 100644 --- a/tildes/tildes/templates/macros/topics.jinja2 +++ b/tildes/tildes/templates/macros/topics.jinja2 @@ -11,9 +11,15 @@

{% if topic.is_text_type %} - {{ topic.title }} + {{ topic.title }} {% elif topic.is_link_type %} - {{ topic.title }} + {{ topic.title }} {% endif %}

({{ topic.content_metadata_for_display }}) @@ -56,7 +62,10 @@