diff --git a/CHANGELOG.md b/CHANGELOG.md index 10f4493..e5bc9eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ - Added dependency to [SUOU](https://github.com/sakuragasaki46/suou) library - Added user blocks - Added user strikes: a strike logs the content of a removed message for future use -- Posts may now be deleted by author. If it has comments, comments are not spared - Implemented guild subscriptions + Blocking a user prevents them from seeing your comments, posts (standalone or in feed) and profile - Added ✨color themes✨ diff --git a/alembic/versions/6d418df3c72f_.py b/alembic/versions/6d418df3c72f_.py deleted file mode 100644 index ccb6063..0000000 --- a/alembic/versions/6d418df3c72f_.py +++ /dev/null @@ -1,34 +0,0 @@ -"""empty message - -Revision ID: 6d418df3c72f -Revises: 90c7d0098efe -Create Date: 2025-07-07 13:37:51.667620 - -""" -from typing import Sequence, Union - -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision: str = '6d418df3c72f' -down_revision: Union[str, None] = '90c7d0098efe' -branch_labels: Union[str, Sequence[str], None] = None -depends_on: Union[str, Sequence[str], None] = None - - -def upgrade() -> None: - """Upgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.drop_constraint('comment_parent_post_id', 'freak_comment', type_='foreignkey') - op.create_foreign_key('comment_parent_post_id', 'freak_comment', 'freak_post', ['parent_post_id'], ['id'], ondelete='cascade') - # ### end Alembic commands ### - - -def downgrade() -> None: - """Downgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.drop_constraint('comment_parent_post_id', 'freak_comment', type_='foreignkey') - op.create_foreign_key('comment_parent_post_id', 'freak_comment', 'freak_post', ['parent_post_id'], ['id']) - # ### end Alembic commands ### diff --git a/freak/__init__.py b/freak/__init__.py index ba98759..44416e0 100644 --- a/freak/__init__.py +++ b/freak/__init__.py @@ -17,13 +17,12 @@ from sqlalchemy.exc import SQLAlchemyError from suou import Snowflake, ssv_list from werkzeug.routing import BaseConverter from sassutils.wsgi import SassMiddleware -from werkzeug.middleware.proxy_fix import ProxyFix from suou.configparse import ConfigOptions, ConfigValue from freak.colors import color_themes, theme_classes -__version__ = '0.4.0-dev27' +__version__ = '0.4.0-dev24' APP_BASE_DIR = os.path.dirname(os.path.dirname(__file__)) @@ -37,7 +36,6 @@ class AppConfig(ConfigOptions): domain_name = ConfigValue() private_assets = ConfigValue(cast=ssv_list) jquery_url = ConfigValue(default='https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js') - app_is_behind_proxy = ConfigValue(cast=bool, default=False) app_config = AppConfig() @@ -53,12 +51,6 @@ app.wsgi_app = SassMiddleware(app.wsgi_app, dict( freak=('static/sass', 'static/css', '/static/css', True) )) -# proxy fix -if app_config.app_is_behind_proxy: - app.wsgi_app = ProxyFix( - app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1 - ) - class SlugConverter(BaseConverter): regex = r'[a-z0-9]+(?:-[a-z0-9]+)*' diff --git a/freak/filters.py b/freak/filters.py index f085ef9..df56edd 100644 --- a/freak/filters.py +++ b/freak/filters.py @@ -40,9 +40,3 @@ def append(text, l: list): l.append(text) return None -@app.template_filter() -def faint_paren(text: str): - if not '(' in text: - return text - t1, t2, t3 = text.partition('(') - return Markup('{0} {1}').format(t1, t2 + t3) \ No newline at end of file diff --git a/freak/models.py b/freak/models.py index a478595..009bff7 100644 --- a/freak/models.py +++ b/freak/models.py @@ -245,6 +245,7 @@ class User(Base): target_id = target qq= ~select(UserBlock).where(UserBlock.c.actor_id == actor_id, UserBlock.c.target_id == target_id).exists() + print(qq) return qq def recompute_karma(self): @@ -436,7 +437,7 @@ class Comment(Base): id = snowflake_column() author_id = Column(BigInteger, ForeignKey('freak_user.id', name='comment_author_id'), nullable=True) - parent_post_id = Column(BigInteger, ForeignKey('freak_post.id', name='comment_parent_post_id', ondelete='cascade'), nullable=False) + parent_post_id = Column(BigInteger, ForeignKey('freak_post.id', name='comment_parent_post_id'), nullable=False) parent_comment_id = Column(BigInteger, ForeignKey('freak_comment.id', name='comment_parent_comment_id'), nullable=True) text_content = Column(String(16384), nullable=False) created_at = Column(DateTime, server_default=func.current_timestamp(), index=True) diff --git a/freak/static/sass/layout.sass b/freak/static/sass/layout.sass index c042424..9dbd8c9 100644 --- a/freak/static/sass/layout.sass +++ b/freak/static/sass/layout.sass @@ -1,9 +1,7 @@ @import "constants.sass" -body - margin: 0 - + .content-container display: flex flex-direction: row-reverse @@ -20,7 +18,6 @@ body main min-height: 70vh - margin: 12px auto // __ header styles __ // @@ -31,6 +28,7 @@ header.header overflow: hidden height: 3em padding: .75em 1.5em + margin: -12px line-height: 1 h1 margin: 0 diff --git a/freak/static/sass/mobile.sass b/freak/static/sass/mobile.sass index 4d45ce0..2ed1831 100644 --- a/freak/static/sass/mobile.sass +++ b/freak/static/sass/mobile.sass @@ -10,58 +10,7 @@ grid-template-columns: 1fr 1fr .nomobile - display: none !important - - body - position: relative - - footer.mobile-nav - position: sticky - bottom: 0 - left: 0 - width: 100% - overflow: hidden - margin: 0 - padding: 0 - background-color: var(--background) - box-shadow: 0 0 6px var(--border) - z-index: 150 - - > ul - display: flex - list-style: none - margin: 0 - padding: 0 - flex-direction: row - align-items: stretch - justify-content: stretch - > li - flex: 1 - padding: .5em - margin: 0 - text-align: center - a - text-decoration: none - .icon - font-size: 2rem - - .content-nav - margin: 1em - width: unset - - header.header h1 - margin-top: 4px - margin-left: 6px - - .content-header - text-align: center - - .big-search-bar form - flex-direction: column - - [type="submit"] - width: unset - margin: 12px auto + display: none @media screen and (max-width: 960px) .header-username @@ -84,4 +33,4 @@ @media screen and (min-width: 801px) .mobileonly - display: none !important \ No newline at end of file + display: none \ No newline at end of file diff --git a/freak/templates/admin/admin_home.html b/freak/templates/admin/admin_home.html index 6634f0b..bdaa7ae 100644 --- a/freak/templates/admin/admin_home.html +++ b/freak/templates/admin/admin_home.html @@ -8,8 +8,5 @@
  • Strikes

  • -
  • -

    Users

    -
  • {% endblock %} \ No newline at end of file diff --git a/freak/templates/admin/admin_users.html b/freak/templates/admin/admin_users.html deleted file mode 100644 index 58991fc..0000000 --- a/freak/templates/admin/admin_users.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "admin/admin_base.html" %} -{% from "macros/feed.html" import stop_scrolling, no_more_scrolling with context %} - -{% block content %} - -{% endblock %} \ No newline at end of file diff --git a/freak/templates/base.html b/freak/templates/base.html index 7a97685..579cee4 100644 --- a/freak/templates/base.html +++ b/freak/templates/base.html @@ -46,11 +46,11 @@ {% if g.no_user %} {% elif current_user.is_authenticated %} -
  • +
  • create - New post + New post
  • {{ icon('profile')}}profile @@ -99,17 +99,6 @@
  • GitHub
  • - {% if current_user and current_user.is_authenticated %} - - {% endif %}