Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the handling of “unsettling” profiles (a.k.a. Not Safe For Work) #2098

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

longj724
Copy link

@longj724 longj724 commented Dec 9, 2021

For issue #1965. Implements functionality that allows users to mark their profile as unsettling. These profiles are then blurred/hidden when viewed by other users. Users can only see the content of unsettling profiles after being warned the profile contains unsettling content and confirming that they still want to view the profile.

Copy link
Member

@Changaco Changaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • JavaScript isn't needed (and therefore shouldn't be used) to implement opting-in to view unsettling profiles.
  • The CSS classes used to apply the blur effect can be generalized, i.e. blur-3px and blur-4px instead of panel-blur, repo-search-blur and mini-user-blur.
  • The base.html template isn't the right place to implement hiding unsettling profiles. profile-base.html is more appropriate.

('hide_giving', (_("Hide total giving from others."), False)),
('hide_receiving', (_("Hide total receiving from others."), False)),
('hide_from_search', (_("Hide this profile from search results on Liberapay."), True)),
('profile_noindex', (_("Tell web search engines not to index this profile."), True)),
('hide_from_lists', (_("Prevent this profile from being listed on Liberapay."), True)),
('is_unsettling', (_("Mark this profile as unsettling"), True)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This checkbox label is too terse, and its (lack of) punctuation isn't consistent with the other labels.

templates/macros/profile-box.html Show resolved Hide resolved
tests/py/test_settings.py Outdated Show resolved Hide resolved
www/%username/edit/visibility.spt Outdated Show resolved Hide resolved
@@ -40,6 +40,7 @@ langs = participant.get_statement_langs()

show_income = not participant.hide_receiving and participant.accepts_tips


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extraneous blank line should be removed.

www/%username/settings/edit.spt Show resolved Hide resolved
www/search.spt Show resolved Hide resolved
{{ _(
"{username} has a repository named {repo_name} in their {platform} account",
"has a repository named {repo_name} in their {platform} account",
username=('<a href="/{0}/">{0}</a>'|safe).format(owner.username),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the username variable isn't used in the string anymore, then it should be removed from the arguments passed to the translation function. However, the larger problem here is that this change assumes that the username is at the beginning of the sentence in every language. A cleaner solution would be to generate the possibly-blurred avatar+username box with a macro or block assignment, and pass it to the translation function in the username argument.

@Changaco Changaco changed the title Setting Profiles as Unsettling Improve the handling of “unsettling” profiles (a.k.a. Not Safe For Work) Dec 11, 2021
@Changaco Changaco linked an issue Dec 11, 2021 that may be closed by this pull request
@Changaco
Copy link
Member

  • The privacy.spt file can't only be renamed to visibility.spt, it has to keep existing to handle submissions of the old form. It can be a simple 307 redirect to the new URL, but in that case the visibility.spt file has to handle receiving a privacy parameter in the request body.
  • This branch needs to be rebased on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

NSFW flag for accounts
2 participants