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

Add a report user button #1220

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions style/base/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ <h1>{{ participant.username }}</h1>
{{ _("Donate") }}
</a>
% endif
<a class="btn btn-signal btn-lg" href="{{ participant.path('signal') }}">
{{ _("Signal") }}
</a>
</div>
</div>
</div>
Expand Down
101 changes: 101 additions & 0 deletions www/%username/signal.spt
Original file line number Diff line number Diff line change
@@ -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() }}
<meta property="og:description"
content="{{ _('Support {username}\'s work with a recurrent donation.',
username=participant.username) }}">
% endblock

{% block heading %}{% endblock %}

% block content
<div class="row">
<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
<h2>{{ _("Signal {0}", ('<a href="/{0}">{0}</a>'|safe).format(participant.username)) }}</h2>

% if not participant.hide_receiving
% set goal, receiving = participant.goal, participant.receiving
% if goal
% if receiving
<p>{{ _(
"{0} currently receives {1} per week, they need your help to reach "
"their funding goal ({2} per week)."
, participant.username, receiving, goal
) }}</p>
% else
<p>{{ _(
"{0}'s goal is to receive {1} per week."
, participant.username, goal
) }} {{ _("Be the first to contribute!") }}</p>
% endif
% else
<p>{{ _(
"{0} currently receives {1} per week."
, participant.username, receiving
) }}</p>
% endif
% endif

<br>

% set e_accounts = participant.get_accounts_elsewhere()
% if e_accounts
<h3>{{ _("Recipient Identity") }}</h3>
<p>{{ _(
"We have confirmed through an automated verification process that "
"{0} has control of the following accounts on other platforms:",
participant.username
) }}</p>
% for platform in website.platforms if platform.name in e_accounts
{{ account_elsewhere(platform, e_accounts, None) }}
% endfor
<br>
% endif

% block form
<p>{{ _(
"Please add a short description why you want to report this user:"
) }}</p>

<form action="" method="POST" class="signal">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />

<div class="form-group">
<textarea name="signal" rows="15"
class="form-control signal vertical-resize"
placeholder={{ _("Say something.") }}
data-confirm-discard="{{ confirm_discard }}"
></textarea>
<p class="help-block pull-right">{{ _("Markdown supported.") }}
<a href="https://daringfireball.net/projects/markdown/basics"
target="_blank" rel="noopener noreferrer">{{ _("What is Markdown?") }}</a>
</p>
</div>

<button class="signal btn btn-success" name="signal" value="true">{{ _("Signal") }}</button>
% endblock

<h3>{{ _("Frequently Asked Questions") }}</h3>

<h4>{{ _("What happen when I signal a user") }}</h4>
<p>{{ _(
"The profil will be review by the moderator. "
Copy link
Contributor

Choose a reason for hiding this comment

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

"The profile will be reviewed by a moderator."

) }}</p>

</div>
</div>
% endblock