mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
introduce djhtml as jinja+scss formater
This commit is contained in:
committed by
Bartuccio Antoine
parent
13d0d2a300
commit
b25805e0a1
@ -2,31 +2,31 @@
|
||||
{% from 'forum/macros.jinja' import display_topic %}
|
||||
|
||||
{% block title %}
|
||||
{% trans %}Favorite topics{% endtrans %}
|
||||
{% trans %}Favorite topics{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
<p>
|
||||
<a href="{{ url('forum:main') }}">Forum</a> >
|
||||
<a href="{{ url('forum:favorite_topics') }}">{% trans %}Favorite topics{% endtrans %}</a>
|
||||
</p>
|
||||
<div id="forum">
|
||||
</p>
|
||||
<div id="forum">
|
||||
<h3>{% trans %}Forum{% endtrans %}</h3>
|
||||
<h4>{% trans %}Favorite topics{% endtrans %}</h4>
|
||||
{% for t in page_obj.object_list %}
|
||||
{% if user.can_view(t) %}
|
||||
{{ display_topic(t, user) }}
|
||||
{% endif %}
|
||||
{% if user.can_view(t) %}
|
||||
{{ display_topic(t, user) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<p style="text-align: right; background: #d8e7f3;">
|
||||
{% for p in paginator.page_range %}
|
||||
{% for p in paginator.page_range %}
|
||||
<span class="ib" style="background: {% if p == paginator.number %}white{% endif %}; margin: 0;">
|
||||
<a href="?page={{ p }}">{{ p }}</a>
|
||||
<a href="?page={{ p }}">{{ p }}</a>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
@ -2,71 +2,71 @@
|
||||
{% from 'forum/macros.jinja' import display_forum, display_breadcrumb, display_topic, display_search_bar %}
|
||||
|
||||
{% block title %}
|
||||
{{ forum }}
|
||||
{{ forum }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ display_breadcrumb(forum) }}
|
||||
<div id="forum">
|
||||
{{ display_breadcrumb(forum) }}
|
||||
<div id="forum">
|
||||
<h3>{{ forum.name }}</h3>
|
||||
<p>
|
||||
{%
|
||||
if user.is_com_admin
|
||||
or user.is_in_group(pk=settings.SITH_GROUP_FORUM_ADMIN_ID)
|
||||
or user.can_edit(forum)
|
||||
%}
|
||||
<a class="ib button" href="{{ url('forum:new_forum') }}?parent={{ forum.id }}">{% trans %}New forum{% endtrans %}</a> <br/>
|
||||
{% endif %}
|
||||
{% if not forum.is_category %}
|
||||
<a class="ib button" href="{{ url('forum:new_topic', forum_id=forum.id) }}">{% trans %}New topic{% endtrans %}</a>
|
||||
{% endif %}
|
||||
{{ display_search_bar(request) }}
|
||||
</p>
|
||||
{% if forum.children.exists() %}
|
||||
<div>
|
||||
<div class="ib w_big">
|
||||
{% trans %}Title{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
<div class="ib w_medium">
|
||||
{% trans %}Topics{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
{% trans %}Last message{% endtrans %}
|
||||
</div>
|
||||
</div>
|
||||
{%
|
||||
if user.is_com_admin
|
||||
or user.is_in_group(pk=settings.SITH_GROUP_FORUM_ADMIN_ID)
|
||||
or user.can_edit(forum)
|
||||
%}
|
||||
<a class="ib button" href="{{ url('forum:new_forum') }}?parent={{ forum.id }}">{% trans %}New forum{% endtrans %}</a> <br/>
|
||||
{% endif %}
|
||||
{% if not forum.is_category %}
|
||||
<a class="ib button" href="{{ url('forum:new_topic', forum_id=forum.id) }}">{% trans %}New topic{% endtrans %}</a>
|
||||
{% endif %}
|
||||
{{ display_search_bar(request) }}
|
||||
</p>
|
||||
{% if forum.children.exists() %}
|
||||
<div>
|
||||
<div class="ib w_big">
|
||||
{% trans %}Title{% endtrans %}
|
||||
</div>
|
||||
{{ display_forum(forum, user, True) }}
|
||||
{% for f in forum.children.all().select_related("_last_message__author", "_last_message__topic") %}
|
||||
<div class="ib w_small">
|
||||
<div class="ib w_medium">
|
||||
{% trans %}Topics{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
{% trans %}Last message{% endtrans %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ display_forum(forum, user, True) }}
|
||||
{% for f in forum.children.all().select_related("_last_message__author", "_last_message__topic") %}
|
||||
{{ display_forum(f, user) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if topics %}
|
||||
<div>
|
||||
<div class="ib w_medium">
|
||||
{% trans %}Title{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_medium">
|
||||
<div class="ib w_small">
|
||||
{% trans %}Author{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_medium">
|
||||
{% trans %}Messages{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
{% trans %}Last message{% endtrans %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if topics %}
|
||||
<div>
|
||||
<div class="ib w_medium">
|
||||
{% trans %}Title{% endtrans %}
|
||||
</div>
|
||||
{% for t in topics %}
|
||||
<div class="ib w_medium">
|
||||
<div class="ib w_small">
|
||||
{% trans %}Author{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_medium">
|
||||
{% trans %}Messages{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
{% trans %}Last message{% endtrans %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% for t in topics %}
|
||||
{{ display_topic(t, user) }}
|
||||
{% endfor %}
|
||||
<p style="text-align: right; background: #d8e7f3;">
|
||||
{% endfor %}
|
||||
<p style="text-align: right; background: #d8e7f3;">
|
||||
{% for p in topics.paginator.page_range %}
|
||||
<span class="ib" style="background: {% if p == topics.number %}white{% endif %}; margin: 0;"><a href="?topic_page={{ p }}">{{ p }}</a></span>
|
||||
<span class="ib" style="background: {% if p == topics.number %}white{% endif %}; margin: 0;"><a href="?topic_page={{ p }}">{{ p }}</a></span>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -2,35 +2,35 @@
|
||||
{% from 'forum/macros.jinja' import display_topic %}
|
||||
|
||||
{% block title %}
|
||||
{% trans %}Last unread messages{% endtrans %}
|
||||
{% trans %}Last unread messages{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
<p>
|
||||
<a href="{{ url('forum:main') }}">Forum</a> >
|
||||
<a href="{{ url('forum:last_unread') }}">{% trans %}Last unread messages{% endtrans %}</a>
|
||||
</p>
|
||||
<div id="forum">
|
||||
</p>
|
||||
<div id="forum">
|
||||
<h3>{% trans %}Forum{% endtrans %}</h3>
|
||||
<h4>{% trans %}Last unread messages{% endtrans %}</h4>
|
||||
<p>
|
||||
<a class="ib button" href="{{ url('forum:mark_all_as_read') }}">{% trans %}Mark all as read{% endtrans %}</a>
|
||||
<a class="ib button" href="{{ url('forum:last_unread') }}">{% trans %}Refresh{% endtrans %}</a>
|
||||
<a class="ib button" href="{{ url('forum:mark_all_as_read') }}">{% trans %}Mark all as read{% endtrans %}</a>
|
||||
<a class="ib button" href="{{ url('forum:last_unread') }}">{% trans %}Refresh{% endtrans %}</a>
|
||||
</p>
|
||||
{% for t in page_obj.object_list %}
|
||||
{% if user.can_view(t) %}
|
||||
{{ display_topic(t, user, True) }}
|
||||
{% endif %}
|
||||
{% if user.can_view(t) %}
|
||||
{{ display_topic(t, user, True) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<p style="text-align: right; background: #d8e7f3;">
|
||||
{% for p in paginator.page_range %}
|
||||
{% for p in paginator.page_range %}
|
||||
<span class="ib" style="background: {% if p == paginator.number %}white{% endif %}; margin: 0;">
|
||||
<a href="?page={{ p }}">{{ p }}</a>
|
||||
<a href="?page={{ p }}">{{ p }}</a>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
@ -1,177 +1,177 @@
|
||||
{% from 'core/macros.jinja' import user_profile_link_short_name %}
|
||||
|
||||
{% macro display_forum(forum, user, is_root=False) %}
|
||||
<div class="forum {% if is_root %}category{% endif %}">
|
||||
<div class="forum {% if is_root %}category{% endif %}">
|
||||
<div class="ib w_big">
|
||||
{% if not is_root %}
|
||||
{% if not is_root %}
|
||||
<a class="ib w_big" href="{{ url('forum:view_forum', forum_id=forum.id) }}">
|
||||
{% else %}
|
||||
{% else %}
|
||||
<div class="ib w_big">
|
||||
{% endif %}
|
||||
<div class="title">{{ forum.name }}</div>
|
||||
<p>{{ forum.description }}</p>
|
||||
{% if not is_root %}
|
||||
{% endif %}
|
||||
<div class="title">{{ forum.name }}</div>
|
||||
<p>{{ forum.description }}</p>
|
||||
{% if not is_root %}
|
||||
</a>
|
||||
{% else %}
|
||||
{% else %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.is_owner(forum) %}
|
||||
{% endif %}
|
||||
{% if user.is_owner(forum) %}
|
||||
<div class="tools">
|
||||
<a class="ib" href="{{ url('forum:edit_forum', forum_id=forum.id) }}">{% trans %}Edit{% endtrans %}</a>
|
||||
<a class="ib" href="{{ url('forum:delete_forum', forum_id=forum.id) }}">{% trans %}Delete{% endtrans %}</a>
|
||||
<a class="ib" href="{{ url('forum:edit_forum', forum_id=forum.id) }}">{% trans %}Edit{% endtrans %}</a>
|
||||
<a class="ib" href="{{ url('forum:delete_forum', forum_id=forum.id) }}">{% trans %}Delete{% endtrans %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not is_root %}
|
||||
<div class="ib w_small">
|
||||
<div class="ib w_small">
|
||||
<p class="ib w_medium">
|
||||
{{ forum.topic_number }}
|
||||
{{ forum.topic_number }}
|
||||
</p>
|
||||
<div class="ib w_medium last_message" style="font-size: x-small; text-align: center">
|
||||
{% if forum.last_message %}
|
||||
{% if forum.last_message %}
|
||||
{{ user_profile_link_short_name(forum.last_message.author) }} <br/>
|
||||
<a href="{{ forum.last_message.get_absolute_url() }}">
|
||||
<date>
|
||||
<date>
|
||||
{{ forum.last_message.date|localtime|date(DATETIME_FORMAT) }}
|
||||
{{ forum.last_message.date|localtime|time(DATETIME_FORMAT) }}
|
||||
</date><br>
|
||||
<span>
|
||||
</date><br>
|
||||
<span>
|
||||
{{ forum.last_message.topic }}
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro display_topic(topic, user, first_unread=False) %}
|
||||
<div class="topic">
|
||||
<div class="topic">
|
||||
<div class="ib w_medium">
|
||||
{% if first_unread %}
|
||||
{% if first_unread %}
|
||||
<a class="ib w_big" href="{{ topic.get_first_unread_message(user).get_absolute_url() }}">
|
||||
{% else %}
|
||||
{% else %}
|
||||
<a class="ib w_big" href="{{ url('forum:view_topic', topic_id=topic.id) }}">
|
||||
{% endif %}
|
||||
<div class="title">{{ topic.title or topic.messages.first().title }}</div>
|
||||
<p>{{ topic.description }}</p>
|
||||
{% endif %}
|
||||
<div class="title">{{ topic.title or topic.messages.first().title }}</div>
|
||||
<p>{{ topic.description }}</p>
|
||||
</a>
|
||||
{% if user.can_edit(topic) %}
|
||||
<div class="ib tools" style="text-align: center;">
|
||||
<a href="{{ url('forum:edit_topic', topic_id=topic.id) }}">{% trans %}Edit{% endtrans %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="ib w_medium last_message">
|
||||
<div class="ib w_medium">
|
||||
<p class="ib w_medium" style="text-align: center;">
|
||||
{{ user_profile_link_short_name(topic.author) }}
|
||||
</p>
|
||||
<p class="ib w_medium" style="text-align: center;">
|
||||
{{ topic._message_number }}
|
||||
</p>
|
||||
</div>
|
||||
<p class="ib w_medium" style="text-align: center;">
|
||||
{% set last_msg = topic.last_message %}
|
||||
{% if last_msg %}
|
||||
{{ user_profile_link_short_name(last_msg.author) }} <br/>
|
||||
<a href="{{ last_msg.get_absolute_url() }}">
|
||||
<date>{{ last_msg.date|localtime|date(DATETIME_FORMAT) }} {{ last_msg.date|localtime|time(DATETIME_FORMAT) }}</date>
|
||||
</a>
|
||||
{% if user.can_edit(topic) %}
|
||||
<div class="ib tools" style="text-align: center;">
|
||||
<a href="{{ url('forum:edit_topic', topic_id=topic.id) }}">{% trans %}Edit{% endtrans %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="ib w_medium last_message">
|
||||
<div class="ib w_medium">
|
||||
<p class="ib w_medium" style="text-align: center;">
|
||||
{{ user_profile_link_short_name(topic.author) }}
|
||||
</p>
|
||||
<p class="ib w_medium" style="text-align: center;">
|
||||
{{ topic._message_number }}
|
||||
</p>
|
||||
</div>
|
||||
<p class="ib w_medium" style="text-align: center;">
|
||||
{% set last_msg = topic.last_message %}
|
||||
{% if last_msg %}
|
||||
{{ user_profile_link_short_name(last_msg.author) }} <br/>
|
||||
<a href="{{ last_msg.get_absolute_url() }}">
|
||||
<date>{{ last_msg.date|localtime|date(DATETIME_FORMAT) }} {{ last_msg.date|localtime|time(DATETIME_FORMAT) }}</date>
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro display_breadcrumb(forum, topic="") %}
|
||||
<p>
|
||||
<p>
|
||||
<a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a>
|
||||
{% for f in forum.get_parent_list()|reverse %}
|
||||
> <a href="{{ f.get_absolute_url() }}">{{ f }}</a>
|
||||
> <a href="{{ f.get_absolute_url() }}">{{ f }}</a>
|
||||
{% endfor %}
|
||||
> <a href="{{ forum.get_absolute_url() }}">{{ forum }}</a>
|
||||
{% if topic != "" %} > <a href="{{ topic.get_absolute_url() }}">{{ topic }}</a>{%- endif -%}
|
||||
</p>
|
||||
</p>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro display_message(m, user, unread=False) %}
|
||||
{% if user.can_view(m) %}
|
||||
<div id="msg_{{ m.id }}" class="message {% if unread %}unread{% endif %}">
|
||||
<div class="msg_author {% if m.deleted %}deleted{% endif %}">
|
||||
{% if m.author.avatar_pict %}
|
||||
<img src="{{ m.author.avatar_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
|
||||
{% if user.can_view(m) %}
|
||||
<div id="msg_{{ m.id }}" class="message {% if unread %}unread{% endif %}">
|
||||
<div class="msg_author {% if m.deleted %}deleted{% endif %}">
|
||||
{% if m.author.avatar_pict %}
|
||||
<img src="{{ m.author.avatar_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
|
||||
{% else %}
|
||||
<img src="{{ static('core/img/unknown.jpg') }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
|
||||
<img src="{{ static('core/img/unknown.jpg') }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
|
||||
{% endif %}
|
||||
<br/>
|
||||
<strong><a href="{{ m.author.get_absolute_url() }}">{{ m.author.get_short_name() }}</a></strong>
|
||||
</div>
|
||||
<div class="msg_content {% if m.deleted %}deleted{% endif %}" {% if m.id == first_unread_message_id %}id="first_unread"{% endif %}>
|
||||
</div>
|
||||
<div class="msg_content {% if m.deleted %}deleted{% endif %}" {% if m.id == first_unread_message_id %}id="first_unread"{% endif %}>
|
||||
<div class="msg_header">
|
||||
<div class="ib w_big title">
|
||||
<a href="{{ m.get_absolute_url() }}">
|
||||
{{ m.date|localtime|date(DATETIME_FORMAT) }}
|
||||
{{ m.date|localtime|time(DATETIME_FORMAT) }}
|
||||
{%- if m.title -%}
|
||||
- {{ m.title }}
|
||||
{%- endif -%}
|
||||
</a>
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
<span><a href="{{ m.get_absolute_url() }}">#{{ m.id }}</a></span>
|
||||
<br/>
|
||||
<span><a href="{{ url('forum:new_message', topic_id=m.topic.id) }}?quote_id={{ m.id }}">
|
||||
{% trans %}Reply as quote{% endtrans %}</a></span>
|
||||
{% if user.can_edit(m) %}
|
||||
<span> <a href="{{ url('forum:edit_message', message_id=m.id) }}">{% trans %}Edit{% endtrans %}</a></span>
|
||||
{% endif %}
|
||||
{% if m.can_be_moderated_by(user) %}
|
||||
{% if m.deleted %}
|
||||
<div class="ib w_big title">
|
||||
<a href="{{ m.get_absolute_url() }}">
|
||||
{{ m.date|localtime|date(DATETIME_FORMAT) }}
|
||||
{{ m.date|localtime|time(DATETIME_FORMAT) }}
|
||||
{%- if m.title -%}
|
||||
- {{ m.title }}
|
||||
{%- endif -%}
|
||||
</a>
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
<span><a href="{{ m.get_absolute_url() }}">#{{ m.id }}</a></span>
|
||||
<br/>
|
||||
<span><a href="{{ url('forum:new_message', topic_id=m.topic.id) }}?quote_id={{ m.id }}">
|
||||
{% trans %}Reply as quote{% endtrans %}</a></span>
|
||||
{% if user.can_edit(m) %}
|
||||
<span> <a href="{{ url('forum:edit_message', message_id=m.id) }}">{% trans %}Edit{% endtrans %}</a></span>
|
||||
{% endif %}
|
||||
{% if m.can_be_moderated_by(user) %}
|
||||
{% if m.deleted %}
|
||||
<span> <a href="{{ url('forum:undelete_message', message_id=m.id) }}">{% trans %}Undelete{% endtrans %}</a></span>
|
||||
{% else %}
|
||||
{% else %}
|
||||
<span> <a href="{{ url('forum:delete_message', message_id=m.id) }}">{% trans %}Delete{% endtrans %}</a></span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
{{ m.message|markdown }}
|
||||
{{ m.message|markdown }}
|
||||
</div>
|
||||
{% if m.can_be_moderated_by(user) %}
|
||||
<ul class="msg_meta">
|
||||
{% for meta in m.metas.select_related('user').order_by('id') %}
|
||||
<li style="background: {% if m.author == meta.user %}#bfffbf{% else %}#ffffbf{% endif %}">
|
||||
<ul class="msg_meta">
|
||||
{% for meta in m.metas.select_related('user').order_by('id') %}
|
||||
<li style="background: {% if m.author == meta.user %}#bfffbf{% else %}#ffffbf{% endif %}">
|
||||
{{ meta.get_action_display() }} {{ meta.user.get_short_name() }}
|
||||
{% trans %} at {% endtrans %}{{ meta.date|localtime|time(DATETIME_FORMAT) }}
|
||||
{% trans %} the {% endtrans %}{{ meta.date|localtime|date(DATETIME_FORMAT)}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<div class="forum_signature">{{ m.author.forum_signature|markdown }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div id="msg_{{ m.id }}" class="message">
|
||||
<div id="msg_{{ m.id }}" class="message">
|
||||
<div class="msg_author deleted">
|
||||
</div>
|
||||
<div class="msg_content deleted">
|
||||
<p class="ib w_big">{% trans %}Deleted or unreadable message.{% endtrans %}</p>
|
||||
<p class="ib w_small">{{ m.date|localtime|date(DATETIME_FORMAT) }} {{ m.date|localtime|time(DATETIME_FORMAT) }}</p>
|
||||
<p class="ib w_big">{% trans %}Deleted or unreadable message.{% endtrans %}</p>
|
||||
<p class="ib w_small">{{ m.date|localtime|date(DATETIME_FORMAT) }} {{ m.date|localtime|time(DATETIME_FORMAT) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ m.mark_as_read(user) or "" }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro display_search_bar(request) %}
|
||||
<form class="search_bar" action="{{ url('forum:search') }}" method="GET">
|
||||
<form class="search_bar" action="{{ url('forum:search') }}" method="GET">
|
||||
<input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query" value="{{ request.GET.query|default('') }}"/>
|
||||
<input type="checkbox" class="search_check" name="order" value="date" {% if request.GET.order|default("") == "date" or (request.GET.order|default("") == "" and request.GET.query|default("") == "") -%}
|
||||
checked
|
||||
{%- endif -%}> {% trans %}Order by date{% endtrans %}<br>
|
||||
checked
|
||||
{%- endif -%}> {% trans %}Order by date{% endtrans %}<br>
|
||||
<input type="submit" class="search_bouton" value="{% trans %}Search{% endtrans %}"/>
|
||||
</form>
|
||||
</form>
|
||||
{% endmacro %}
|
||||
|
@ -3,50 +3,50 @@
|
||||
{% from 'forum/macros.jinja' import display_forum, display_search_bar %}
|
||||
|
||||
{% block title %}
|
||||
{% trans %}Forum{% endtrans %}
|
||||
{% trans %}Forum{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
<a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a> >
|
||||
</p>
|
||||
<div id="forum">
|
||||
<p>
|
||||
<a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a> >
|
||||
</p>
|
||||
<div id="forum">
|
||||
<h3>{% trans %}Forum{% endtrans %}</h3>
|
||||
<p>
|
||||
<a class="ib button" href="{{ url('forum:last_unread') }}">{% trans %}View last unread messages{% endtrans %}</a>
|
||||
<a class="ib button" href="{{ url('forum:favorite_topics') }}">{% trans %}Favorite topics{% endtrans %}</a>
|
||||
{{ display_search_bar(request) }}
|
||||
<a class="ib button" href="{{ url('forum:last_unread') }}">{% trans %}View last unread messages{% endtrans %}</a>
|
||||
<a class="ib button" href="{{ url('forum:favorite_topics') }}">{% trans %}Favorite topics{% endtrans %}</a>
|
||||
{{ display_search_bar(request) }}
|
||||
</p>
|
||||
{% if
|
||||
user.is_com_admin
|
||||
or user.is_in_group(pk=settings.SITH_GROUP_FORUM_ADMIN_ID)
|
||||
user.is_com_admin
|
||||
or user.is_in_group(pk=settings.SITH_GROUP_FORUM_ADMIN_ID)
|
||||
%}
|
||||
<p>
|
||||
<a href="{{ url('forum:new_forum') }}">{% trans %}New forum{% endtrans %}</a>
|
||||
<a href="{{ url('forum:new_forum') }}">{% trans %}New forum{% endtrans %}</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
<div>
|
||||
<div class="ib w_big">
|
||||
{% trans %}Title{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
<div class="ib w_medium">
|
||||
{% trans %}Topics{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
{% trans %}Last message{% endtrans %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<div class="ib w_big">
|
||||
{% trans %}Title{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
<div class="ib w_medium">
|
||||
{% trans %}Topics{% endtrans %}
|
||||
</div>
|
||||
<div class="ib w_small">
|
||||
{% trans %}Last message{% endtrans %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% for f in forum_list %}
|
||||
<div>
|
||||
{% for f in forum_list %}
|
||||
<div>
|
||||
{{ display_forum(f, user, True) }}
|
||||
{% for c in f.children.all() %}
|
||||
{{ display_forum(c, user) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% for c in f.children.all() %}
|
||||
{{ display_forum(c, user) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -2,46 +2,46 @@
|
||||
{% from 'forum/macros.jinja' import display_message, display_search_bar %}
|
||||
|
||||
{% block title %}
|
||||
{% if topic %}
|
||||
{% trans %}Reply{% endtrans %}
|
||||
{% else %}
|
||||
{% trans %}New topic{% endtrans %}
|
||||
{% endif %}
|
||||
{% if topic %}
|
||||
{% trans %}Reply{% endtrans %}
|
||||
{% else %}
|
||||
{% trans %}New topic{% endtrans %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if topic %}
|
||||
{{ display_search_bar(request) }}
|
||||
<p>
|
||||
<a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a>
|
||||
{% for f in topic.forum.get_parent_list() %}
|
||||
> <a href="{{ f.get_absolute_url() }}">{{ f }}</a>
|
||||
{% endfor %}
|
||||
> <a href="{{ topic.forum.get_absolute_url() }}">{{ topic.forum }}</a>
|
||||
> <a href="{{ topic.get_absolute_url() }}">{{ topic }}</a>
|
||||
</p>
|
||||
<div id="forum">
|
||||
<h3>{{ topic.title }}</h3>
|
||||
<h4>{% trans %}Reply{% endtrans %}</h4>
|
||||
{% else %}
|
||||
<div id="forum">
|
||||
<h4>{% trans %}New topic{% endtrans %}</h4>
|
||||
{% endif %}
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{% render_honeypot_field settings.HONEYPOT_FIELD_NAME_FORUM %}
|
||||
{{ form.as_p() }}
|
||||
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
|
||||
</form>
|
||||
<hr>
|
||||
{% if topic %}
|
||||
{{ display_search_bar(request) }}
|
||||
<p>
|
||||
<a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a>
|
||||
{% for f in topic.forum.get_parent_list() %}
|
||||
> <a href="{{ f.get_absolute_url() }}">{{ f }}</a>
|
||||
{% endfor %}
|
||||
> <a href="{{ topic.forum.get_absolute_url() }}">{{ topic.forum }}</a>
|
||||
> <a href="{{ topic.get_absolute_url() }}">{{ topic }}</a>
|
||||
</p>
|
||||
<div id="forum">
|
||||
<h3>{{ topic.title }}</h3>
|
||||
<h4>{% trans %}Reply{% endtrans %}</h4>
|
||||
{% else %}
|
||||
<div id="forum">
|
||||
<h4>{% trans %}New topic{% endtrans %}</h4>
|
||||
{% endif %}
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{% render_honeypot_field settings.HONEYPOT_FIELD_NAME_FORUM %}
|
||||
{{ form.as_p() }}
|
||||
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
|
||||
</form>
|
||||
<hr>
|
||||
|
||||
{% if topic %}
|
||||
{% if topic %}
|
||||
{% for m in topic.messages.select_related('author__avatar_pict').order_by('-id')[:10] %}
|
||||
{{ display_message(m, user) }}
|
||||
{{ display_message(m, user) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -3,19 +3,19 @@
|
||||
{% from 'forum/macros.jinja' import display_message, display_breadcrumb, display_search_bar %}
|
||||
|
||||
{% block content %}
|
||||
<div id="forum">
|
||||
<div id="forum">
|
||||
{{ display_search_bar(request) }}
|
||||
{% if object_list|length != 0 %}
|
||||
<br>
|
||||
<div class="search-results">
|
||||
{% for m in object_list %}
|
||||
{{ display_breadcrumb(m.topic.forum, m.topic) }}
|
||||
{{ display_message(m, user) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<br>
|
||||
<div class="search-results">
|
||||
{% for m in object_list %}
|
||||
{{ display_breadcrumb(m.topic.forum, m.topic) }}
|
||||
{{ display_message(m, user) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% trans %}No result found{% endtrans %}
|
||||
{% trans %}No result found{% endtrans %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -3,68 +3,68 @@
|
||||
{% from 'forum/macros.jinja' import display_message, display_breadcrumb, display_search_bar %}
|
||||
|
||||
{% block title %}
|
||||
{{ topic }}
|
||||
{{ topic }}
|
||||
{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<style type="text/css" media="all">
|
||||
.topic {
|
||||
border: solid skyblue 1px;
|
||||
padding: 2px;
|
||||
margin: 2px;
|
||||
}
|
||||
.forum {
|
||||
background: lightblue;
|
||||
padding: 2px;
|
||||
margin: 2px;
|
||||
}
|
||||
.category {
|
||||
background: skyblue;
|
||||
}
|
||||
</style>
|
||||
{{ super() }}
|
||||
<style type="text/css" media="all">
|
||||
.topic {
|
||||
border: solid skyblue 1px;
|
||||
padding: 2px;
|
||||
margin: 2px;
|
||||
}
|
||||
.forum {
|
||||
background: lightblue;
|
||||
padding: 2px;
|
||||
margin: 2px;
|
||||
}
|
||||
.category {
|
||||
background: skyblue;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ display_breadcrumb(topic.forum, topic) }}
|
||||
<h3>{{ topic.title }}</h3>
|
||||
<div id="forum">
|
||||
{{ display_breadcrumb(topic.forum, topic) }}
|
||||
<h3>{{ topic.title }}</h3>
|
||||
<div id="forum">
|
||||
<p>{{ topic.description }}</p>
|
||||
<p>
|
||||
<a class="ib button" href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a>
|
||||
{% if user in topic.subscribed_users.all() %}
|
||||
<a class="ib button" href="{{ url('forum:toggle_subscribe_topic', topic_id=topic.id) }}">{% trans %}Unmark as favorite{% endtrans %}</a>
|
||||
{% else %}
|
||||
<a class="ib button" href="{{ url('forum:toggle_subscribe_topic', topic_id=topic.id) }}">{% trans %}Mark as favorite{% endtrans %}</a>
|
||||
{% endif %}
|
||||
<a class="ib button" href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a>
|
||||
{% if user in topic.subscribed_users.all() %}
|
||||
<a class="ib button" href="{{ url('forum:toggle_subscribe_topic', topic_id=topic.id) }}">{% trans %}Unmark as favorite{% endtrans %}</a>
|
||||
{% else %}
|
||||
<a class="ib button" href="{{ url('forum:toggle_subscribe_topic', topic_id=topic.id) }}">{% trans %}Mark as favorite{% endtrans %}</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{{ display_search_bar(request) }}
|
||||
<p style="text-align: right; background: #d8e7f3;">
|
||||
{% for p in msgs.paginator.page_range %}
|
||||
{% for p in msgs.paginator.page_range %}
|
||||
<span class="ib" style="background: {% if p == msgs.number %}white{% endif %}; margin: 0;"><a href="?page={{ p }}">{{ p }}</a></span>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
||||
{% for m in msgs %}
|
||||
{% if m.id == first_unread_message_id %}
|
||||
{% if m.id == first_unread_message_id %}
|
||||
<span id="first_unread"></span>
|
||||
{% endif %}
|
||||
{% if m.id >= first_unread_message_id %}
|
||||
{% endif %}
|
||||
{% if m.id >= first_unread_message_id %}
|
||||
{{ display_message(m, user, True) }}
|
||||
{% else %}
|
||||
{% else %}
|
||||
{{ display_message(m, user, False) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<p><a class="ib button" href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a></p>
|
||||
|
||||
<p style="text-align: right; background: #d8e7f3;">
|
||||
{% for p in msgs.paginator.page_range %}
|
||||
{% for p in msgs.paginator.page_range %}
|
||||
<span class="ib" style="background: {% if p == msgs.number %}white{% endif %}; margin: 0;"><a href="?page={{ p }}">{{ p }}</a></span>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user