mirror of https://gitlab.com/tildes/tildes.git
Browse Source
Enable "mark new comments" for all users
Enable "mark new comments" for all users
Previously, this feature was disabled by default. However, despite being one of the best features on the site, only about 10% of users ever enabled it, and even very involved/frequent users often didn't realize it existed. My original thought about why it should be opt-in only is that I thought it had a meaningful privacy impact, but it really doesn't. User visits to topics are already tracked through server logs and similar data, so the feature doesn't really make any difference. This commit enables the feature for everyone, removes the separate Settings page, and moves the "Collapse old comments" sub-setting onto the main Settings page.merge-requests/89/head
Deimos
5 years ago
15 changed files with 84 additions and 142 deletions
-
32tildes/alembic/versions/6c840340ab86_drop_track_comment_visits_column_on_.py
-
1tildes/scripts/clean_private_data.py
-
BINtildes/static/images/mark-new-comments.png
-
1tildes/tildes/lib/message.py
-
25tildes/tildes/models/topic/topic_query.py
-
1tildes/tildes/models/user/user.py
-
3tildes/tildes/routes.py
-
3tildes/tildes/schemas/user.py
-
20tildes/tildes/templates/settings.jinja2
-
63tildes/tildes/templates/settings_comment_visits.jinja2
-
5tildes/tildes/templates/topic.jinja2
-
44tildes/tildes/views/api/web/comment.py
-
16tildes/tildes/views/api/web/user.py
-
9tildes/tildes/views/settings.py
-
3tildes/tildes/views/topic.py
@ -0,0 +1,32 @@ |
|||
"""Drop track_comment_visits column on users |
|||
|
|||
Revision ID: 6c840340ab86 |
|||
Revises: cc12ea6c616d |
|||
Create Date: 2020-01-27 21:42:25.565355 |
|||
|
|||
""" |
|||
from alembic import op |
|||
import sqlalchemy as sa |
|||
|
|||
|
|||
# revision identifiers, used by Alembic. |
|||
revision = "6c840340ab86" |
|||
down_revision = "cc12ea6c616d" |
|||
branch_labels = None |
|||
depends_on = None |
|||
|
|||
|
|||
def upgrade(): |
|||
op.drop_column("users", "track_comment_visits") |
|||
|
|||
|
|||
def downgrade(): |
|||
op.add_column( |
|||
"users", |
|||
sa.Column( |
|||
"track_comment_visits", |
|||
sa.BOOLEAN(), |
|||
server_default=sa.text("false"), |
|||
nullable=False, |
|||
), |
|||
) |
Before Width: 252 | Height: 250 | Size: 6.4 KiB |
@ -1,63 +0,0 @@ |
|||
{# Copyright (c) 2018 Tildes contributors <code@tildes.net> #} |
|||
{# SPDX-License-Identifier: AGPL-3.0-or-later #} |
|||
|
|||
{% extends 'base_settings.jinja2' %} |
|||
|
|||
{% block title %}Toggle marking new comments{% endblock %} |
|||
|
|||
{% block main_heading %}Toggle marking new comments{% endblock %} |
|||
|
|||
{% block settings %} |
|||
<figure> |
|||
<figcaption>How new comments are displayed</figcaption> |
|||
<img src="/images/mark-new-comments.png" alt="Examples of how new comments are displayed"> |
|||
</figure> |
|||
|
|||
<p>Tildes can mark which comments were posted since your previous visit to a topic's comments (and which topics have any new ones), but doing so requires keeping track of when that previous visit happened. This has a privacy implication, so the feature is opt-in.</p> |
|||
|
|||
<p>While this feature is enabled, we will record and store data about your most recent visit to each topic's comments. We store only the single most recent visit—any previous visit data for that topic is replaced if you visit the same one again later.</p> |
|||
|
|||
<p>This data is retained for 30 days. After not visiting a particular topic for 30 days, the data about your last visit to it will be deleted.</p> |
|||
|
|||
<p>Disabling the feature will stop marking comments but will not delete any existing data, only prevent new data from being stored. The previously-stored data will be deleted after 30 days, as usual.</p> |
|||
|
|||
<div class="divider"></div> |
|||
|
|||
<form |
|||
name="comment-visits" |
|||
autocomplete="off" |
|||
data-ic-patch-to="{{ request.route_url('ic_user', username=request.user.username) }}" |
|||
data-js-autosubmit-on-change |
|||
> |
|||
<div class="form-group"> |
|||
<label class="form-checkbox"> |
|||
<input |
|||
type="checkbox" |
|||
id="track_comment_visits" |
|||
name="track_comment_visits" |
|||
{% if request.user.track_comment_visits %}checked{% endif %} |
|||
> |
|||
<i class="form-icon"></i> Track my last visit to each topic's comments and mark new comments |
|||
</label> |
|||
</div> |
|||
</form> |
|||
|
|||
<form |
|||
name="collapse-old-comments" |
|||
autocomplete="off" |
|||
data-ic-patch-to="{{ request.route_url('ic_user', username=request.user.username) }}" |
|||
> |
|||
<div class="form-group"> |
|||
<label class="form-checkbox"> |
|||
<input |
|||
type="checkbox" |
|||
id="collapse_old_comments" |
|||
name="collapse_old_comments" |
|||
data-js-autosubmit-on-change |
|||
{% if request.user.collapse_old_comments %}checked{% endif %} |
|||
> |
|||
<i class="form-icon"></i> Collapse old comments when I return to a topic (no effect unless the overall setting is enabled) |
|||
</label> |
|||
</div> |
|||
</form> |
|||
{% endblock %} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue