-
-
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
…3162) * Working on #2972 Template Conversion to Twig Format (reputation.php) Part 1 - User reputation page * Working on #2972 Template Conversion to Twig Format (reputation.php) Part 2 - Adding reputation * Fixed indentation
- Loading branch information
1 parent
4cf0932
commit 697167d
Showing
8 changed files
with
768 additions
and
743 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,61 @@ | ||
<div class="modal"> | ||
<div style="overflow-y: auto; max-height: 400px;" class="modal_{{ user.uid }}_{{ vote_check.pid }}"> | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<tr> | ||
<td class="trow1" style="padding: 20px"> | ||
<strong> | ||
{% if existing_reputation.uid %} | ||
{{ trans('update_reputation_vote', user.username) }} | ||
{% else %} | ||
{{ trans('add_reputation_vote', user.username) }} | ||
{% endif %} | ||
</strong><br /> | ||
{% if vote_check.pid %} | ||
{{ trans('add_reputation_to_post', user.username) }} | ||
{% endif %} | ||
<br /> | ||
<form action="reputation.php" method="post" class="reputation_{{ user.uid }}_{{ vote_check.pid }}" onsubmit="return MyBB.submitReputation({{ user.uid }}, {{ vote_check.pid }});"> | ||
<input type="hidden" name="my_post_key" value="{{ mybb.post_code }}" /> | ||
<input type="hidden" name="action" value="do_add" /> | ||
<input type="hidden" name="uid" value="{{ user.uid }}" /> | ||
<input type="hidden" name="pid" value="{{ vote_check.pid }}" /> | ||
<input type="hidden" name="rid" value="{{ vote_check.rid }}" /> | ||
<input type="hidden" name="nomodal" value="1" /> | ||
<select name="reputation" id="reputation"> | ||
{% if mybb.settings.posrep %} | ||
{% for power in range(mybb.usergroup.reputationpower, 1) %} | ||
<option value="{{ power }}" class="reputation_positive" onclick="$('#reputation').attr('class', 'reputation_positive');"{% if vote_check.power %} selected="selected"{% endif %}>{{ trans('power_positive', power) }}</option> | ||
{% endfor %} | ||
{% endif %} | ||
{% if mybb.settings.neurep %} | ||
<option value="0" class="reputation_neutral" onclick="$('#reputation').attr('class', 'reputation_neutral');"{% if vote_check.0 %} selected="selected"{% endif %}>{{ lang.power_neutral }}</option> | ||
{% endif %} | ||
{% if mybb.settings.negrep %} | ||
{% for power in range(1, mybb.usergroup.reputationpower) %} | ||
<option value="-{{ power }}" class="reputation_negative" onclick="$('#reputation').attr('class', 'reputation_negative');"{% if vote_check.power %} selected="selected"{% endif %}>{{ trans('power_negative', -power) }}</option> | ||
{% endfor %} | ||
{% endif %} | ||
</select> | ||
<br /><br /> | ||
<span class="smalltext"> | ||
{% if vote_check.pid %} | ||
{{ lang.no_comment_needed|raw }} | ||
{% else %} | ||
{{ trans('user_comments', user.username) }} | ||
{% endif %} | ||
</span> | ||
<br /> | ||
<input type="text" class="textbox" name="comments" size="35" maxlength="250" value="{{ existing_reputation.comments }}" style="width: 95%" /> | ||
<br /><br /> | ||
<div style="text-align: center;"> | ||
<input type="submit" class="button" value="{% if existing_reputation.uid %}{{ lang.update_vote }}{% else %}{{ lang.add_vote }}{% endif %}" /> | ||
{% if existing_reputation.show_delete %} | ||
<input type="button" class="button" name="delete" value="{{ lang.delete_vote }}" onclick="return MyBB.submitReputation({{ user.uid }}, {{ vote_check.pid }}, 1);" /> | ||
{% endif %} | ||
</div> | ||
</form> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> |
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,12 @@ | ||
<div class="modal"> | ||
<div style="overflow-y: auto; max-height: 400px;"> | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<tr> | ||
<td class="trow1" style="padding: 20px"> | ||
<strong>{{ lang.error }}</strong><br /><br /> | ||
<blockquote>{{ message }}</blockquote> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> |
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,8 @@ | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<tr> | ||
<td class="trow1" style="padding: 20px"> | ||
<strong>{{ lang.error }}</strong><br /><br /> | ||
<blockquote>{{ message }}</blockquote> | ||
</td> | ||
</tr> | ||
</table> |
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,8 @@ | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<tr> | ||
<td class="trow1" style="padding: 20px"> | ||
<strong>{{ lang.vote_added }}</strong><br /><br /> | ||
<blockquote>{{ lang.vote_added_message }}</blockquote> | ||
</td> | ||
</tr> | ||
</table> |
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,8 @@ | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<tr> | ||
<td class="trow1" style="padding: 20px"> | ||
<strong>{{ lang.vote_deleted }}</strong><br /><br /> | ||
<blockquote>{{ lang.vote_deleted_message }}</blockquote> | ||
</td> | ||
</tr> | ||
</table> |
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,109 @@ | ||
{% extends 'layouts/master.twig' %} | ||
|
||
{% block head %} | ||
<title>{{ mybb.settings.bbname }} - {{ trans('reputation_report', user.username) }}</title> | ||
|
||
<script type="text/javascript"> | ||
<!-- | ||
var delete_reputation_confirm = "{{ lang.delete_reputation_confirm }}"; | ||
// --> | ||
</script> | ||
<script type="text/javascript" src="{{ asset_url('jscripts/report.js') }}"></script> | ||
{% endblock head %} | ||
|
||
{% block body %} | ||
{% if user.show_add_reputation %} | ||
<div class="float_right" style="padding-bottom: 4px;"> | ||
<a href="javascript:void(0)" onclick="MyBB.reputation({{ user.uid }}); return false;" class="button rate_user_button"><span>{{ lang.rate_user }}</span></a> | ||
</div> | ||
{% endif %} | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder clear"> | ||
<tr> | ||
<td class="thead"><strong>{{ trans('reputation_report', user.username) }}</strong></td> | ||
</tr> | ||
<tr> | ||
<td class="tcat"><strong>{{ lang.summary }}</strong></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1"> | ||
<table width="100%" cellspacing="0" cellpadding="0" border="0"> | ||
<tr> | ||
<td> | ||
<span class="largetext"><strong>{{ user.user_name|raw }}</strong></span><br /> | ||
<span class="smalltext"> | ||
({{ user.user_title }})<br /> | ||
<br /> | ||
<strong>{{ lang.total_reputation }}:</strong> <span class="repbox {{ user.total_class }}">{{ user.rep_total }}</span><br /><br /> | ||
<strong>{{ lang.reputation_members }} {{ user.rep_members }}</strong><br /> | ||
<strong>{{ lang.reputation_posts }} {{ user.rep_posts }}</strong> | ||
</span> | ||
</td> | ||
<td align="right" style="width: 300px;"> | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder trow2"> | ||
<tr> | ||
<td> </td> | ||
<td><span class="smalltext reputation_positive">{{ lang.positive_count }}</span></td> | ||
<td><span class="smalltext reputation_neutral">{{ lang.neutral_count }}</span></td> | ||
<td><span class="smalltext reputation_negative">{{ lang.negative_count }}</span></td> | ||
</tr> | ||
<tr> | ||
<td style="text-align: right;"><span class="smalltext">{{ lang.last_week }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.positive_week }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.neutral_week }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.negative_week }}</span></td> | ||
</tr> | ||
<tr> | ||
<td style="text-align: right;"><span class="smalltext">{{ lang.last_month }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.positive_month }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.neutral_month }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.negative_month }}</span></td> | ||
</tr> | ||
<tr> | ||
<td style="text-align: right;"><span class="smalltext">{{ lang.last_6months }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.positive_6months }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.neutral_6months }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.negative_6months }}</span></td> | ||
</tr> | ||
<tr> | ||
<td style="text-align: right;"><span class="smalltext">{{ lang.all_time }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.positive_count }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.neutral_count }}</span></td> | ||
<td style="text-align: center;"><span class="smalltext">{{ user.negative_count }}</span></td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="tcat"><strong>{{ lang.comments }}</strong></td> | ||
</tr> | ||
{% for reputation_vote in reputation_votes %} | ||
{% include 'reputation/reputation_vote.twig' %} | ||
{% else %} | ||
<tr> | ||
<td class="trow1" style="text-align: center;">{{ lang.no_reputation_votes }}</td> | ||
</tr> | ||
{% endfor %} | ||
<tr> | ||
<td class="tfoot" align="right"> | ||
<form action="reputation.php" method="get"> | ||
<input type="hidden" name="uid" value="{{ user.uid }}" /> | ||
<select name="show"> | ||
<option value="all"{% if select.show.all %} selected="selected"{% endif %}>{{ lang.show_all }}</option> | ||
<option value="positive"{% if select.show.positive %} selected="selected"{% endif %}>{{ lang.show_positive }}</option> | ||
<option value="neutral"{% if select.show.neutral %} selected="selected"{% endif %}>{{ lang.show_neutral }}</option> | ||
<option value="negative"{% if select.show.negative %} selected="selected"{% endif %}>{{ lang.show_negative }}</option> | ||
</select> | ||
<select name="sort"> | ||
<option value="dateline"{% if select.sort.last_updated %} selected="selected"{% endif %}>{{ lang.sort_updated }}</option> | ||
<option value="username"{% if select.sort.username %} selected="selected"{% endif %}>{{ lang.sort_username }}</option> | ||
</select> | ||
<input type="submit" class="button" value="{{ lang.go }}" /> | ||
</form> | ||
</td> | ||
</tr> | ||
</table> | ||
{{ multipage|raw }} | ||
{% 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,28 @@ | ||
<tr> | ||
<td class="trow1 {{ reputation_vote.status_class }}" id="rid{{ reputation_vote.rid }}"> | ||
{% if mybb.user.uid %} | ||
<div class="float_right postbit_buttons"> | ||
<a href="javascript:void(0)" onclick="Report.reportReputation({{ reputation_vote.rid }}); return false;" class="postbit_report"><span>{{ lang.report_vote }}</span></a> | ||
</div> | ||
{% endif %} | ||
{% if reputation_vote.can_delete %} | ||
<div class="float_right postbit_buttons"> | ||
<a href="reputation.php?action=delete&uid={{ reputation_vote.rated_uid }}&rid={{ reputation_vote.rid }}&my_post_key={{ mybb.post_code }}" onclick="MyBB.deleteReputation({{ reputation_vote.rated_uid }}, {{ reputation_vote.rid }}); return false;" class="postbit_qdelete"> | ||
<span>{{ lang.delete_vote }}</span> | ||
</a> | ||
</div> | ||
{% endif %} | ||
{{ reputation_vote.username|raw }} | ||
<span class="smalltext">{{ reputation_vote.user_reputation|raw }} - {{ trans('last_updated', reputation_vote.last_updated) }}<br /> | ||
{% if reputation_vote.pid %} | ||
{% if reputation_vote.postrep_perm %} | ||
{{ trans('postrep_given', reputation_vote.post_link, user.username, reputation_vote.thread_link) }} | ||
{% else %} | ||
{{ trans('postrep_given_nolink', user.username) }} | ||
{% endif %} | ||
{% endif %} | ||
</span> | ||
<br /> | ||
<strong class="{{ reputation_vote.vote_type_class }}">{{ reputation_vote.vote_type }} ({{ reputation_vote.vote_reputation }}):</strong> {{ reputation_vote.comments|raw }} | ||
</td> | ||
</tr> |
Oops, something went wrong.