-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…2975) * Working on #2972 Template Conversion to Twig Format (warnings.php) Part 1 - User warning log * Coding standards * Working on #2972 Template Conversion to Twig Format (warnings.php) Part 2 - Warning details * Working on #2972 Template Conversion to Twig Format (warnings.php) Part 3 - Warning a user
- Loading branch information
1 parent
97b3aed
commit 9bca15a
Showing
5 changed files
with
747 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{% extends 'layouts/master.twig' %} | ||
|
||
{% block head %} | ||
<title>{{ mybb.settings.bburl }} - {{ lang.warning_log }}</title> | ||
{% endblock head %} | ||
|
||
{% block body %} | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<tr> | ||
<td class="thead" colspan="2"> | ||
<div class="float_right">{{ warning.status }}</div> | ||
<div><strong>{{ lang.warning_details }}</strong></div> | ||
</td> | ||
</tr> | ||
{% if warning.post_subject %} | ||
<tr> | ||
<td class="tcat" width="50%"><span class="smalltext"><strong>{{ lang.username }}</strong></span></td> | ||
<td class="tcat" width="50%"><span class="smalltext"><strong>{{ lang.post }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1">{{ user.user_link|raw }}</td> | ||
<td class="trow1"><a href="{{ warning.post_link|raw }}#pid{{ warning.pid }}">{{ warning.post_subject }}</a></td> | ||
</tr> | ||
{% else %} | ||
<tr> | ||
<td class="tcat" colspan="2"><span class="smalltext"><strong>{{ lang.details_username }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1" colspan="2">{{ user.user_link|raw }}</td> | ||
</tr> | ||
{% endif %} | ||
<tr> | ||
<td class="tcat" width="50%"><span class="smalltext"><strong>{{ lang.warning }}</strong></span></td> | ||
<td class="tcat" width="50%"><span class="smalltext"><strong>{{ lang.date_issued }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow2">{{ warning.warning_type }} {{ trans('warning_points', warning.points) }}</td> | ||
<td class="trow2">{{ warning.date_issued|raw }}</td> | ||
</tr> | ||
<tr> | ||
<td class="tcat" width="50%"><span class="smalltext"><strong>{{ lang.issued_by }}</strong></span></td> | ||
<td class="tcat" width="50%"><span class="smalltext"><strong>{{ lang.expiry_date }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1">{{ warning.issuedby|raw }}</td> | ||
<td class="trow1">{{ warning.expires }} {{ warning.revoked_date }}</td> | ||
</tr> | ||
<tr> | ||
<td class="tcat" colspan="2"><span class="smalltext"><strong>{{ lang.details_warning_note }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow2" colspan="2"> {{ warning.notes }}</td> | ||
</tr> | ||
</table> | ||
<br /> | ||
{% if warning.daterevoked %} | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder clear"> | ||
<tr> | ||
<td class="thead" colspan="2"><strong>{{ lang.warning_is_revoked }}</strong></td> | ||
</tr> | ||
<tr> | ||
<td class="tcat" style="width: 50%;"><span class="smalltext"><strong>{{ lang.revoked_by }}</strong></span></td> | ||
<td class="tcat"><span class="smalltext"><strong>{{ lang.date_revoked }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1">{{ revoked_user.profile|raw }}</td> | ||
<td class="trow1">{{ warning.daterevoked|raw }}</td> | ||
</tr> | ||
<tr> | ||
<td class="tcat" colspan="2"><span class="smalltext"><strong>{{ lang.details_reason }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow2" colspan="2">{{ warning.revokereason }}</td> | ||
</tr> | ||
</table> | ||
{% else %} | ||
{{ warn_errors|raw }} | ||
<form action="warnings.php" method="post" name="input"> | ||
<input type="hidden" name="my_post_key" value="{{ mybb.post_code }}" /> | ||
<input type="hidden" name="action" value="do_revoke" /> | ||
<input type="hidden" name="wid" value="{{ warning.wid }}" /> | ||
|
||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder clear"> | ||
<tr> | ||
<td class="thead" colspan="2"><strong>{{ lang.revoke_warning }}</strong></td> | ||
</tr> | ||
<tr> | ||
<td class="tcat" colspan="2"><span class="smalltext"><strong>{{ lang.revoke_warning_desc }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1" style="width: 20%; vertical-align: top;"><strong>{{ lang.reason }}</strong></td> | ||
<td class="trow1"><textarea name="reason" cols="60" rows="4"></textarea></td> | ||
</tr> | ||
</table> | ||
<br /> | ||
<div style="text-align: center;"><input type="submit" class="button" value="{{ lang.revoke_warning }}" /></div> | ||
</form> | ||
{% endif %} | ||
{% endblock body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
{% extends 'layouts/master.twig' %} | ||
|
||
{% block head %} | ||
<title>{{ mybb.settings.bburl }} - {{ lang.warn_user }}</title> | ||
{% endblock head %} | ||
|
||
{% block body %} | ||
{% if warnings %} | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<thead> | ||
<tr> | ||
<td class="thead" colspan="5"> | ||
<div><strong>{{ lang.existing_post_warnings }}</strong></div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="tcat"><span class="smalltext"><strong>{{ lang.warning }}</strong></span></td> | ||
<td class="tcat" width="20%" align="center"><span class="smalltext"><strong>{{ lang.date_issued }}</strong></span></td> | ||
<td class="tcat" width="20%" align="center"><span class="smalltext"><strong>{{ lang.expiry_date }}</strong></span></td> | ||
<td class="tcat" width="20%" align="center"><span class="smalltext"><strong>{{ lang.issued_by }}</strong></span></td> | ||
<td class="tcat" width="1" align="center"><span class="smalltext"><strong>{{ lang.details }}</strong></span></td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for warning in warnings %} | ||
{% include 'warnings/warning_row.twig' %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
<br /> | ||
{% endif %} | ||
{{ warn_errors|raw }} | ||
<form action="warnings.php" method="post" name="input"> | ||
<input type="hidden" name="my_post_key" value="{{ mybb.post_code }}" /> | ||
<input type="hidden" name="action" value="do_warn" /> | ||
<input type="hidden" name="uid" value="{{ user.uid }}" /> | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder clear"> | ||
<tr> | ||
<td class="thead" colspan="2"><strong>{{ lang.warn_user }}</strong></td> | ||
</tr> | ||
<tr> | ||
<td class="tcat" colspan="2"><span class="smalltext"><strong>{{ lang.warn_user_desc }}</strong></span></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1" style="width: 20%;"><strong>{{ lang.username }}</strong></td> | ||
<td class="trow1">{{ user.user_link|raw }}</td> | ||
</tr> | ||
{% if post.pid %} | ||
<tr> | ||
<td width="20%" class="trow2"><strong>{{ lang.post }}</strong></td> | ||
<td class="trow2"><input type="hidden" name="pid" value="{{ post.pid }}" /><a href="{{ post.link }}">{{ post.subject }}</a></td> | ||
</tr> | ||
{% endif %} | ||
<tr> | ||
<td class="trow1" style="width: 20%; vertical-align: top;"><strong>{{ lang.warning_note }}</strong></td> | ||
<td class="trow1"><textarea name="notes" cols="60" rows="4">{{ type_checked.notes }}</textarea></td> | ||
</tr> | ||
<tr> | ||
<td class="trow2" style="width: 20%; vertical-align: top;"><strong>{{ lang.warning_type }}</strong></td> | ||
<td class="trow2"> | ||
<script type="text/javascript"> | ||
// <!-- | ||
function checkType(id) | ||
{ | ||
var checked = ''; | ||
$('.types_check').each(function(e, val) | ||
{ | ||
if($(this).prop('checked') == true) | ||
{ | ||
checked = $(this).val(); | ||
} | ||
}); | ||
$('.types').each(function(e) | ||
{ | ||
$(this).hide(); | ||
}); | ||
if($('#type_'+checked)) | ||
{ | ||
$('#type_'+checked).show(); | ||
} | ||
} | ||
// --> | ||
</script> | ||
<dl style="margin-top: 0; margin-bottom: 0; width: 100%;"> | ||
{% for type in types %} | ||
<dt><label style="display: block;"><input type="radio" name="type" value="{{ type.tid }}" {{ type_checked.tid }} class="types_check" onclick="checkType();" style="vertical-align: middle;" /> <strong>{{ type.title }}</strong> {{ trans('warning_points', type.points) }}</label></dt> | ||
<dd style="margin-top: 4px;" id="type_{{ type.tid }}" class="types"> | ||
<div class="smalltext">{{ lang.new_warning_level }}</div> | ||
<div class="tborder float_left" style="width: 150px; margin: 0; padding: 1px;"> | ||
<div class="trow1 float_left" style="width: {{ user.currentlevel }}%;"> </div> | ||
<div class="trow2 float_left" style="width: {{ type.level_diff }}%;"> </div> | ||
</div> | ||
<div class="float_left" style="padding-left: 10px; font-weight: bold;">{{ type.new_warning_level }}%</div><br style="clear: left;" /> | ||
{% if type.action %} | ||
<div class="smalltext" style="clear: left; padding-top: 4px;">{{ lang.result }}<br />{{ type.action.friendly_action }}</div> | ||
{% endif %} | ||
</dd> | ||
{% endfor %} | ||
{% if mybb.settings.allowcustomwarnings %} | ||
<dt><label style="display: block;"><input type="radio" name="type" value="custom" {{ type_checked.custom }} class="types_check" onclick="checkType();" style="vertical-align: middle;" /> <strong>{{ lang.custom }}</strong></label></dt> | ||
<dd style="margin-top: 4px;" id="type_custom" class="types"> | ||
<table> | ||
<tr> | ||
<td class="smalltext">{{ lang.reason }}</td> | ||
<td class="smalltext">{{ lang.points }}</td> | ||
</tr> | ||
<tr> | ||
<td><input type="text" class="textbox" name="custom_reason" size="50" maxlength="120" value="{{ type_checked.custom_reason }}" /></td> | ||
<td><input type="text" class="textbox" name="custom_points" size="2" value="{{ type_checked.custom_points }}" /></td> | ||
</tr> | ||
<tr> | ||
<td class="smalltext" colspan="2" style="padding-top: 4px;">{{ lang.expires }}</td> | ||
</tr> | ||
<tr> | ||
<td colspan="2"> | ||
<input type="text" class="textbox" name="expires" size="2" value="{{ type_checked.expires }}" /> | ||
<select name="expires_period"> | ||
<option value="hours" {{ type_checked.hours }}>{{ lang.hour_or_hours }}</option> | ||
<option value="days" {{ type_checked.days }}>{{ lang.day_or_days }}</option> | ||
<option value="weeks" {{ type_checked.weeks }}>{{ lang.week_or_weeks }}</option> | ||
<option value="months" {{ type_checked.months }}>{{ lang.month_or_months }}</option> | ||
<option value="never" {{ type_checked.never }}>{{ lang.never }}</option> | ||
</select> | ||
</td> | ||
</tr> | ||
</table> | ||
</dd> | ||
{% endif %} | ||
</dl> | ||
<script type="text/javascript"> | ||
// <!-- | ||
checkType(); | ||
// --> | ||
</script> | ||
</td> | ||
</tr> | ||
{% if pm.haspermission == true %} | ||
<tr> | ||
<td width="20%" class="trow1" valign="top"> | ||
<strong>{{ lang.send_pm }}</strong> | ||
</td> | ||
<td class="trow1"> | ||
<script type="text/javascript"> | ||
// <!-- | ||
function togglePM() | ||
{ | ||
if($('#send_pm').prop('checked') == true) | ||
{ | ||
$('#pm_input').show(); | ||
$('#pm_smilie_insert').show(); | ||
} | ||
else | ||
{ | ||
$('#pm_input').hide(); | ||
} | ||
} | ||
// --> | ||
</script> | ||
<label style="display: block;"><input type="checkbox" class="checkbox" value="1" name="send_pm" id="send_pm" onclick="togglePM();" style="vertical-align: middle;" {{ type_checked.send_pm_checked }} /> {{ lang.send_user_warning_pm }}</label> | ||
<table id="pm_input" cellpadding="{{ theme.tablespace }}"> | ||
<tr> | ||
<td><strong>{{ lang.send_pm_subject }}</strong></td> | ||
<td><input type="text" class="textbox" name="pm_subject" size="40" maxlength="85" value="{{ type_checked.pm_subject }}" /></td> | ||
</tr> | ||
<tr> | ||
<td valign="top"><strong>{{ lang.send_pm_message }}</strong></td> | ||
<td><textarea name="pm_message" id="message" rows="20" cols="70">{{ type_checked.message }}</textarea> | ||
{{ pm.codebuttons|raw }}</td> | ||
</tr> | ||
{% if mybb.settings.allowanonwarningpms %} | ||
<tr> | ||
<td><strong>{{ lang.send_pm_options }}</strong></td> | ||
<td><label><input type="checkbox" class="checkbox" name="pm_anonymous" value="1"{{ pm.anonymous_checked }} /> {{ lang.send_pm_options_anonymous|raw }}</label></td> | ||
</tr> | ||
{% endif %} | ||
</table> | ||
<script type="text/javascript"> | ||
<!-- | ||
$(document).ready(function() { | ||
togglePM(); | ||
}); | ||
// --> | ||
</script> | ||
</td> | ||
</tr> | ||
{% endif %} | ||
</table> | ||
<br /> | ||
<div style="text-align: center;"><input type="submit" class="button" value="{{ lang.warn_user }}" /></div> | ||
</form> | ||
{% endblock body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% set row = alt_trow() %} | ||
{% if warning.active == 1 %} | ||
<tr> | ||
<td class="trow_sep" colspan="5">{{ lang.active_warnings }}</td> | ||
</tr> | ||
{% endif %} | ||
{% if warning.active == 2 %} | ||
<tr> | ||
<td class="trow_sep" colspan="5">{{ lang.expired_warnings }}</td> | ||
</tr> | ||
{% endif %} | ||
<tr> | ||
<td class="{{ row }}"> | ||
{{ warning.warning_type }} {{ trans('warning_points', warning.points) }} | ||
{% if warning.post_subject %} | ||
<br /><small>{{ lang.warning_for_post }} <a href="{{ warning.post_link|raw }}#pid{{ warning.pid }}">{{ warning.post_subject }}</a></small> | ||
{% endif %} | ||
</td> | ||
<td class="{{ row }}" style="text-align: center;"> | ||
{{ warning.date_issued|raw }} | ||
</td> | ||
<td class="{{ row }}" style="text-align: center;"> | ||
{{ warning.expires }} | ||
</td> | ||
<td class="{{ row }}" style="text-align: center;"> | ||
{{ warning.issuedby|raw }} | ||
</td> | ||
<td class="{{ row }}" style="text-align: center;"> | ||
<a href="warnings.php?action=view&wid={{ warning.wid }}">{{ lang.view }}</a> | ||
</td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% extends 'layouts/master.twig' %} | ||
|
||
{% block head %} | ||
<title>{{ mybb.settings.bburl }} - {{ lang.warning_log }}</title> | ||
{% endblock head %} | ||
|
||
{% block body %} | ||
{{ multipage|raw }} | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<thead> | ||
<tr> | ||
<td class="thead" colspan="5"> | ||
{% if warning_level > 0 %} | ||
<div class="float_right">{{ trans('current_warning_level', warning_level, user.warningpoints, mybb.settings.maxwarningpoints)|raw }}</div> | ||
{% endif %} | ||
<div><strong>{{ lang.warning_log }}</strong></div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="tcat"><span class="smalltext"><strong>{{ lang.warning }}</strong></span></td> | ||
<td class="tcat" width="20%" align="center"><span class="smalltext"><strong>{{ lang.date_issued }}</strong></span></td> | ||
<td class="tcat" width="20%" align="center"><span class="smalltext"><strong>{{ lang.expiry_date }}</strong></span></td> | ||
<td class="tcat" width="20%" align="center"><span class="smalltext"><strong>{{ lang.issued_by }}</strong></span></td> | ||
<td class="tcat" width="1" align="center"><span class="smalltext"><strong>{{ lang.details }}</strong></span></td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for warning in warnings %} | ||
{% include 'warnings/warning_row.twig' %} | ||
{% else %} | ||
<tr> | ||
<td class="trow1" colspan="5" align="center">{{ lang.no_warnings }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{{ multipage|raw }} | ||
{% endblock body %} |
Oops, something went wrong.