From 664b052e22425307daf2520396bd6d7c9a23ee17 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Mon, 20 Aug 2018 08:56:13 +0200 Subject: [PATCH 1/5] basic UI for signaling a user --- style/base/base.scss | 10 ++++ templates/profile.html | 3 ++ www/%username/signal.spt | 101 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 www/%username/signal.spt diff --git a/style/base/base.scss b/style/base/base.scss index 0304e892f0..c6674db8e5 100644 --- a/style/base/base.scss +++ b/style/base/base.scss @@ -129,6 +129,16 @@ body { } } +.btn-signal { + $base-color: #aaa; + background-color: $base-color; + color: #1a171b; + &:hover { + background-color: #f00; + color: #fff; + } +} + input.amount { min-width: 5em; max-width: 8em; diff --git a/templates/profile.html b/templates/profile.html index 062c98b312..1526595fb9 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -97,6 +97,9 @@

{{ participant.username }}

{{ _("Donate") }} % endif + + {{ _("Signal") }} + diff --git a/www/%username/signal.spt b/www/%username/signal.spt new file mode 100644 index 0000000000..f66e992e9c --- /dev/null +++ b/www/%username/signal.spt @@ -0,0 +1,101 @@ +from liberapay.exceptions import UserDoesntAcceptTips +from liberapay.utils import get_participant + +[---] +participant = get_participant(state, restrict=False) +if participant.goal == -1: + raise response.error(403, UserDoesntAcceptTips(participant.username)) + +full_title = _("Signal {0}", participant.username) + +[---] text/html +% extends "templates/profile-base.html" + +% from 'templates/elsewhere.html' import account_elsewhere with context + +% block head_early +{{ super() }} + +% endblock + +{% block heading %}{% endblock %} + +% block content +
+
+

{{ _("Signal {0}", ('{0}'|safe).format(participant.username)) }}

+ + % if not participant.hide_receiving + % set goal, receiving = participant.goal, participant.receiving + % if goal + % if receiving +

{{ _( + "{0} currently receives {1} per week, they need your help to reach " + "their funding goal ({2} per week)." + , participant.username, receiving, goal + ) }}

+ % else +

{{ _( + "{0}'s goal is to receive {1} per week." + , participant.username, goal + ) }} {{ _("Be the first to contribute!") }}

+ % endif + % else +

{{ _( + "{0} currently receives {1} per week." + , participant.username, receiving + ) }}

+ % endif + % endif + +
+ + % set e_accounts = participant.get_accounts_elsewhere() + % if e_accounts +

{{ _("Recipient Identity") }}

+

{{ _( + "We have confirmed through an automated verification process that " + "{0} has control of the following accounts on other platforms:", + participant.username + ) }}

+ % for platform in website.platforms if platform.name in e_accounts + {{ account_elsewhere(platform, e_accounts, None) }} + % endfor +
+ % endif + + % block form +

{{ _( + "Please add a short description why you want to report this user:" + ) }}

+ +
+ + +
+ +

{{ _("Markdown supported.") }} + {{ _("What is Markdown?") }} +

+
+ + + % endblock + +

{{ _("Frequently Asked Questions") }}

+ +

{{ _("What happen when I signal a user") }}

+

{{ _( + "The profil will be review by the moderator. " + ) }}

+ +
+
+% endblock From 663094bb8a0aa9ffee6ace33007ccc55abea927b Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 21 Aug 2018 09:06:52 +0200 Subject: [PATCH 2/5] signal => report --- style/base/base.scss | 2 +- templates/profile.html | 4 ++-- www/%username/{signal.spt => report.spt} | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) rename www/%username/{signal.spt => report.spt} (87%) diff --git a/style/base/base.scss b/style/base/base.scss index c6674db8e5..192d7cb830 100644 --- a/style/base/base.scss +++ b/style/base/base.scss @@ -129,7 +129,7 @@ body { } } -.btn-signal { +.btn-report { $base-color: #aaa; background-color: $base-color; color: #1a171b; diff --git a/templates/profile.html b/templates/profile.html index 1526595fb9..d7295db1d0 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -97,8 +97,8 @@

{{ participant.username }}

{{ _("Donate") }} % endif - - {{ _("Signal") }} + + {{ _("Report") }} diff --git a/www/%username/signal.spt b/www/%username/report.spt similarity index 87% rename from www/%username/signal.spt rename to www/%username/report.spt index f66e992e9c..2508891133 100644 --- a/www/%username/signal.spt +++ b/www/%username/report.spt @@ -6,7 +6,7 @@ participant = get_participant(state, restrict=False) if participant.goal == -1: raise response.error(403, UserDoesntAcceptTips(participant.username)) -full_title = _("Signal {0}", participant.username) +full_title = _("Report {0}", participant.username) [---] text/html % extends "templates/profile-base.html" @@ -25,7 +25,7 @@ full_title = _("Signal {0}", participant.username) % block content
-

{{ _("Signal {0}", ('{0}'|safe).format(participant.username)) }}

+

{{ _("Report {0}", ('{0}'|safe).format(participant.username)) }}

% if not participant.hide_receiving % set goal, receiving = participant.goal, participant.receiving @@ -71,12 +71,12 @@ full_title = _("Signal {0}", participant.username) "Please add a short description why you want to report this user:" ) }}

