From 61558feea1673606db72229694c13eee482f2eac Mon Sep 17 00:00:00 2001 From: Chad Birch Date: Fri, 12 Apr 2019 19:57:59 -0600 Subject: [PATCH] Topic tag filters: one per line instead of commas A few minor interface improvements for topic tag filters - mostly just changing to the settings page defining them in a textarea, with one per line. Previously this was just a text input with the tags comma-separated, which got unwieldy very quickly. --- tildes/tildes/templates/settings_filters.jinja2 | 10 ++++++++-- tildes/tildes/views/api/web/user.py | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tildes/tildes/templates/settings_filters.jinja2 b/tildes/tildes/templates/settings_filters.jinja2 index 3f966e2..9360c1c 100644 --- a/tildes/tildes/templates/settings_filters.jinja2 +++ b/tildes/tildes/templates/settings_filters.jinja2 @@ -21,8 +21,14 @@ username=request.user.username, ) }}" > - - + +
diff --git a/tildes/tildes/views/api/web/user.py b/tildes/tildes/views/api/web/user.py index b4df52a..e366711 100644 --- a/tildes/tildes/views/api/web/user.py +++ b/tildes/tildes/views/api/web/user.py @@ -330,11 +330,11 @@ def put_default_listing_options( @use_kwargs({"tags": String()}) def put_filtered_topic_tags(request: Request, tags: str) -> dict: """Update a user's filtered topic tags list.""" - if not tags: + if not tags or tags.isspace(): request.user.filtered_topic_tags = [] return IC_NOOP - split_tags = tags.split(",") + split_tags = tags.replace("\r", "").split("\n") try: schema = TopicSchema(only=("tags",))