Skip to content

Commit

Permalink
Working on #2972 Template Conversion to Twig Format (modcp_reports) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Starpaul20 authored and euantorano committed Jun 2, 2019
1 parent b6e71f5 commit 9a01807
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 193 deletions.
35 changes: 35 additions & 0 deletions inc/views/base/modcp/allreports.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% extends 'layouts/master.twig' %}

{% block head %}
<title>{{ mybb.settings.bbname }} - {{ lang.all_reports }}</title>
{% endblock head %}

{% block body %}
<table width="100%" border="0" align="center">
<tr>
{# To do: modcp_nav #}
<td valign="top">
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder">
<tr>
<td class="thead" align="center" colspan="6"><strong>{{ lang.all_reports }}</strong></td>
</tr>
<tr>
<td class="tcat" width="30%"><span class="smalltext"><strong>{{ lang.report_info }}</strong></span></td>
<td class="tcat" width="20%"><span class="smalltext"><strong>{{ lang.report_type }}</strong></span></td>
<td class="tcat" align="center" width="15%"><span class="smalltext"><strong>{{ lang.reporter }}</strong></span></td>
<td class="tcat" align="center" width="10%"><span class="smalltext"><strong>{{ lang.report_count }}</strong></span></td>
<td class="tcat" align="center" width="15%"><span class="smalltext"><strong>{{ lang.report_time }}</strong></span></td>
</tr>
{% for report in allreports %}
{% include 'modcp/allreports/item.twig' %}
{% else %}
<tr>
<td class="trow1" align="center" colspan="5">{{ lang.no_reports }}</td>
</tr>
{% endfor %}
</table>
{{ multipage|raw }}
</td>
</tr>
</table>
{% endblock body %}
24 changes: 24 additions & 0 deletions inc/views/base/modcp/allreports/item.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set row = alt_trow() %}
<tr>
<td class="{{ row }}">
{% if report.type == 'reputation' %}
{{ trans('report_info_reputation', report.reputation_link, report.bad_user) }}
{{ trans('report_info_rep_profile', report.good_user) }}
{% elseif report.type == 'profile' %}
{{ trans('report_info_profile', report.profile_user) }}
{% elseif report.type == 'post' %}
{{ trans('report_info_post', report.post, report.user) }}
{{ trans('report_info_post_thread', report.thread_link, report.thread_subject) }}
{% endif %}
</td>
<td class="{{ row }}">
{% if report.comment %}
{{ report.reason }}: {{ report.comment }}
{% else %}
{{ report.reason }}
{% endif %}
</td>
<td class="{{ row }}" align="center"><a href="{{ report.reporterlink|raw }}" target="_blank">{{ report.username }}</a></td>
<td class="{{ row }}" align="center">{{ report.reports }}</td>
<td class="{{ row }}" align="center" style="white-space: nowrap"><span class="smalltext">{{ report.time|raw }}</span></td>
</tr>
65 changes: 65 additions & 0 deletions inc/views/base/modcp/reports.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{% extends 'layouts/master.twig' %}

{% block head %}
<title>{{ mybb.settings.bbname }} - {{ lang.report_center }}</title>
{% endblock head %}

{% block body %}
<form action="modcp.php" method="post">
<input type="hidden" name="my_post_key" value="{{ mybb.post_code }}" />
<input type="hidden" name="page" value="{{ report.page }}" />
<table width="100%" border="0" align="center">
<tr>
{# To do: modcp_nav #}
<td valign="top">
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder">
<tr>
<td class="thead" colspan="5"><strong>{{ lang.report_center }}</strong></td>
</tr>
<tr>
<td class="tcat" width="35%"><span class="smalltext"><strong>{{ lang.report_info }}</strong></span></td>
<td class="tcat" align="left" width="25%"><span class="smalltext"><strong>{{ lang.report_type }}</strong></span></td>
<td class="tcat" align="center" width="15%"><span class="smalltext"><strong>{{ lang.report_count }}</strong></span></td>
<td class="tcat" align="right" width="20%"><span class="smalltext"><strong>{{ lang.report_lastpost }}</strong></span></td>
<td class="tcat" align="center" width="5%"><input type="checkbox" name="allbox" onclick="inlineReports.checkAll(this);" /></td>
</tr>
{% if report.selectall %}
<tr id="selectAllrow" class="hiddenrow">
<td colspan="5" class="selectall">
{{ trans('page_selected', report.reportcache) }} <a href="javascript:void(0)" onclick='inlineReports.selectAll(); return false;'>{{ trans('select_all', report.report_count) }}</a>
</td>
</tr>
<tr id="allSelectedrow" class="hiddenrow">
<td colspan="5" class="selectall">
{{ trans('all_selected', report.report_count) }} <a href="javascript:void(0)" onclick='inlineReports.clearChecked(); return false;'>{{ lang.clear_selection }}</a>
</td>
</tr>
{% endif %}
{% for report in reports %}
{% include 'modcp/reports/item.twig' %}
{% else %}
<tr>
<td class="trow1" align="center" colspan="5">{{ lang.no_reports }}</td>
</tr>
{% endfor %}
<tr>
<td class="tfoot" colspan="5" align="right"><span class="smalltext"><strong><a href="modcp.php?action=allreports">{{ lang.view_all_reports }}</a></strong></span></td>
</tr>
</table>
{{ multipage|raw }}
<br />
<div align="center">
<input type="hidden" name="action" value="do_reports" />
<input type="submit" id="inline_read" class="button" name="reportsubmit" value="{{ lang.mark_read }} ({{ report.inlinecount }})" />
</div>
</td>
</tr>
</table>
</form>
<script type="text/javascript">
<!--
var mark_read_text = "{{ lang.mark_read }}";
var all_text = "{{ report.report_count }}";
// -->
</script>
{% endblock body %}
26 changes: 26 additions & 0 deletions inc/views/base/modcp/reports/item.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% set row = alt_trow() %}
<tr class="inline_row">
<td class="{{ row }}">
{% if report.type == 'reputation' %}
{{ trans('report_info_reputation', report.reputation_link, report.bad_user) }}
{{ trans('report_info_rep_profile', report.good_user) }}
{% elseif report.type == 'profile' %}
{{ trans('report_info_profile', report.profile_user) }}
{% elseif report.type == 'post' %}
{{ trans('report_info_post', report.post, report.user) }}
{{ trans('report_info_post_thread', report.thread_link, report.thread_subject) }}
{% endif %}
</td>
<td class="{{ row }}" align="left">
{% if report.comment %}
{{ report.reason }}: {{ report.comment }}
{% else %}
{{ report.reason }}
{% endif %}
</td>
<td class="{{ row }}" align="center">{{ report.reports }}</td>
<td class="{{ row }} smalltext" align="right">{{ report.lastreporter|raw }}</td>
<td class="{{ row }}" align="center">
<input type="checkbox" class="checkbox" name="reports[]" id="reports_{{ report.rid }}" value="{{ report.rid }}"{% if report.checked %} checked="checked"{% endif %} />
</td>
</tr>

0 comments on commit 9a01807

Please sign in to comment.