diff --git a/tildes/alembic/versions/becc33b73339_add_setting_to_open_links_in_new_tabs.py b/tildes/alembic/versions/becc33b73339_add_setting_to_open_links_in_new_tabs.py new file mode 100644 index 0000000..31a28fb --- /dev/null +++ b/tildes/alembic/versions/becc33b73339_add_setting_to_open_links_in_new_tabs.py @@ -0,0 +1,24 @@ +"""Add setting to open links in new tabs + +Revision ID: becc33b73339 +Revises: +Create Date: 2018-07-19 02:56:06.160422 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'becc33b73339' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade(): + op.add_column('users', sa.Column('open_links_new_tab', sa.Boolean(), server_default='false', nullable=False)) + + +def downgrade(): + op.drop_column('users', 'open_links_new_tab') diff --git a/tildes/tildes/models/user/user.py b/tildes/tildes/models/user/user.py index dd9dddc..9265bd6 100644 --- a/tildes/tildes/models/user/user.py +++ b/tildes/tildes/models/user/user.py @@ -82,6 +82,8 @@ 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( + 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..b9e81e6 100644 --- a/tildes/tildes/templates/macros/topics.jinja2 +++ b/tildes/tildes/templates/macros/topics.jinja2 @@ -11,9 +11,15 @@