123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- {% extends "cranefly/layout.html" %}
- {% import "forms.html" as form_theme with context %}
- {% import "cranefly/macros.html" as macros with context %}
- {% block title %}{{ macros.page_title(title=_('Reported Posts'),page=pagination['page']) }}{% endblock %}
- {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
- <li class="active">{% trans %}Reported Posts{% endtrans %}
- {%- endblock %}
- {% block container %}
- <div class="page-header header-primary">
- <div class="container">
- {{ messages_list(messages) }}
- <ul class="breadcrumb" {{ macros.itemprop_bread() }}>
- {{ self.breadcrumb() }}</li>
- </ul>
- <h1>{% trans %}Reported Posts{% endtrans %}</h1>
- </div>
- </div>
- <div class="container container-primary">
- {% if message %}
- <div class="messages-list">
- {{ macros.draw_message(message) }}
- </div>
- {% endif %}
- <div class="forum-threads-extra extra-top">
- {{ pager() }}
- </div>
- <div class="forum-threads-list reports-list">
- <div class="header">
- <div class="row-fluid">
- <div class="span6 offset2">{% trans %}Report{% endtrans %}</div>
- <div class="span4 thread-activity">
- <div class="thread-replies">{% trans %}Activity{% endtrans %}</div>
- {% if list_form %}
- <div class="pull-right check-cell">
- <label class="checkbox"><input type="checkbox" class="checkbox-master"></label>
- </div>
- {% endif %}
- </div>
- </div>
- </div>
- {% for thread in threads %}
- <div class="thread-row{% if not thread.is_read %} thread-new{% endif %}{% if loop.last %} thread-last{% endif %}">
- <div class="row-fluid">
- <div class="span2 thread-label">
- {% if thread.weight == 2 %}
- <span class="report-label report-open"><i class="icon-time"></i> {% trans %}Open{% endtrans %}</span>
- {% elif thread.weight == 1 %}
- <span class="report-label report-resolved"><i class="icon-ok"></i> {% trans %}Resolved{% endtrans %}</span>
- {% else %}
- <span class="report-label report-bogus"><i class="icon-remove"></i> {% trans %}Bogus{% endtrans %}</span>
- {% endif %}
- </div>
- <div class="span6">
- {% if thread.deleted %}
- <ul class="unstyled thread-flags">
- <li class="flag-deleted"><i class="icon-trash tooltip-top" title="{% trans %}This thread is deleted{% endtrans %}"></i></li>
- </ul>
- {% endif %}
- <a href="{{ url('report', thread=thread.pk, slug=thread.slug) }}" class="thread-name{% if thread.name|length > 70 %} tooltip-top" title="{{ thread.name }}{% endif %}"><span class="report-id">#{{ thread.pk }}</span> {{ thread.name|short_string(70) }}</a>
- {% if thread.is_read %}
- <a href="{{ url('report_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Click to see last comment{% endtrans %}"><i class="icon-asterisk"></i></a>
- {% else %}
- <a href="{{ url('report_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Click to see first unread comment{% endtrans %}"><i class="icon-fire"></i></a>
- {% endif %}
- <div class="thread-details">
- {% if thread.report_forum %}
- {% trans user=thread_starter(thread), start=thread.start|reldate|low, forum=report_forum(thread) %}Post reported by {{ user }} {{ start }} in forum {{ forum }}{% endtrans %}
- {% else %}
- {% trans user=thread_starter(thread), start=thread.start|reldate|low %}Deleted post reported by {{ user }} {{ start }}{% endtrans %}
- {% endif %}
- </div>
- </div>
- <div class="span4 thread-activity">
- <div class="thread-replies">
- <strong class="lead">{{ thread_reply(thread) }}, {{ thread.last|reldate|low }}</strong><br>
- {{ replies(thread.replies) }}
- </div>
- {% if list_form %}
- <label class="thread-select checkbox"><input form="threads_form" name="{{ list_form['list_items']['html_name'] }}" type="checkbox" class="checkbox-member" value="{{ thread.pk }}"{% if list_form['list_items']['has_value'] and ('' ~ thread.pk) in list_form['list_items']['value'] %} checked="checked"{% endif %}></label>
- {% endif %}
- </div>
- </div>
- </div>
- {% else %}
- <div class="thread-row threads-list-empty">
- {% trans %}There are no reports currently. Whef!{% endtrans %}
- </div>
- {% endfor %}
- {% if list_form %}
- <div class="threads-actions">
- <form id="threads_form" class="form-inline pull-right" action="{{ request_path }}" method="POST">
- {{ form_theme.field(list_form.list_action, attrs={'class': 'span3'}) }}
- <button type="submit" class="btn btn-danger">{% trans %}Go{% endtrans %}</button>
- </form>
- </div>
- {% endif %}
- </div>
- <div class="forum-threads-extra">
- {{ pager() }}
- </div>
- </div>
- {% endblock %}
- {% macro replies(thread_replies) -%}
- {% trans count=thread_replies, replies=thread_replies|intcomma -%}
- {{ replies }} reply
- {%- pluralize -%}
- {{ replies }} replies
- {%- endtrans %}
- {%- endmacro %}
- {% macro thread_starter(thread) -%}
- {% if thread.start_poster_id %}<a href="{{ url('user', user=thread.start_poster_id, username=thread.start_poster_slug) }}" class="user-link">{{ thread.start_poster_name }}</a>{% else %}{{ thread.start_poster_name }}{% endif %}
- {%- endmacro %}
- {% macro thread_reply(thread) -%}
- {% if thread.last_poster_id %}<a href="{{ url('user', user=thread.last_poster_id, username=thread.last_poster_slug) }}" class="user-link">{{ thread.last_poster_name }}</a>{% else %}{{ thread.last_poster_name }}{% endif %}
- {%- endmacro %}
- {% macro report_forum(thread) -%}
- <a href="{{ thread.report_forum.url }}" class="forum-link">{{ thread.report_forum }}</a>
- {%- endmacro %}
- {% macro pager() %}
- {% if pagination['total'] > 0 %}
- <div class="pagination pull-left">
- <ul>
- <li class="count">{{ macros.pager_label(pagination) }}</li>
- {%- if pagination['prev'] > 1 %}<li><a href="{{ url('forum', slug=forum.slug, forum=forum.id) }}" class="tooltip-top" title="{% trans %}First Page{% endtrans %}"><i class="icon-chevron-left"></i> {% trans %}First{% endtrans %}</a></li>{% endif -%}
- {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{{ url('forum', slug=forum.slug, forum=forum.id, page=pagination['prev']) }}{% else %}{{ url('forum', slug=forum.slug, forum=forum.id) }}{% endif %}" class="tooltip-top" title="{% trans %}Newest Threads{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
- {%- if pagination['next'] > 0 %}<li><a href="{{ url('forum', slug=forum.slug, forum=forum.id, page=pagination['next']) }}" class="tooltip-top" title="{% trans %}Older Threads{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
- </ul>
- </div>
- {% endif %}
- {% endmacro %}
- {% block javascripts -%}{{ super() }}
- <script type="text/javascript">
- $(function () {
- function populateForumTooltip(target) {
- return $('#forum-' + target + ' .forum-meta').html();
- };
- {% for subforum in forum.subforums %}
- $('#forum-{{ subforum.id }} .forum-title').tooltip({
- template: '<div class="tooltip forum-meta-tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
- placement: 'right',
- html: true,
- title: populateForumTooltip({{ subforum.id }})
- });
- {% endfor %}
- {%- if list_form %}
- $('#threads_form').submit(function() {
- if ($('.thread-select[]:checked').length == 0) {
- alert("{% trans %}You have to select at least one thread.{% endtrans %}");
- return false;
- }
- if ($('#id_list_action').val() == 'hard') {
- var decision = confirm("{% trans %}Are you sure you want to delete selected reports? This action is not reversible!{% endtrans %}");
- return decision;
- }
- return true;
- });{% endif %}
- });
- </script>
- {%- endblock %}
|