- +
- @@ -86,12 +86,12 @@ full_title = _("Signal {0}", participant.username)

- + % endblock

{{ _("Frequently Asked Questions") }}

-

{{ _("What happen when I signal a user") }}

+

{{ _("What happen when I report a user") }}

{{ _( "The profil will be review by the moderator. " ) }}

From 266b29048907425167d6469bcf30c58289f8444a Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 21 Aug 2018 09:20:28 +0200 Subject: [PATCH 3/5] fix spelling issue --- www/%username/report.spt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/%username/report.spt b/www/%username/report.spt index 2508891133..2dca3b67f0 100644 --- a/www/%username/report.spt +++ b/www/%username/report.spt @@ -91,9 +91,9 @@ full_title = _("Report {0}", participant.username)

{{ _("Frequently Asked Questions") }}

-

{{ _("What happen when I report a user") }}

+

{{ _("What happens when I report a user?") }}

{{ _( - "The profil will be review by the moderator. " + "The profil will be reviewed by a moderator. " ) }}

From 27e0e920c3414dd32f55e9e8cccba2a2c50a519e Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Wed, 22 Aug 2018 14:05:08 +0200 Subject: [PATCH 4/5] Document moderation process --- www/%username/report.spt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/www/%username/report.spt b/www/%username/report.spt index 2dca3b67f0..ed3d8f7475 100644 --- a/www/%username/report.spt +++ b/www/%username/report.spt @@ -96,6 +96,19 @@ full_title = _("Report {0}", participant.username) "The profil will be reviewed by a moderator. " ) }}

+

{{ _("Who are the moderators?") }}

+

{{ _( + "There is ten moderators who have been elected by the ten most funded project on Liberapay. " + "This ensure that Liberapay moderation is made by independent people concerned by the plateform safety. " + ) }}

+ +

{{ _("What is the moderating process?") }}

+

{{ _( + "Once at least half of the moderators confirm that the user is suspicious," + "its account is closed and it can not received donation anymore. " + "All donations to the user are then cancelled." + ) }}

+
% endblock From c501b003b764e2f13061cc1404ab122041734cfc Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Sat, 25 Aug 2018 11:42:51 +0200 Subject: [PATCH 5/5] fix bad english sentence --- www/%username/report.spt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/www/%username/report.spt b/www/%username/report.spt index ed3d8f7475..a52865f5c6 100644 --- a/www/%username/report.spt +++ b/www/%username/report.spt @@ -68,7 +68,7 @@ full_title = _("Report {0}", participant.username) % block form

{{ _( - "Please add a short description why you want to report this user:" + "Please describe why you want to report this account:" ) }}

@@ -93,20 +93,20 @@ full_title = _("Report {0}", participant.username)

{{ _("What happens when I report a user?") }}

{{ _( - "The profil will be reviewed by a moderator. " + "The profile will be reviewed by a moderator. " ) }}

{{ _("Who are the moderators?") }}

{{ _( - "There is ten moderators who have been elected by the ten most funded project on Liberapay. " + "There is ten moderators who have been elected by the ten most funded projects on Liberapay. " "This ensure that Liberapay moderation is made by independent people concerned by the plateform safety. " ) }}

{{ _("What is the moderating process?") }}

{{ _( - "Once at least half of the moderators confirm that the user is suspicious," - "its account is closed and it can not received donation anymore. " - "All donations to the user are then cancelled." + "Once at least half of the moderators confirm that the account is suspicious," + "its account is closed and it can not receive donation anymore. " + "All donations to the account are then cancelled." ) }}