mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
banning: Add the ability to set a note at ban time.
This commit is contained in:
@@ -788,6 +788,9 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
# the right one and update its data.
|
||||
c.user.friend_rels_cache(_update=True)
|
||||
c.user.add_friend_note(friend, note or '')
|
||||
|
||||
if type in ('banned', 'wikibanned'):
|
||||
container.add_rel_note(type, friend, note)
|
||||
|
||||
cls = dict(friend=FriendList,
|
||||
moderator=ModList,
|
||||
|
||||
@@ -5471,6 +5471,11 @@ body:not(.gold) .allminus-link {
|
||||
.rel-note.edited button[type=submit] { display: inline-block; }
|
||||
.rel-note.edited input[type=text] { width: 250px; margin-right: 0px; }
|
||||
|
||||
.friend-add.edited .ban-reason { display: block; }
|
||||
|
||||
.ban-reason {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gold-accent h1,
|
||||
.gold-accent th {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<% from r2.models import ModeratorPermissionSet %>
|
||||
<% from r2.lib.pages import ModeratorPermissions %>
|
||||
<form action="/post/${dest}"
|
||||
method="post" class="pretty-form medium-text"
|
||||
method="post" class="pretty-form medium-text friend-add"
|
||||
onsubmit="return post_form(this, '${dest}')"
|
||||
id="${add_type}">
|
||||
<h1>${title}</h1>
|
||||
@@ -35,7 +35,17 @@
|
||||
<input type="hidden" name="action" value="add">
|
||||
<input type="hidden" name="container" value="${container_name}">
|
||||
<input type="hidden" name="type" value="${add_type}">
|
||||
<input type="text" name="name" id="name">
|
||||
%if add_type in ("banned", "wikibanned"):
|
||||
<label for="name">${_('who to ban?')} </label>
|
||||
<input type="text" onfocus="$(this).parent('form').addClass('edited')" class="friend-name" name="name" id="name">
|
||||
<span class="ban-reason">
|
||||
<label for="note">${_('why the ban?')}</label>
|
||||
<input type="text" maxlength="300" name="note" id="note">
|
||||
<span>${_('(will not be visible to user)')}</span>
|
||||
</span>
|
||||
%else:
|
||||
<input type="text" name="name" id="name">
|
||||
%endif
|
||||
%if add_type == "moderator_invite":
|
||||
${ModeratorPermissions(None, 'moderator',
|
||||
ModeratorPermissionSet(all=True),
|
||||
|
||||
Reference in New Issue
Block a user