adds feature #191
This commit is contained in:
parent
09844ef759
commit
626b002762
23 changed files with 95 additions and 59 deletions
|
@ -88,6 +88,10 @@ div > div > div.postfootright {
|
|||
}
|
||||
/* End of IEWin Fix */
|
||||
|
||||
#brdmenu strong {
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hidden
|
||||
*/
|
||||
|
|
|
@ -96,6 +96,9 @@
|
|||
.blockform p input {
|
||||
margin-right: 6px;
|
||||
}
|
||||
#brdmenu .conr li {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Tables
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-name %}{% trans "New Topic" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="linkst">
|
||||
<ul>
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-category %}Scratch Forums{% endblock page-category %}
|
||||
|
||||
<title>{{ forum_settings.FORUM_BASE_TITLE }} {% block title %}{% endblock %}</title>
|
||||
{% block page-category %}{% trans "Scratch Forums" %}{% endblock page-category %}
|
||||
|
||||
{% block extra_meta %}
|
||||
<meta name="description" content="{{ forum_settings.FORUM_META_DESCRIPTION }} " />
|
||||
|
@ -93,16 +91,7 @@
|
|||
<div id="brdfooter" class="box">
|
||||
<div class="box-content">
|
||||
<p class="conr">Powered by <a href="http://djangobb.org/">DjangoBB</a></p>
|
||||
{% block controls %}
|
||||
<dl id="searchlinks" class="conl">
|
||||
<dt><strong>{% trans "Search links" %}</strong></dt>
|
||||
<dd><a href="{% url djangobb:search %}?action=show_24h">{% trans "Show recent posts" %}</a></dd>
|
||||
<dd><a href="{% url djangobb:search %}?action=show_unanswered">{% trans "Show unanswered posts" %}</a></dd>
|
||||
{% if user.is_authenticated %}
|
||||
<dd>{% trans "Show your" %} <a href="{% url djangobb:search %}?action=show_user&show_as=topics">{% trans "topics" %}</a>/<a href="{% url djangobb:search %}?action=show_user&show_as=posts">{% trans "posts" %}</a></dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
{% endblock controls %}
|
||||
{% block controls %}{% endblock controls %}
|
||||
<div class="clearer"></div>
|
||||
{% block lofi %}{% endblock lofi%}
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
{% load i18n %}
|
||||
{% load tz %}
|
||||
|
||||
{% block page-name %}{% blocktrans with name=topic.name %}Delete Posts - {{name}}{% endblocktrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% autopaginate posts forum_settings.TOPIC_PAGE_SIZE %}
|
||||
<div class="linkst">
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-name %}{% blocktrans with name=topic.name %}Edit Post - {{name}}{% endblocktrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="linkst">
|
||||
<div class="inbox">
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
{% load i18n %}
|
||||
{% load tz %}
|
||||
|
||||
{% block title %} / {{ forum.name }}{% endblock %}
|
||||
{% block page-name %}{{ forum.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% autopaginate topics forum_settings.FORUM_PAGE_SIZE %}
|
||||
<div class="linkst">
|
||||
|
|
|
@ -10,52 +10,28 @@
|
|||
<p><span>{{ forum_settings.TAGLINE|safe }}</span></p>
|
||||
</div>
|
||||
<div id="brdmenu" class="box-content">
|
||||
<ul>
|
||||
{% block menu %}
|
||||
<li id="navindex"><a href="{% url djangobb:index %}">{% trans "Forums Home" %}</a></li>
|
||||
{% if moderator %}
|
||||
<li id="navuserlist" class="moderator-only"><a href="{% url djangobb:forum_users %}">{% trans "User List" %}</a></li>
|
||||
{% endif %}
|
||||
<li id="navsearch"><a href="{% url djangobb:search %}">{% trans "Search" %}</a></li>
|
||||
{% if user.is_superuser %}
|
||||
<li id="navadmin" class="admin-only"><a href="{% url admin:index %}">{% trans "Administration" %}</a></li>
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
<li id="navprofile"><a href="{% url djangobb:forum_profile_personality request.user %}">{% trans "Settings" %}</a></li>
|
||||
{% comment %}
|
||||
<li id="navprofile"><a href="{% url djangobb:forum_profile request.user %}">{% trans "Profile" %}</a></li>
|
||||
{% endcomment %}
|
||||
{% if forum_settings.PM_SUPPORT %}
|
||||
<li id="navpm"><a href="{% url messages_inbox %}">{% trans "PM" %}</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
<div id="brdwelcome" class="box-content">
|
||||
<ul class="conl">
|
||||
{% if user.is_authenticated %}
|
||||
<li>{% trans "Logged in as" %} <strong>{{ user.username }}</strong></li>
|
||||
<li>{% trans "Last visit:" %} {{ user.last_login|localtime|forum_time }}</li>
|
||||
{% if forum_settings.PM_SUPPORT and messages_inbox_count > 0 %}
|
||||
<ul><li class="pmlink"><strong><a href="{% url messages_inbox %}">{% trans "There are new messages" %} ({{ messages_inbox_count }})</a></strong></li></ul>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<li>{% trans "You are not logged in." %}</li>
|
||||
{% endif %}
|
||||
{% with user|forum_reports as report_count %}
|
||||
{% if report_count %}
|
||||
<li class="reportlink"><strong><a href="{% url djangobb:forum_reports %}">{% blocktrans %}There are new reports ({{ report_count }}){% endblocktrans %}</a></strong></li>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</ul>
|
||||
{% if user.is_authenticated %}
|
||||
<ul class="conr">
|
||||
<li><a href="{% url djangobb:search %}?action=show_new">{% trans "Show new posts since last visit" %}</a></li>
|
||||
<li><a href="{% url djangobb:misc %}?action=markread">{% trans "Mark all topics as read" %}</a></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
<div class="clearer"></div>
|
||||
<ul>
|
||||
{% block menu %}
|
||||
<li id="navindex"><a href="{% url djangobb:index %}">{% trans "Forums Home" %}</a></li>
|
||||
<li id="navsearch"><a href="{% url djangobb:search %}">{% trans "Search" %}</a></li>
|
||||
{% if user|forum_can_view_reports %}
|
||||
<li class="moderator-only"><a href="{% url djangobb:forum_reports %}">
|
||||
{% with user|forum_reports as report_count %}
|
||||
{% if report_count %}
|
||||
<strong>{% blocktrans %}Reports ({{ report_count }}){% endblocktrans %}</strong>
|
||||
{% else %}
|
||||
{% trans "Reports" %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-title %}{% trans "Scratch Forums" %}{% endblock %}
|
||||
|
||||
{% block extra_meta %}
|
||||
<script type="text/javascript">
|
||||
|
||||
|
@ -69,6 +71,16 @@
|
|||
|
||||
{% block controls %}
|
||||
{{ block.super }}
|
||||
<dl id="searchlinks" class="conl">
|
||||
<dt><strong>{% trans "Search links" %}</strong></dt>
|
||||
<dd><a href="{% url djangobb:search %}?action=show_24h">{% trans "Show recent posts" %}</a></dd>
|
||||
<dd><a href="{% url djangobb:search %}?action=show_unanswered">{% trans "Show unanswered posts" %}</a></dd>
|
||||
{% if user.is_authenticated %}
|
||||
<dd id="navprofile"><a href="{% url djangobb:forum_profile_personality request.user %}">{% trans "Change your signature" %}</a></dd>
|
||||
<dd><a href="{% url djangobb:misc %}?action=markread">{% trans "Mark all topics as read" %}</a></dd>
|
||||
<dd>{% trans "Show your" %} <a href="{% url djangobb:search %}?action=show_user&show_as=topics">{% trans "topics" %}</a>/<a href="{% url djangobb:search %}?action=show_user&show_as=posts">{% trans "posts" %}</a></dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
<dl id="onlinelist" class= "clearb">
|
||||
<dt><strong>{% blocktrans with count=online_count %}Online ({{ count }}):{% endblocktrans %} </strong></dt>
|
||||
{% for online in users_online %}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
{% load i18n %}
|
||||
{% load tz %}
|
||||
|
||||
{% block page-name %}{% blocktrans with name=forum.name %}Moderate - {{name}}{% endblocktrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% autopaginate topics forum_settings.FORUM_PAGE_SIZE %}
|
||||
<div class="linkst">
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
{% load i18n %}
|
||||
{% load tz %}
|
||||
|
||||
{% block page-name %}{% blocktrans with name=topic.name %}Move Posts - {{name}}{% endblocktrans %}{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{{ block.super }}
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}/djangobb_forum/js/move_posts.js"></script>
|
||||
|
|
|
@ -2,7 +2,16 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-name %}{% trans "Move Topic" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="linkst">
|
||||
<ul>
|
||||
<li><a href="{% url djangobb:index %}">{% trans "Forums Home" %}</a></li>
|
||||
<li>» {% trans "Move Topic" %}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-head">
|
||||
<h4>{% trans "Move Topic" %}</h4>
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-name %}{% trans "Signature" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="profile">
|
||||
<div class="blockform">
|
||||
|
|
|
@ -2,7 +2,21 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-name %}{% trans "Report Post" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="linkst">
|
||||
<div class="inbox">
|
||||
<ul>
|
||||
<li><a href="{% url djangobb:index %}">{% trans "Forums Home" %}</a></li>
|
||||
<li>» {% link post.topic.forum %} </li>
|
||||
<li>» {% link post.topic %}</li>
|
||||
<li>» {% trans "Report Post" %}</li>
|
||||
</ul>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-head">
|
||||
<h4>{% trans "Report Post" %}</h4>
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-name %}{% trans "Reports" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="blocktable">
|
||||
<div class="box">
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-name %}{% trans "Search" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="searchform" class="box">
|
||||
<div class="box-head">
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
{% load i18n %}
|
||||
{% load pagination_tags %}
|
||||
|
||||
{% block page-name %}{% trans "Search Results" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% autopaginate posts forum_settings.FORUM_PAGE_SIZE %}
|
||||
<div class="linkst">
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
{% load i18n %}
|
||||
{% load tz %}
|
||||
|
||||
{% block page-name %}{% trans "Search Results" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% autopaginate topics forum_settings.SEARCH_PAGE_SIZE %}
|
||||
<div class="linkst">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% load i18n %}
|
||||
{% load tz %}
|
||||
|
||||
{% block title %} / {{ topic.forum.name }} / {{ topic.name }}{% endblock %}
|
||||
{% block page-name %}{{ topic.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% autopaginate posts forum_settings.TOPIC_PAGE_SIZE %}
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block page-name %}{% trans "User List" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% autopaginate users forum_settings.USERS_PAGE_SIZE %}
|
||||
<div class="box">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% load forum_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %} / {% trans "YouTube Video" %}{% endblock %}
|
||||
{% block page-name %}{% trans "YouTube Video" %}{% endblock %}
|
||||
|
||||
{% block main-content %}
|
||||
<div class="cols clearfix djangobb-youtube">
|
||||
|
|
|
@ -35,10 +35,13 @@ def profile_link(user):
|
|||
def forum_time(time):
|
||||
return u'%s %s' % (capfirst(naturalday(time)), time.strftime('%H:%M:%S'))
|
||||
|
||||
@register.filter
|
||||
def forum_can_view_reports(user):
|
||||
return user.is_superuser or user.has_perm('djangobb_forum.change_report')
|
||||
|
||||
@register.filter
|
||||
def forum_reports(user):
|
||||
return Report.objects.filter(zapped=False).count() if user.is_superuser or user.has_perm('djangobb_forum.change_report') else 0
|
||||
return Report.objects.filter(zapped=False).count()
|
||||
|
||||
|
||||
# TODO: this old code requires refactoring
|
||||
|
|
|
@ -315,7 +315,10 @@ def misc(request):
|
|||
form.save()
|
||||
messages.info(request, _("Post reported."))
|
||||
return HttpResponseRedirect(post.get_absolute_url())
|
||||
return render(request, 'djangobb_forum/report.html', {'form':form})
|
||||
return render(request, 'djangobb_forum/report.html', {
|
||||
'form': form,
|
||||
'post': post,
|
||||
})
|
||||
|
||||
elif 'submit' in request.POST and 'mail_to' in request.GET:
|
||||
form = MailToForm(request.POST)
|
||||
|
|
Reference in a new issue