mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
Remove forum templates and vestiges
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
import random
|
||||
|
||||
import pytest
|
||||
from django.test.utils import override_settings
|
||||
|
||||
|
||||
@@ -32,9 +32,6 @@ def test_403_page(db, tp):
|
||||
@override_settings(
|
||||
CACHES={
|
||||
"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"},
|
||||
"machina_attachments": {
|
||||
"BACKEND": "django.core.cache.backends.locmem.LocMemCache"
|
||||
},
|
||||
"static_content": {
|
||||
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
|
||||
"TIMEOUT": 86400,
|
||||
|
||||
@@ -6,9 +6,8 @@ from pathlib import Path
|
||||
|
||||
import environs
|
||||
import structlog
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from corsheaders.defaults import default_headers
|
||||
from machina import MACHINA_MAIN_STATIC_DIR, MACHINA_MAIN_TEMPLATE_DIR
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from pythonjsonlogger import jsonlogger
|
||||
|
||||
env = environs.Env()
|
||||
@@ -73,22 +72,9 @@ INSTALLED_APPS += [
|
||||
"allauth.socialaccount",
|
||||
"allauth.socialaccount.providers.github",
|
||||
"allauth.socialaccount.providers.google",
|
||||
# Machina dependencies:
|
||||
"mptt",
|
||||
"haystack",
|
||||
"widget_tweaks",
|
||||
# Machina apps:
|
||||
"machina",
|
||||
"machina.apps.forum",
|
||||
"machina.apps.forum_conversation",
|
||||
"machina.apps.forum_conversation.forum_attachments",
|
||||
"machina.apps.forum_conversation.forum_polls",
|
||||
"machina.apps.forum_feeds",
|
||||
"machina.apps.forum_moderation",
|
||||
"machina.apps.forum_search",
|
||||
"machina.apps.forum_tracking",
|
||||
"machina.apps.forum_member",
|
||||
"machina.apps.forum_permission",
|
||||
]
|
||||
|
||||
# Our Apps
|
||||
@@ -120,8 +106,6 @@ MIDDLEWARE = [
|
||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
# Machina
|
||||
"machina.apps.forum_permission.middleware.ForumPermissionMiddleware",
|
||||
]
|
||||
|
||||
if DEBUG:
|
||||
@@ -138,7 +122,6 @@ TEMPLATES = [
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [
|
||||
str(BASE_DIR.joinpath("templates")),
|
||||
MACHINA_MAIN_TEMPLATE_DIR,
|
||||
],
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
@@ -149,8 +132,6 @@ TEMPLATES = [
|
||||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
# Machina
|
||||
"machina.core.context_processors.metadata",
|
||||
],
|
||||
"loaders": [
|
||||
"django.template.loaders.filesystem.Loader",
|
||||
@@ -216,7 +197,6 @@ STATIC_URL = "/static/"
|
||||
# Additional directories from where we should collect static files from
|
||||
STATICFILES_DIRS = [
|
||||
BASE_DIR.joinpath("static"),
|
||||
MACHINA_MAIN_STATIC_DIR,
|
||||
]
|
||||
|
||||
# This is the directory where all of the collected static files are put
|
||||
@@ -274,10 +254,6 @@ CACHES = {
|
||||
"BACKEND": "django_redis.cache.RedisCache",
|
||||
"LOCATION": f"redis://{REDIS_HOST}:6379",
|
||||
},
|
||||
"machina_attachments": {
|
||||
"BACKEND": "django_redis.cache.RedisCache",
|
||||
"LOCATION": f"redis://{REDIS_HOST}:6379",
|
||||
},
|
||||
"static_content": {
|
||||
"BACKEND": "django_redis.cache.RedisCache",
|
||||
"LOCATION": f"redis://{REDIS_HOST}:6379/2",
|
||||
@@ -401,19 +377,6 @@ STATIC_CONTENT_AWS_S3_ENDPOINT_URL = "s3.amazonaws.com"
|
||||
# Markdown content
|
||||
BASE_CONTENT = env("BOOST_CONTENT_DIRECTORY", "/website")
|
||||
|
||||
# Machina settings
|
||||
MACHINA_DEFAULT_AUTHENTICATED_USER_FORUM_PERMISSIONS = [
|
||||
"can_see_forum",
|
||||
"can_read_forum",
|
||||
"can_start_new_topics",
|
||||
"can_reply_to_topics",
|
||||
"can_edit_own_posts",
|
||||
"can_post_without_approval",
|
||||
"can_create_polls",
|
||||
"can_vote_in_polls",
|
||||
"can_download_file",
|
||||
]
|
||||
|
||||
# News: list of users who are allowed to post without requiring moderation.
|
||||
# This complements the 'moderator' Group that also have posting privileges.
|
||||
NEWS_MODERATION_ALLOWLIST = [
|
||||
|
||||
@@ -3,7 +3,6 @@ from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path, re_path
|
||||
from django.views.generic import TemplateView
|
||||
from machina import urls as machina_urls
|
||||
from rest_framework import routers
|
||||
|
||||
from ak.views import (
|
||||
@@ -104,7 +103,6 @@ urlpatterns = (
|
||||
name="docs",
|
||||
),
|
||||
path("health/", include("health_check.urls")),
|
||||
path("forum/", include(machina_urls)),
|
||||
# temp page for community until mailman is done.
|
||||
path(
|
||||
"community/",
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
import pytest
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from django.core.cache import caches
|
||||
from django.test import RequestFactory
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from core.views import StaticContentTemplateView
|
||||
|
||||
|
||||
TEST_CACHES = {
|
||||
"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"},
|
||||
"machina_attachments": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"},
|
||||
"static_content": {
|
||||
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
|
||||
"TIMEOUT": 86400,
|
||||
|
||||
@@ -56,8 +56,6 @@ mistletoe
|
||||
python-frontmatter
|
||||
beautifulsoup4
|
||||
|
||||
#Forum
|
||||
django-machina>=1.2
|
||||
django-haystack>=3.2
|
||||
django-mptt==0.14
|
||||
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load mptt_tags %}
|
||||
{% load forum_tags %}
|
||||
{% load forum_conversation_tags %}
|
||||
{% load forum_permission_tags %}
|
||||
{% load forum_tracking_tags %}
|
||||
|
||||
{% block sub_title %}{{ forum.name }}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="flex flex-wrap">
|
||||
<div class="w-full">
|
||||
<h1 class="text-4xl">{{ forum.name }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
{% if sub_forums %}
|
||||
<div class="flex flex-wrap">
|
||||
<div class="w-full forumlist-top-controls">
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="float-right">
|
||||
<a href="{% url 'forum_tracking:mark_subforums_read' forum.pk %}" class="inline-block"><i class="fa fa-check-circle-o"> </i>{% trans "Mark subforums read" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% forum_list sub_forums %}
|
||||
{% endif %}
|
||||
{% if forum.is_forum %}
|
||||
<div class="flex flex-wrap mt-4 mb-3">
|
||||
<div class="pr-4 pl-4 w-1/4 forum-actions-block">
|
||||
{% get_permission 'can_add_topic' forum request.user as user_can_add_topic %}
|
||||
{% if user_can_add_topic %}
|
||||
<a href="{% url 'forum_conversation:topic_create' forum.slug forum.pk %}" class="py-3 px-8 text-base font-medium rounded-md border md:py-1 md:px-4 md:text-lg border-orange text-orange">{% trans "New topic" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="pr-4 pl-4 w-full md:w-2/3">
|
||||
{% if topics|length > 0 and request.user.is_authenticated %}
|
||||
<div class="float-left">
|
||||
<a href="{% url 'forum_tracking:mark_topics_read' forum.pk %}" class="inline-block my-1 text-sm uppercase">{% trans "Mark topics read" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% trans "Announcements" as announcements_title_trans %}
|
||||
{% with topic_list_title=announcements_title_trans topics=announces hide_if_empty=True unread_topics=unread_topics %}
|
||||
{% include "forum_conversation/topic_list.html" %}
|
||||
{% endwith %}
|
||||
{% trans "Topics" as topics_title_trans %}
|
||||
{% with topic_list_title=topics_title_trans unread_topics=unread_topics%}
|
||||
{% include "forum_conversation/topic_list.html" %}
|
||||
{% endwith %}
|
||||
<div class="flex flex-wrap mt-3 mb-5">
|
||||
<div class="pr-4 pl-4 w-1/4 forum-actions-block">
|
||||
{% if user_can_add_topic %}
|
||||
<a href="{% url 'forum_conversation:topic_create' forum.slug forum.pk %}" class="py-3 px-8 text-base font-medium rounded-md border md:py-1 md:px-4 md:text-lg border-orange text-orange">{% trans "New topic" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="pr-4 pl-4 w-full md:w-2/3">
|
||||
{% if topics|length > 0 and request.user.is_authenticated %}
|
||||
<div class="float-left">
|
||||
<a href="{% url 'forum_tracking:mark_topics_read' forum.pk %}" class="inline-block my-1 text-sm uppercase">{% trans "Mark topics read" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
@@ -1,219 +0,0 @@
|
||||
{% load i18n static %}
|
||||
{% load mptt_tags %}
|
||||
{% load forum_tags %}
|
||||
{% load forum_conversation_tags %}
|
||||
{% load forum_member_tags %}
|
||||
{% load forum_tracking_tags %}
|
||||
|
||||
<div class="flex flex-wrap">
|
||||
<div class="w-full">
|
||||
{% if forum_contents.nodes %}
|
||||
{% recurseforumcontents forum_contents %}
|
||||
{% if node.level == root_level %}
|
||||
{% if node.obj.is_category %}
|
||||
<div class="flex relative flex-col mt-3 min-w-0 break-words rounded border bg-charcoal border-1 border-slate forumlist">
|
||||
<div class="p-0 py-3 px-6 mb-0 border-gray-300 border-b-1">
|
||||
<div class="flex py-2 px-3 m-0 border-b border-slate">
|
||||
<div class="pr-4 pl-0 pl-4 w-full sm:w-3/4 forum-name-col">
|
||||
<h3 class="m-0 mb-3 h5"><a href="{% url 'forum:forum' node.obj.slug node.obj.id %}">{{ node.obj.name }}</a></h3>
|
||||
</div>
|
||||
<div class="hidden pr-4 pl-4 text-center md:block whitespace-no-wrap forum-count-col">{% trans "Topics" %}</div>
|
||||
<div class="hidden pr-4 pl-4 text-center md:block whitespace-no-wrap forum-count-col">{% trans "Posts" %}</div>
|
||||
<div class="hidden pr-0 pr-4 pl-4 sm:block sm:w-1/4 whitespace-no-wrap forum-last-post-col">{% trans "Last post" %}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-auto p-0 p-6">
|
||||
{{ children }}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% with node.previous_sibling.obj as previous_sibling %}
|
||||
{% if previous_sibling and previous_sibling.is_category or not previous_sibling in forum_contents.visible_forums or not previous_sibling %}
|
||||
<div class="flex relative flex-col mt-3 min-w-0 break-words rounded border bg-charcoal border-1 border-slate forumlist">
|
||||
<div class="p-0 py-3 px-6 mb-0 border-b-1 border-slate">
|
||||
<div class="flex py-2 px-3 m-0 border-b border-slate">
|
||||
<div class="pl-0 w-3/4 forum-name-col">
|
||||
<h3 class="m-0 mb-3 h5">{% trans "Forums" %}</h3>
|
||||
</div>
|
||||
<div class="hidden pr-4 pl-4 text-center md:block whitespace-no-wrap forum-count-col w-25">{% trans "Topics" %}</div>
|
||||
<div class="hidden pr-4 pl-4 text-center md:block whitespace-no-wrap forum-count-col w-25">{% trans "Posts" %}</div>
|
||||
<div class="hidden pr-0 pr-4 pl-4 sm:block sm:w-1/4 whitespace-no-wrap forum-last-post-col">{% trans "Last post" %}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-auto p-0 p-6">
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<div class="flex py-2 px-3 m-0 border-b border-slate">
|
||||
{% if not node.obj.is_link %}
|
||||
<div class="pl-0 w-3/4 forum-name">
|
||||
<table class="forum-data-table">
|
||||
<tr>
|
||||
<td class="pt-1 pr-3 align-top forum-icon {% if node.obj in unread_forums %}unread{% endif %}">
|
||||
<i class="far fa-circle fa-2x"></i>
|
||||
</td>
|
||||
<td>
|
||||
{% if node.obj.image %}
|
||||
<td>
|
||||
<div class="hidden pr-2 md:block forum-image">
|
||||
<img src="{{ node.obj.image.url }}" alt="{{ node.obj.name }}" />
|
||||
</div>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td class="align-top">
|
||||
<a href="{% url 'forum:forum' node.obj.slug node.obj.id %}" class="forum-name-link">{{ node.obj.name }}</a>
|
||||
<div class="forum-description">{{ node.obj.description.rendered }}</div>
|
||||
<div class="sub-forums"><small>{{ children }}</small></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="hidden py-2 pr-4 pl-4 md:block forum-syndication"><a href="{% url 'forum_feeds:forum_latest_topics_with_descendants' node.obj.slug node.obj.pk %}" title="{% trans 'RSS feed' %}"><img src="{% static 'img/icons/icon_signal.svg' %}" /></a></div>
|
||||
<div class="hidden py-2 pr-4 pl-4 text-center md:block forum-count">{{ node.topics_count }}</div>
|
||||
<div class="hidden py-2 pr-4 pl-4 text-center md:block forum-count">{{ node.posts_count }}</div>
|
||||
<div class="hidden py-2 pr-4 pl-4 sm:block sm:w-1/4 forum-last-post">
|
||||
{% if node.last_post %}
|
||||
{% if node.last_post.poster %}
|
||||
{% url 'forum_member:profile' node.last_post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=node.last_post.poster|forum_member_display_name %}
|
||||
By: <a href="{{ poster_url }}" class="text-orange">{{ username }}</a>
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=node.last_post.username %}
|
||||
By: {{ poster_username }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
<a href="{% url 'forum_conversation:topic' node.obj.slug node.obj.pk node.last_post.topic.slug node.last_post.topic.pk %}?post={{ node.last_post.pk }}#{{ node.last_post.pk }}"><i class="fas fa-arrow-circle-right"></i></a>
|
||||
<br />
|
||||
<small>{{ node.last_post.created }}</small>
|
||||
{% else %}
|
||||
{% trans "No posts" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="pr-4 pl-0 pl-4 w-5/6 sm:w-3/4 md:w-2/3 forum-name" colspan="2">
|
||||
<table class="forum-data-table">
|
||||
<tr>
|
||||
<td class="pt-1 pr-3 align-top forum-icon link"><i class="fas fa-link fa-2x"></i></td>
|
||||
<td class="align-top">
|
||||
<a href="{% url 'forum:forum' node.obj.slug node.obj.id %}" class="forum-name-link">{{ node.obj.name }}</a>
|
||||
<div class="forum-description">{{ node.obj.description.rendered }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="hidden pr-4 pl-4 md:block md:w-1/6 forum-count"></div>
|
||||
<div class="hidden pr-4 pl-4 md:block md:w-1/6 forum-count"></div>
|
||||
<div class="hidden py-2 pr-4 pl-4 sm:block sm:w-1/4 md:w-1/5 forum-link-redirects">
|
||||
{% if node.obj.link_redirects %}
|
||||
{% trans "Total redirects:" %} {{ node.obj.link_redirects_count|default:"0" }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% with node.next_sibling.obj as next_sibling %}
|
||||
{% if next_sibling and next_sibling.is_category or not next_sibling in forum_contents.visible_forums or not next_sibling %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% elif node.level == root_level_middle %}
|
||||
{% if node.parent.obj.is_category %}
|
||||
<div class="flex flex-wrap py-2 px-3 m-0 border-b">
|
||||
{% if not node.obj.is_link %}
|
||||
<div class="pr-4 pl-0 pl-4 w-5/6 sm:w-3/4 md:w-3/5 forum-name">
|
||||
<table class="forum-data-table">
|
||||
<tr>
|
||||
<td class="pt-1 pr-3 align-top forum-icon {% if node.obj in unread_forums %}unread{% endif %}"><i class="far fa-circle fa-2x"></i></td>
|
||||
{% if node.obj.image %}
|
||||
<td>
|
||||
<div class="hidden pr-2 md:block forum-image">
|
||||
<img src="{{ node.obj.image.url }}" alt="{{ node.obj.name }}" />
|
||||
</div>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td class="align-top">
|
||||
<a href="{% url 'forum:forum' node.obj.slug node.obj.id %}" class="forum-name-link">{{ node.obj.name }}</a>
|
||||
<div class="forum-description">{{ node.obj.description.rendered }}</div>
|
||||
<div class="sub-forums"><small>{{ children }}</small></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="hidden py-2 pr-4 pl-4 md:block md:w-1/6 forum-syndication"><a href="{% url 'forum_feeds:forum_latest_topics_with_descendants' node.obj.slug node.obj.pk %}" title="{% trans 'RSS feed' %}"><i class="fas fa-rss-square"></i></a></div>
|
||||
<div class="hidden py-2 pr-4 pl-4 text-center md:block md:w-1/6 forum-count">{{ node.topics_count }}</div>
|
||||
<div class="hidden py-2 pr-4 pl-4 text-center md:block md:w-1/6 forum-count">{{ node.posts_count }}</div>
|
||||
<div class="hidden py-2 pr-4 pl-4 sm:block sm:w-1/4 md:w-1/5 forum-last-post">
|
||||
{% if node.last_post %}
|
||||
{% if node.last_post.poster_id %}
|
||||
{% url 'forum_member:profile' node.last_post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=node.last_post.poster|forum_member_display_name %}
|
||||
By: <a href="{{ poster_url }}">{{ username }}</a>
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=node.last_post.username %}
|
||||
By: {{ poster_username }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
<a href="{% url 'forum_conversation:topic' node.obj.slug node.obj.pk node.last_post.topic.slug node.last_post.topic.pk %}?post={{ node.last_post.pk }}#{{ node.last_post.pk }}"><i class="fas fa-arrow-circle-right"></i></a>
|
||||
<br />
|
||||
<small>{{ node.last_post.created }}</small>
|
||||
{% else %}
|
||||
{% trans "No posts" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="pr-4 pl-0 pl-4 w-5/6 sm:w-3/4 md:w-2/3 forum-name" colspan="2">
|
||||
<table class="forum-data-table">
|
||||
<tr>
|
||||
<td class="pt-1 pr-3 align-top forum-icon link"><i class="fas fa-link fa-2x"></i></td>
|
||||
<td class="align-top">
|
||||
<a href="{% url 'forum:forum' node.obj.slug node.obj.id %}" class="forum-name-link">{{ node.obj.name }}</a>
|
||||
<div class="forum-description">{{ node.obj.description.rendered }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="hidden pr-4 pl-4 md:block md:w-1/6 forum-count"></div>
|
||||
<div class="hidden pr-4 pl-4 md:block md:w-1/6 forum-count"></div>
|
||||
<div class="hidden py-2 pr-4 pl-4 sm:block sm:w-1/4 md:w-1/5 forum-last-post forum-link-redirects">
|
||||
{% if node.obj.link_redirects %}
|
||||
{% trans "Total redirects:" %} {{ node.obj.link_redirects_count|default:"0" }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% if not node.previous_sibling %}
|
||||
<b>{% trans "Subforums:" %}</b>
|
||||
{% endif %}
|
||||
<i class="fas fa-file"></i> <a href="{% url 'forum:forum' node.obj.slug node.obj.id %}">{{ node.obj.name }}</a>
|
||||
{% endif %}
|
||||
{% elif node.level == root_level_sub %}
|
||||
{% if not node.previous_sibling %}
|
||||
<b>{% trans "Subforums:" %}</b>
|
||||
{% endif %}
|
||||
<i class="fas fa-file"></i> <a href="{% url 'forum:forum' node.obj.slug node.obj.id %}">{{ node.obj.name }}</a>
|
||||
{% endif %}
|
||||
{% endrecurseforumcontents %}
|
||||
{% else %}
|
||||
<div class="flex relative flex-col mt-3 min-w-0 break-words rounded border border-gray-300 border-1 forumlist">
|
||||
<div class="p-0 py-3 px-6 mb-0 border-gray-300 border-b-1">
|
||||
<div class="flex flex-wrap py-2 px-3 m-0">
|
||||
<div class="pr-4 pl-0 pl-4 w-3/4 sm:w-3/4 md:w-2/3 forum-name-col">
|
||||
<h3 class="m-0 mb-3 h5">{% trans "Forums" %}</h3>
|
||||
</div>
|
||||
<div class="hidden pr-4 pl-4 text-center md:block md:w-1/6 whitespace-no-wrap forum-count-col">{% trans "Topics" %}</div>
|
||||
<div class="hidden pr-4 pl-4 text-center md:block md:w-1/6 whitespace-no-wrap forum-count-col">{% trans "Posts" %}</div>
|
||||
<div class="hidden pr-0 pr-4 pl-4 sm:block sm:w-1/4 md:w-1/5 whitespace-no-wrap forum-last-post-col">{% trans "Last post" %}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-auto p-0 p-6">
|
||||
<div class="flex flex-wrap py-2 px-3 m-0">
|
||||
<div class="p-0 pr-4 pl-4 md:w-full">{% trans "No forums." %}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,35 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load mptt_tags %}
|
||||
{% load forum_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Index" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="flex flex-wrap mt-3">
|
||||
<div class="w-full forumlist-top-controls">
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="float-right">
|
||||
<a href="{% url 'forum_tracking:mark_all_forums_read' %}" class="inline-block uppercase"><i class="fas fa-check-circle"> </i>{% trans "Mark forums read" %}</a>
|
||||
</div>
|
||||
<a href="{% url 'forum_tracking:unread_topics' %}" class="inline-block uppercase">{% trans "View unread topics" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% forum_list forums %}
|
||||
<div class="flex flex-wrap my-4">
|
||||
<div class="w-full forum-page-statistics">
|
||||
<h3 class="page-header">{% trans "Stats" %}</h3>
|
||||
<div class="flex mt-3 space-x-24">
|
||||
<div>
|
||||
<h4>{% trans "Total Posts" %}</h4>
|
||||
{{ total_posts_count }}
|
||||
</div>
|
||||
<div>
|
||||
<h4>{% trans "Total Topics" %}</h4>
|
||||
{{ total_topics_count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,43 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
{{ attachment_formset.management_form }}
|
||||
{% for form in attachment_formset.forms %}
|
||||
<div class="mb-4 space-y-3 w-full attachment-form">
|
||||
{% for field in form.visible_fields %}
|
||||
<div class="my-5">
|
||||
{% if forloop.first %}
|
||||
{{ form.id }}
|
||||
{% endif %}
|
||||
{% if field.html_name in form.files.keys %}
|
||||
{% for key, file in form.files.items %}
|
||||
{% if key == field.html_name %}
|
||||
<p class="initial"><i class="fa fa-file"></i> {{ file.name }}</p>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if field.name == 'DELETE' %}
|
||||
<div class="mt-3 checkbox">
|
||||
<label for="{{ field.auto_id }}">
|
||||
{{ field }}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% elif field.name == 'file' %}
|
||||
<div id="div_id_{{ field.html_name }}" class="form-group{% if field.errors %} has-error{% endif %}">
|
||||
<div class="controls">
|
||||
{% if field.label %}<label class="control-label" for="{{ field.auto_id }}">{{ field.label }}{% if not field.field.required %} <span class="text-muted">{% trans "(optional)" %}</span>{% endif %}</label>{% endif %}
|
||||
{{ field }}
|
||||
{% if field.help_text %}<p class="help-block">{{ field.help_text }}</p>{% endif %}
|
||||
{% for error in field.errors %}<p class="error">{{ error }}</p>{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% include "partials/form_field.html" with field=field %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<a href="#" id="add_more_attachment" class="py-3 px-4 my-5 text-xs uppercase rounded border border-slate text-orange">
|
||||
<i class="icon-white icon-plus-sign"></i> {% trans "Add another file" %}
|
||||
</a>
|
||||
@@ -1,19 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% load forum_permission_tags %}
|
||||
|
||||
{% get_permission 'can_download_files' post.topic.forum request.user as user_can_download_files %}
|
||||
{% if post.attachments.exists and user_can_download_files %}
|
||||
<div class="space-y-4 w-full attachments">
|
||||
<div class="col-md-12">
|
||||
<span class="text-muted attachments-title"><i class="fa fa-files-o"></i> {% trans "Attachments" %}</span>
|
||||
</div>
|
||||
{% for attachment in post.attachments.all %}
|
||||
<div class="w-full attachment">
|
||||
<a href="{% url 'forum_conversation:attachment' pk=attachment.id %}"><i class="fa fa-file"></i> {{ attachment.filename }} ({{ attachment.file.size|filesizeformat }})</a>
|
||||
{% if attachment.comment %}
|
||||
<p class="text-muted"><em>{{ attachment.comment }}</em></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,19 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% if attachment_preview %}
|
||||
<div class="row attachments">
|
||||
{% if attachment_file_previews %}
|
||||
<div class="col-md-12">
|
||||
<span class="text-muted attachments-title"><i class="fa fa-files-o"></i> {% trans "Attachments" %}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% for attachment_form, filename in attachment_file_previews %}
|
||||
<div class="col-md-12 attachment">
|
||||
<a href="#"><i class="fa fa-file"></i> {{ filename }}</a>
|
||||
{% if attachment_form.comment.value %}
|
||||
<p class="text-muted"><em>{{ attachment_form.comment.value }}</em></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,50 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% load forum_permission_tags %}
|
||||
{% load forum_polls_tags %}
|
||||
|
||||
<div class="my-3 card poll">
|
||||
<div class="card-body">
|
||||
<div class="w-full">
|
||||
{% get_permission 'can_vote_in_poll' poll request.user as user_can_vote_in_poll %}
|
||||
{% with can_be_completed=user_can_vote_in_poll has_been_completed=poll|has_been_completed_by:request.user poll=poll %}
|
||||
<h4 class="question">{{ poll.question }}</h4>
|
||||
<hr />
|
||||
<div class="my-3 max-options-indication">
|
||||
{% if can_be_completed and not view_results_action %}
|
||||
{% if not has_been_completed or change_vote_action %}
|
||||
{% if poll.max_options == 1 %}
|
||||
{% blocktrans trimmed %}
|
||||
You may select <b>1</b> option
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with max_options=poll.max_options %}
|
||||
You may select up to <b>{{ max_options }}</b> options
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="poll-options">
|
||||
{% if can_be_completed and not has_been_completed and not view_results_action %}
|
||||
{% include "forum_conversation/forum_polls/poll_vote_form.html" %}
|
||||
{% elif can_be_completed and has_been_completed and change_vote_action %}
|
||||
{% include "forum_conversation/forum_polls/poll_vote_form.html" %}
|
||||
{% else %}
|
||||
{% include "forum_conversation/forum_polls/poll_results.html" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if view_results_action %}
|
||||
<div class="form-actions">
|
||||
<br />
|
||||
<a href="."><i class="fa fa-chevron-circle-right"></i> {% trans "Vote" %}</a>
|
||||
</div>
|
||||
{% elif can_be_completed and has_been_completed and not change_vote_action %}
|
||||
<div class="form-actions">
|
||||
<br />
|
||||
<a href="?change_vote=true"><i class="fa fa-chevron-circle-right"></i> {% trans "Change your vote" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,34 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
<label>{% trans "Poll options" %}</label>
|
||||
{{ poll_option_formset.management_form }}
|
||||
{% for form in poll_option_formset.forms %}
|
||||
<div class="poll-option-form row">
|
||||
{% for field in form.visible_fields %}
|
||||
<div class="col-md-6">
|
||||
{% if forloop.first %}
|
||||
{{ form.id }}
|
||||
{% endif %}
|
||||
{% if field.name == 'DELETE' %}
|
||||
<div class="checkbox">
|
||||
<label for="{{ field.auto_id }}">
|
||||
{{ field }}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% else %}
|
||||
{% include "partials/form_field.html" with field=field %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="py-3">
|
||||
<a href="#" id="add_more_poll_option" class="py-2 px-3 my-3 text-sm rounded border border-slate text-orange"><i class="icon-white icon-plus-sign"></i> {% trans "Add a poll option" %}</a>
|
||||
</div>
|
||||
{% if poll_option_formset.initial_form_count %}
|
||||
<br /><br />
|
||||
<div class="alert alert-warning">
|
||||
{% blocktrans %}<b>Note:</b> Deleting poll options of an existing poll will delete the associated votes.{% endblocktrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,56 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
<div class="mb-3 row preview">
|
||||
<div class="col-12">
|
||||
<div class="card poll poll-preview">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 poll-content-wrapper">
|
||||
<h4 class="question">{% trans "Preview:" %} {{ post_form.poll_question.value }}</h4>
|
||||
<hr />
|
||||
<div class="mb-3 max-options-indication">
|
||||
{% if post_form.poll_max_options.value == '1' %}
|
||||
{% blocktrans trimmed %}
|
||||
You may select <b>1</b> option
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with max_options=post_form.poll_max_options.value %}
|
||||
You may select up to <b>{{ max_options }}</b> options
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="poll-options">
|
||||
{% for inline_form in poll_options_previews %}
|
||||
{% if forloop.first or not forloop.counter|divisibleby:2 %}
|
||||
<div class="row">
|
||||
{% endif %}
|
||||
<div class="col-md-6">
|
||||
<div class="well well-sm">
|
||||
{% if post_form.poll_max_options.value == '1' %}
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" value="">
|
||||
{{ inline_form.text.value }}
|
||||
</label>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" value="">
|
||||
{{ inline_form.text.value }}
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if forloop.last or forloop.counter|divisibleby:2 %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,19 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% for option in poll.options.all %}
|
||||
{% if forloop.first or not forloop.counter|divisibleby:2 %}
|
||||
<div class="mx-auto mb-3 w-full md:w-3/4">
|
||||
{% endif %}
|
||||
<div class="col-md-6">
|
||||
<b>{{ option.text }}</b> <span class="text-sm text-white/60">({{ option.percentage|floatformat }}%)</span>
|
||||
<div class="my-2 h-6 rounded bg-charcoal" aria-valuenow="{{ option.percentage|floatformat }}" aria-valuemin="0" aria-valuemax="100">
|
||||
<div class="{% if option.percentage > 0 %}w-[{{ option.percentage|floatformat }}%]{% else %}w-1{% endif %} bg-gradient-to-r from-green to-orange h-6 rounded"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% if forloop.last or forloop.counter|divisibleby:2 %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<div class="mx-auto mb-3 w-full md:w-3/4">
|
||||
{% trans "Total votes:" %} {{ poll.votes|length }}
|
||||
</div>
|
||||
@@ -1,38 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
<form method="post" action="{% url 'forum_conversation:topic_poll_vote' poll.pk %}" class="form" novalidate>
|
||||
{% csrf_token %}
|
||||
|
||||
{% for option in poll_form.options.field.queryset %}
|
||||
{% if forloop.first or not forloop.counter|divisibleby:2 %}
|
||||
<div class="row">
|
||||
{% endif %}
|
||||
<div class="col-md-6">
|
||||
<div class="well well-sm">
|
||||
{% if poll.max_options == 1 %}
|
||||
<div class="radio">
|
||||
<label class="peer-checked:text-orange">
|
||||
<input type="radio" name="options" value="{{ option.id }}" class="mr-1 rounded-full border cursor-pointer bg-charcoal peer checked:bg-orange hover:bg-orange">
|
||||
{{ option.text }}
|
||||
</label>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="checkbox">
|
||||
<label class="peer-checked:text-orange">
|
||||
<input type="checkbox" name="options" value="{{ option.id }}" class="mr-1 rounded-sm border cursor-pointer bg-charcoal peer checked:bg-orange hover:bg-orange">
|
||||
{{ option.text }}
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if forloop.last or forloop.counter|divisibleby:2 %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="my-4 form-actions">
|
||||
<input type="submit" class="py-2 px-3 text-sm uppercase rounded rounded-lg border border-orange text-orange" value="{% trans "Submit" %}" />
|
||||
<a href="{% if change_vote_action %}.{% else %}?view_results=true{% endif %}" class="py-2 px-3 text-sm uppercase rounded rounded-lg border border-slate text-orange">{% trans "View results" %}</a>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,79 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% if post_form.non_field_errors %}
|
||||
{% for error in post_form.non_field_errors %}
|
||||
<div class="alert alert-danger">
|
||||
<i class="icon-exclamation-sign"></i> {{ error }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% include "partials/form_field.html" with field=post_form.subject %}
|
||||
{% include "partials/form_field.html" with field=post_form.content %}
|
||||
{% if post_form.username %}
|
||||
{% include "partials/form_field.html" with field=post_form.username %}
|
||||
{% endif %}
|
||||
{% if post_form.update_reason %}
|
||||
{% include "partials/form_field.html" with field=post_form.update_reason %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Sub "forms" panes -->
|
||||
<div class="tab-content" x-data="{ tab: '#options' }">
|
||||
<!-- Sub "forms" tabs -->
|
||||
{% if attachment_formset %}
|
||||
<ul class="flex flex-row justify-between w-full">
|
||||
<a href="#"
|
||||
:class="tab === '#options' ? 'border-b-4 border-orange text-orange' : 'border-b border-slate'"
|
||||
class="px-11 pb-4 w-1/2 text-center active"
|
||||
data-toggle="tab"
|
||||
x-on:click.prevent="tab='#options'"
|
||||
>{% trans "Options" %}</a>
|
||||
<a href="#"
|
||||
:class="tab === '#attachments' ? 'border-b-4 border-orange text-orange' : 'border-b border-slate'"
|
||||
class="px-11 pb-4 w-1/2 text-center"
|
||||
data-toggle="tab"
|
||||
x-on:click.prevent="tab='#attachments'"
|
||||
>{% trans "Attachments" %}</a>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="tab-pane active" id="options" x-show="tab == '#options'" x-cloak>
|
||||
<div class="form-group">
|
||||
<br />
|
||||
<div class="w-full">
|
||||
<div class="w-full">
|
||||
{% with field=post_form.enable_signature %}
|
||||
<div class="checkbox">
|
||||
<label for="{{ field.auto_id }}">
|
||||
{{ field }}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% if post_form.lock_topic %}
|
||||
{% with field=post_form.lock_topic %}
|
||||
<div class="checkbox">
|
||||
<label for="{{ field.auto_id }}">
|
||||
{{ field }}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if attachment_formset %}
|
||||
<div class="tab-pane" id="attachments" x-show="tab == '#attachments'" x-cloak>
|
||||
<div class="form-group">
|
||||
<br />
|
||||
<div class="row">
|
||||
<div id="attachment_formset" class="col-md-12">
|
||||
<p class="lead attachments-title">{% trans "Attachments" %}</p>
|
||||
{% include "forum_conversation/forum_attachments/attachment_formset.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -1,79 +0,0 @@
|
||||
{% load i18n static %}
|
||||
{% load forum_permission_tags %}
|
||||
|
||||
{% get_permission 'can_add_post' topic request.user as user_can_add_post %}
|
||||
{% get_permission 'can_subscribe_to_topic' topic request.user as user_can_subscribe_to_topic %}
|
||||
{% get_permission 'can_unsubscribe_from_topic' topic request.user as user_can_unsubscribe_from_topic %}
|
||||
{% get_permission 'can_lock_topics' topic.forum request.user as user_can_lock_topics %}
|
||||
{% get_permission 'can_move_topics' topic.forum request.user as user_can_move_topics %}
|
||||
{% get_permission 'can_delete_topics' topic.forum request.user as user_can_delete_topics %}
|
||||
{% get_permission 'can_update_topics_to_normal_topics' topic.forum request.user as user_can_change_to_normal_topics %}
|
||||
{% get_permission 'can_update_topics_to_sticky_topics' topic.forum request.user as user_can_change_to_sticky_topics %}
|
||||
{% get_permission 'can_update_topics_to_announces' topic.forum request.user as user_can_change_to_announces %}
|
||||
|
||||
{% if user_can_add_post %}
|
||||
<a href="{% url 'forum_conversation:post_create' forum.slug forum.pk topic.slug topic.pk %}"
|
||||
class="py-3 px-4 text-sm uppercase rounded rounded-lg border border-orange text-orange"><img
|
||||
class="inline-block mr-2" src="{% static 'img/icons/icon_button-talk-bubble.svg' %}"/>{% trans "Post reply" %}</a>
|
||||
{% endif %}
|
||||
{% if user_can_subscribe_to_topic %}
|
||||
<a href="{% url 'forum_member:topic_subscribe' topic.pk %}"
|
||||
class="py-3 px-4 text-sm uppercase rounded rounded-lg border border-slate text-orange"><img
|
||||
class="inline-block mr-2" src="{% static 'img/icons/icon_button-checkmark.svg' %}"/>{% trans "Subscribe" %}</a>
|
||||
{% elif user_can_unsubscribe_from_topic %}
|
||||
<a href="{% url 'forum_member:topic_unsubscribe' topic.pk %}" class="py-3 px-4 text-sm uppercase rounded rounded-lg border border-slate text-orange"><img
|
||||
class="inline-block mr-2" src="{% static 'img/icons/icon_button-checkmark.svg' %}"/>{% trans "Unsubscribe" %}</a>
|
||||
{% endif %}
|
||||
{% if user_can_lock_topics and not topic.is_locked or user_can_move_topics or user_can_delete_topics %}
|
||||
<div class="inline-block relative" x-data="{ menuOpen: false }">
|
||||
<button id="id_dropdown_moderation_menu_button" class="py-3 px-4 rounded rounded-lg border border-slate text-orange"
|
||||
type="button"
|
||||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
@click="menuOpen = !menuOpen"
|
||||
>
|
||||
<img src="{% static 'img/icons/icon_button-gavel.svg' %}" class="inline-block mr-2" /><i class="fas fa-caret-down"></i>
|
||||
</button>
|
||||
|
||||
<!-- Moderator menu -->
|
||||
<div x-show="menuOpen"
|
||||
class="absolute inset-x-0 top-14 p-3 space-y-2 bg-black rounded border border-slate text-orange w-[200px]"
|
||||
aria-labelledby="id_dropdown_moderation_menu_button"
|
||||
@click.away="menuOpen = !menuOpen"
|
||||
>
|
||||
{% if user_can_lock_topics and not topic.is_locked %}
|
||||
<a href="{% url 'forum_moderation:topic_lock' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Lock topic" %}</a>{% endif %}
|
||||
{% if user_can_lock_topics and topic.is_locked %}
|
||||
<a href="{% url 'forum_moderation:topic_unlock' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Unlock topic" %}</a>{% endif %}
|
||||
{% if user_can_delete_topics %}<a href="{% url 'forum_moderation:topic_delete' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Delete topic" %}</a>{% endif %}
|
||||
{% if user_can_move_topics %}<a href="{% url 'forum_moderation:topic_move' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Move topic" %}</a>{% endif %}
|
||||
{% if topic.is_topic %}
|
||||
{% if user_can_change_to_sticky_topics %}
|
||||
<a href="{% url 'forum_moderation:topic_update_to_sticky' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Change to sticky topic" %}</a>{% endif %}
|
||||
{% if user_can_change_to_announces %}
|
||||
<a href="{% url 'forum_moderation:topic_update_to_announce' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Change to announce" %}</a>{% endif %}
|
||||
{% elif topic.is_sticky %}
|
||||
{% if user_can_change_to_normal_topics %}
|
||||
<a href="{% url 'forum_moderation:topic_update_to_post' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Change to standard topic" %}</a>{% endif %}
|
||||
{% if user_can_change_to_announces %}
|
||||
<a href="{% url 'forum_moderation:topic_update_to_announce' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Change to announce" %}</a>{% endif %}
|
||||
{% elif topic.is_announce %}
|
||||
{% if user_can_change_to_normal_topics %}
|
||||
<a href="{% url 'forum_moderation:topic_update_to_post' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Change to standard topic" %}</a>{% endif %}
|
||||
{% if user_can_change_to_sticky_topics %}
|
||||
<a href="{% url 'forum_moderation:topic_update_to_sticky' slug=topic.slug pk=topic.pk %}"
|
||||
class="block">{% trans "Change to sticky topic" %}</a>{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,121 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
<form method="post" action="." class="space-y-4 form" enctype="multipart/form-data" novalidate>{% csrf_token %}
|
||||
{% for error in post_form.non_field_errors %}
|
||||
<div class="alert alert-danger">
|
||||
<i class="icon-exclamation-sign"></i> {{ error }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% include "partials/form_field.html" with field=post_form.subject %}
|
||||
{% include "partials/form_field.html" with field=post_form.content %}
|
||||
{% if post_form.username %}
|
||||
{% include "partials/form_field.html" with field=post_form.username %}
|
||||
{% endif %}
|
||||
{% if post_form.update_reason %}
|
||||
{% include "partials/form_field.html" with field=post_form.update_reason %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Sub "forms" panes -->
|
||||
<div class="tab-content" x-data="{ tab: '#options' }">
|
||||
<!-- Sub "forms" tabs -->
|
||||
{% if poll_option_formset or attachment_formset %}
|
||||
<ul class="flex flex-row justify-between w-full">
|
||||
<a href="#options"
|
||||
:class="tab === '#options' ? 'border-b-4 border-orange text-orange' : 'border-b border-slate'"
|
||||
class="px-11 pb-4 w-1/2 text-center active"
|
||||
data-toggle="tab"
|
||||
x-on:click.prevent="tab='#options'"
|
||||
>{% trans "Options" %}</a>
|
||||
{% if poll_option_formset %}
|
||||
<a href="#poll"
|
||||
:class="tab === '#poll' ? 'border-b-4 border-orange text-orange' : 'border-b border-slate'"
|
||||
class="px-11 pb-4 w-1/2 text-center active"
|
||||
data-toggle="tab"
|
||||
x-on:click.prevent="tab='#poll'"
|
||||
>{% trans "Poll" %}</a>
|
||||
{% endif %}
|
||||
{% if attachment_formset %}
|
||||
<a href="#attachments"
|
||||
:class="tab === '#attachments' ? 'border-b-4 border-orange text-orange' : 'border-b border-slate'"
|
||||
class="px-11 pb-4 w-1/2 text-center active"
|
||||
data-toggle="tab"
|
||||
x-on:click.prevent="tab='#attachments'"
|
||||
>{% trans "Attachments" %}</a>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="tab-pane active" id="options" x-show="tab == '#options'" x-cloak>
|
||||
<div class="form-group">
|
||||
<br />
|
||||
<div class="w-full">
|
||||
<div class="w-full">
|
||||
{% include "partials/form_field.html" with field=post_form.topic_type %}
|
||||
{% with field=post_form.enable_signature %}
|
||||
<div class="mt-3 checkbox">
|
||||
<label for="{{ field.auto_id }}">
|
||||
{{ field }}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% if post_form.lock_topic %}
|
||||
{% with field=post_form.lock_topic %}
|
||||
<div class="checkbox">
|
||||
<label for="{{ field.auto_id }}">
|
||||
{{ field }}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if poll_option_formset %}
|
||||
<div class="tab-pane" id="poll" x-show="tab == '#poll'" x-cloak>
|
||||
<div class="form-group">
|
||||
<br />
|
||||
{% if poll_options_validated and poll_option_formset.non_form_errors %}<div class="alert alert-danger">{{ poll_option_formset.non_form_errors|striptags }}</div>{% endif %}
|
||||
<div class="flex space-x-4 w-full">
|
||||
<div class="space-y-4 w-1/2">
|
||||
{% include "partials/form_field.html" with field=post_form.poll_question %}
|
||||
{% include "partials/form_field.html" with field=post_form.poll_max_options %}
|
||||
{% include "partials/form_field.html" with field=post_form.poll_duration %}
|
||||
<div{% if post_form.poll_user_changes.errors %} class="has-error"{% endif %}>
|
||||
<div class="checkbox">
|
||||
<label for="{{ post_form.poll_user_changes.auto_id }}">
|
||||
{{ post_form.poll_user_changes }}
|
||||
{{ post_form.poll_user_changes.label }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="poll_formset" class="space-y-4 w-1/2">
|
||||
{% include "forum_conversation/forum_polls/poll_option_formset.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if attachment_formset %}
|
||||
<div class="tab-pane" id="attachments" x-show="tab == '#attachments'" x-cloak>
|
||||
<div class="form-group">
|
||||
<br />
|
||||
<div class="row">
|
||||
<div id="attachment_formset" class="col-md-12">
|
||||
{% include "forum_conversation/forum_attachments/attachment_formset.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="pt-6 form-actions">
|
||||
<input type="submit" name="preview" class="py-3 px-8 text-sm text-base font-medium uppercase rounded-md border md:py-1 md:px-4 md:text-lg border-slate text-orange" value="{% trans "Preview" %}" />
|
||||
<input type="submit" class="py-3 px-8 text-sm text-base font-medium uppercase rounded-md border md:py-1 md:px-4 md:text-lg border-orange text-orange" value="{% trans "Submit" %}" />
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,87 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
{% load forum_member_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Post a reply" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{{ topic.subject }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
{% if preview %}
|
||||
{% include "forum_conversation/post_preview.html" %}
|
||||
{% endif %}
|
||||
<div>
|
||||
<div class="w-full rounded border bg-charcoal/60 border-1 border-slate">
|
||||
<div class="card post-edit">
|
||||
<div class="py-2 px-4 border-b card-header border-slate">
|
||||
<h3 class="m-0 text-base h5 card-title">{% trans "Post a reply" %}</h3>
|
||||
</div>
|
||||
<div class="p-4 card-body">
|
||||
<form method="post" action="." class="space-y-4 form" enctype="multipart/form-data" novalidate>{% csrf_token %}
|
||||
{% include "forum_conversation/partials/post_form.html" %}
|
||||
<div class="pt-6 form-actions">
|
||||
<input type="submit" name="preview" class="py-3 px-8 text-sm text-base font-medium uppercase rounded-md border md:py-1 md:px-4 md:text-lg border-slate text-orange" value="{% trans "Preview" %}" />
|
||||
<input type="submit" class="py-3 px-8 text-sm text-base font-medium uppercase rounded-md border md:py-1 md:px-4 md:text-lg border-orange text-orange" value="{% trans "Submit" %}" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-review">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 h5 card-title">{% trans "Topic review" %} – {{ topic.subject }}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for post in previous_posts %}
|
||||
<div class="row post-review">
|
||||
<div class="col-md-10 post-content-wrapper">
|
||||
<h4 class="subject">{{ post.subject }}</h4>
|
||||
<p><small class="text-muted">
|
||||
{% spaceless %}
|
||||
<i class="fa fa-clock-o"></i>
|
||||
{% if post.poster %}
|
||||
{% url 'forum_member:profile' post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %}
|
||||
By: <a href="{{ poster_url }}">{{ username }}</a> on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=post.username creation_date=post.created %}
|
||||
By: {{ poster_username }} on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
||||
</small></p>
|
||||
<div class="post-content">
|
||||
{{ post.content.rendered }}
|
||||
</div>
|
||||
{% include "forum_conversation/forum_attachments/attachments_detail.html" %}
|
||||
</div>
|
||||
<div class="col-md-2 post-sidebar">
|
||||
<div class="username">{% if post.poster %}<a href="{% url 'forum_member:profile' post.poster_id %}"><b>{{ post.poster|forum_member_display_name }}</b></a>{% else %}<b>{{ post.username }}</b>{% endif %}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block onbodyload %}
|
||||
machina.attachment.init();
|
||||
{% endblock onbodyload %}
|
||||
|
||||
{% block extra_css %}
|
||||
{{ post_form.media.css }}
|
||||
{% endblock extra_css %}
|
||||
|
||||
{% block extra_js %}
|
||||
{{ post_form.media.js }}
|
||||
{% endblock extra_js %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Delete post" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card post-delete">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Delete post" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Are you sure you want to delete this post?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,21 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% load forum_markup_tags %}
|
||||
|
||||
<div class="mb-3 row preview">
|
||||
<div class="col-12">
|
||||
<div class="card post post-preview">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 post-content-wrapper">
|
||||
<h4 class="m-0 subject">{% trans "Preview:" %} {{ post_form.subject.value }}</h4>
|
||||
<hr />
|
||||
<div class="post-content">
|
||||
{{ post_form.content.value|safe|rendered }}
|
||||
</div>
|
||||
{% include "forum_conversation/forum_attachments/attachments_preview.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,46 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Edit post" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{{ topic.subject }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
{% if preview %}
|
||||
{% include "forum_conversation/post_preview.html" %}
|
||||
{% endif %}
|
||||
<div>
|
||||
<div class="w-full rounded border bg-charcoal/60 border-1 border-slate">
|
||||
<div class="card post-edit">
|
||||
<div class="py-2 px-4 border-b card-header border-slate">
|
||||
<h3 class="m-0 text-base h5 card-title">{% trans "Edit post" %}</h3>
|
||||
</div>
|
||||
<div class="p-4 card-body">
|
||||
<form method="post" action="." class="form" enctype="multipart/form-data" novalidate>{% csrf_token %}
|
||||
{% include "forum_conversation/partials/post_form.html" %}
|
||||
<div class="form-actions">
|
||||
<input type="submit" name="preview" class="py-3 px-8 text-sm text-base font-medium uppercase rounded-md border md:py-1 md:px-4 md:text-lg border-slate text-orange" value="{% trans "Preview" %}" />
|
||||
<input type="submit" class="py-3 px-8 text-sm text-base font-medium uppercase rounded-md border md:py-1 md:px-4 md:text-lg border-orange text-orange" value="{% trans "Submit" %}" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block onbodyload %}
|
||||
machina.attachment.init();
|
||||
{% endblock onbodyload %}
|
||||
|
||||
{% block extra_css %}
|
||||
{{ post_form.media.css }}
|
||||
{% endblock extra_css %}
|
||||
|
||||
{% block extra_js %}
|
||||
{{ post_form.media.js }}
|
||||
{% endblock extra_js %}
|
||||
@@ -1,44 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Post a new topic" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{{ forum.name }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
{% if poll_preview %}
|
||||
{% include "forum_conversation/forum_polls/poll_preview.html" %}
|
||||
{% endif %}
|
||||
{% if preview %}
|
||||
{% include "forum_conversation/post_preview.html" %}
|
||||
{% endif %}
|
||||
<div class="w-full">
|
||||
<div class="w-full rounded border bg-charcoal/60 border-1 border-slate">
|
||||
<div class="card post-edit">
|
||||
<div class="py-2 px-4 border-b card-header border-slate">
|
||||
<h3 class="m-0 text-base h5 card-title">{% trans "Post a new topic" %}</h3>
|
||||
</div>
|
||||
<div class="p-4 card-body">
|
||||
{% include "forum_conversation/partials/topic_form.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block onbodyload %}
|
||||
machina.poll.init();
|
||||
machina.attachment.init();
|
||||
{% endblock onbodyload %}
|
||||
|
||||
{% block extra_css %}
|
||||
{{ post_form.media.css }}
|
||||
{% endblock extra_css %}
|
||||
|
||||
{% block extra_js %}
|
||||
{{ post_form.media.js }}
|
||||
{% endblock extra_js %}
|
||||
@@ -1,127 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n static %}
|
||||
{% load forum_conversation_tags %}
|
||||
{% load forum_member_tags %}
|
||||
{% load forum_permission_tags %}
|
||||
|
||||
{% block sub_title %}{{ topic.subject }}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="mb-8 w-full"><h1 class="text-3xl">{{ topic.subject }}</h1></div>
|
||||
<div class="w-full">
|
||||
<div class="inline-flex items-center mb-6 space-x-3">
|
||||
{% include "forum_conversation/partials/topic_detail_actions.html" %}
|
||||
</div>
|
||||
<div class="pagination-block">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class="w-full">
|
||||
{% for post in posts %}
|
||||
{% if forloop.first and post.is_topic_head and poll %}
|
||||
{% include "forum_conversation/forum_polls/poll_detail.html" %}
|
||||
{% endif %}
|
||||
<div id="{{ post.id }}" class="my-3 card post">
|
||||
<div class="card-body">
|
||||
<div class="flex p-6 space-x-8 rounded border bg-charcoal border-1 border-slate">
|
||||
<div class="w-5/6 post-content-wrapper">
|
||||
<div class="float-right post-controls">
|
||||
{% get_permission 'can_edit_post' post request.user as user_can_edit_post %}
|
||||
{% if user_can_edit_post %}
|
||||
<a href="{% if post.is_topic_head %}{% url 'forum_conversation:topic_update' forum.slug forum.pk topic.slug topic.pk %}{% else %}{% url 'forum_conversation:post_update' forum.slug forum.pk topic.slug topic.pk post.pk %}{% endif %}"
|
||||
class="py-2 px-4 text-sm uppercase rounded rounded-lg border border-1 border-orange text-orange"
|
||||
title="{% trans "Edit" %}"
|
||||
>
|
||||
<img src="{% static 'img/icons/icon_button-edit.svg' %}" class="inline-block mr-4" />
|
||||
{% trans "Edit" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% get_permission 'can_delete_post' post request.user as user_can_delete_post %}
|
||||
{% if user_can_delete_post %}
|
||||
<a href="{% url 'forum_conversation:post_delete' forum.slug forum.pk topic.slug topic.pk post.pk %}"
|
||||
class="py-2 px-4 ml-3 text-sm uppercase rounded rounded-lg border border-1 border-orange text-orange"
|
||||
title="{% trans "Delete" %}">
|
||||
<i class="fas fa-times text-orange"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% spaceless %}
|
||||
<h4 class="items-center m-0 mb-3 text-2xl subject">
|
||||
{{ post.subject }}
|
||||
<a href="{% url 'forum_conversation:topic' forum.slug forum.pk topic.slug topic.pk %}?post={{ post.pk }}#{{ post.pk }}"><i class="text-sm fas fa-link text-white/60"></i></a>
|
||||
</h4>
|
||||
{% endspaceless %}
|
||||
<p class="p-0">
|
||||
<small class="text-muted">
|
||||
{% spaceless %}
|
||||
<img src="{% static 'img/icons/icon_clock.svg' %}" class="inline-block mr-4" />
|
||||
{% if post.poster %}
|
||||
{% url 'forum_member:profile' post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %}
|
||||
<span class="text-sm">By: <a href="{{ poster_url }}" class="text-orange">{{ username }}</a> on {{ creation_date }}</span>
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=post.username creation_date=post.created %}
|
||||
<span class="text-sm">By: {{ poster_username }} on {{ creation_date }}</span>
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
||||
</small>
|
||||
</p>
|
||||
<div class="post-content">
|
||||
{{ post.content.rendered }}
|
||||
</div>
|
||||
{% include "forum_conversation/forum_attachments/attachments_detail.html" %}
|
||||
{% if post.enable_signature and post.poster.forum_profile.signature %}
|
||||
<div class="post-signature">
|
||||
{{ post.poster.forum_profile.signature.rendered }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if post.updates_count %}
|
||||
<div class="mt-4 edit-info">
|
||||
<small class="text-muted">
|
||||
<i class="fas fa-edit"></i> {% if post.updated_by %}{% trans "Last edited by:" %} <a href="{% url 'forum_member:profile' post.updated_by_id %}">{{ post.updated_by|forum_member_display_name }}</a> {% else %}{% trans "Updated" %} {% endif %}{% trans "on" %} {{ post.updated }}, {% blocktrans count counter=post.updates_count %}edited {{counter }} time in total.{% plural %}edited {{counter }} times in total.{% endblocktrans %}
|
||||
</small>
|
||||
{% if post.update_reason %}
|
||||
<br />
|
||||
<small class="text-muted">
|
||||
<b>{% trans "Reason:" %}</b> {{ post.update_reason }}
|
||||
</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="w-1/6 text-sm d-none d-md-block post-sidebar">
|
||||
{% if post.poster %}
|
||||
<div class="avatar">
|
||||
<a href="{% url 'forum_member:profile' post.poster_id %}">
|
||||
{% include "partials/avatar.html" with profile=post.poster.forum_profile show_placeholder=True %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="username"><a class="text-orange" href="{% url 'forum_member:profile' post.poster_id %}"><b>{{ post.poster|forum_member_display_name }}</b></a></div>
|
||||
<div class="posts-count text-muted"><b>{% trans "Posts:" %}</b> {{ post.poster.forum_profile.posts_count }}</div>
|
||||
{% else %}
|
||||
<div class="username"><b>{{ post.username }}</b></div>
|
||||
<div class="username text-muted">{% trans "Anonymous user" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-11 w-full">
|
||||
<div class="inline-flex items-center space-x-3 w-1/2">
|
||||
{% include "forum_conversation/partials/topic_detail_actions.html" %}
|
||||
</div>
|
||||
<div class="w-full">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,83 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
{% load forum_member_tags %}
|
||||
{% load forum_tracking_tags %}
|
||||
|
||||
{% if topics or not hide_if_empty %}
|
||||
<div class="flex my-9">
|
||||
<div class="w-full">
|
||||
<div class="break-words rounded border card topiclist bg-charcoal border-1 border-slate">
|
||||
<div class="p-0 border-b border-slate">
|
||||
<div class="flex py-2 px-3 m-0">
|
||||
<div class="pl-0 w-2/3 text-sm uppercase topic-name-col">{% trans topic_list_title %}</div>
|
||||
<div class="w-1/6 text-sm text-center uppercase d-none d-md-block text-nowrap topic-count-col">{% trans "Replies" %}</div>
|
||||
<div class="w-1/6 text-sm text-center uppercase d-none d-md-block text-nowrap topic-count-col">{% trans "Views" %}</div>
|
||||
<div class="pr-0 w-1/6 text-sm uppercase d-none d-sm-block text-nowrap topic-last-post-col">{% trans "Last post" %}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-0 card-body">{% if not force_all_unread and unread_topics == None %}{% get_unread_topics topics request.user as unread_topics %}{% endif %}
|
||||
{% for topic in topics %}
|
||||
<div class="flex py-2 px-3 m-0 border-b border-slate">
|
||||
<div class="pl-0 w-2/3 col-md-8 col-sm-9 col-xs-11 topic-name">
|
||||
<div class="float-right topic-inline-pagination d-none d-sm-block">{% topic_pages_inline_list topic %}</div>
|
||||
<table class="topic-data-table">
|
||||
<tr>
|
||||
<td class="pt-1 pr-3 align-top topic-icon {% if topic in unread_topics or force_all_unread %}unread{% endif %}">
|
||||
<i class="fas {% if topic.is_sticky %}fa-lightbulb{% elif topic.is_announce %}fa-info{% else %}fa-dot-circle{% endif %} fa-2x"></i>
|
||||
</td>
|
||||
<td class="align-top topic-name">
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="text-xl topic-name-link">{{ topic.subject }}</a>{% if topic.is_locked %} <i class="fas fa-times-circle locked-indicator" title="{% trans 'This topic is locked' %}"></i>{% endif %}
|
||||
<div>
|
||||
<div class="topic-created">
|
||||
{% if topic.poster %}
|
||||
{% url 'forum_member:profile' topic.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=topic.poster|forum_member_display_name creation_date=topic.created %}
|
||||
<span class="text-sm">By: <a href="{{ poster_url }}" class="text-orange">{{ username }}</a> on {{ creation_date }}</span>
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=topic.first_post.username creation_date=topic.created %}
|
||||
<span class="text-sm">By: {{ poster_username }} on {{ creation_date }}</span>
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="py-2 w-1/6 text-center d-none d-md-block topic-count">{{ topic.posts_count|add:"-1" }}</div>
|
||||
<div class="py-2 w-1/6 text-center col-md-1 d-none d-md-block topic-count">{{ topic.views_count }}</div>
|
||||
<div class="py-2 w-1/6 col-md-2 col-sm-3 d-none d-sm-block topic-last-post">
|
||||
{% with last_post=topic.last_post %}
|
||||
{% if last_post.poster %}
|
||||
{% url 'forum_member:profile' last_post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=last_post.poster|forum_member_display_name %}
|
||||
<span class="text-sm">By: <a href="{{ poster_url }}" class="text-orange">{{ username }}</a></span>
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=last_post.username %}
|
||||
<span class="text-sm">By: {{ poster_username }}</span>
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}?post={{ last_post.pk }}#{{ last_post.pk }}"><i class="fas fa-arrow-circle-right"></i></a>
|
||||
<br />
|
||||
<small>{{ last_post.created }}</small>
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="py-2 px-3 m-0 row">
|
||||
<div class="p-0 col-12">
|
||||
{% if empty_message %}
|
||||
{{ empty_message }}
|
||||
{% else %}
|
||||
{% trans "There are no topics in this forum." %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,13 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% if first_pages %}
|
||||
[
|
||||
{% trans "Go to the page:" %}
|
||||
{% for page in first_pages %}
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.id topic.slug topic.pk %}?page={{ page }}">{{ page }}</a>{% if not forloop.last %}, {% elif forloop.last and last_page %}, {% endif %}
|
||||
{% endfor %}
|
||||
{% if last_page %}
|
||||
…, <a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.id topic.slug topic.pk %}?page={{ last_page }}">{{ last_page }}</a>
|
||||
{% endif %}
|
||||
]
|
||||
{% endif %}
|
||||
@@ -1,44 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Edit post" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{{ forum.name }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
{% if poll_preview %}
|
||||
{% include "forum_conversation/forum_polls/poll_preview.html" %}
|
||||
{% endif %}
|
||||
{% if preview %}
|
||||
{% include "forum_conversation/post_preview.html" %}
|
||||
{% endif %}
|
||||
<div>
|
||||
<div class="w-full rounded border bg-charcoal/60 border-1 border-slate">
|
||||
<div class="card post-edit">
|
||||
<div class="py-2 px-4 border-b card-header border-slate">
|
||||
<h3 class="m-0 text-base h5 card-title">{% trans "Edit post" %}</h3>
|
||||
</div>
|
||||
<div class="p-4 card-body">
|
||||
{% include "forum_conversation/partials/topic_form.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block onbodyload %}
|
||||
machina.poll.init();
|
||||
machina.attachment.init();
|
||||
{% endblock onbodyload %}
|
||||
|
||||
{% block extra_css %}
|
||||
{{ post_form.media.css }}
|
||||
{% endblock extra_css %}
|
||||
|
||||
{% block extra_js %}
|
||||
{{ post_form.media.js }}
|
||||
{% endblock extra_js %}
|
||||
@@ -1,10 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% load forum_member_tags %}
|
||||
|
||||
{{ obj.last_post.content.rendered|safe }}
|
||||
<br /><br />
|
||||
{% if obj.poster %}
|
||||
<i>{% trans "Posted by" %} {{ obj.poster|forum_member_display_name }} - {{ obj.created }}</i>
|
||||
{% else %}
|
||||
<i>{% trans "Posted by" %} {{ obj.first_post.username }} - {{ obj.created }}</i>
|
||||
{% endif %}
|
||||
@@ -1 +0,0 @@
|
||||
{{ obj.forum.name }} • {{ obj.subject }}
|
||||
@@ -1,73 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_member_tags %}
|
||||
|
||||
{% block sub_title %}{% blocktrans with username=profile.user|forum_member_display_name %}{{ username }} profile{% endblocktrans %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="mb-3 w-full">
|
||||
<h1 class="text-4xl">{% blocktrans with username=profile.user|forum_member_display_name %}{{ username }} profile{% endblocktrans %}</h1>
|
||||
</div>
|
||||
<div class="py-3 w-full profile">
|
||||
<div class="flex mb-6 profile-sidebar">
|
||||
<div class="w-1/3 profile-avatar">
|
||||
{% include "partials/avatar.html" with profile=profile show_placeholder=True %}
|
||||
</div>
|
||||
<div class="pb-3 w-2/3 text-right profile-username">
|
||||
<h3 class="mb-3 text-lg">{{ profile.user|forum_member_display_name }}</h3>
|
||||
{% if profile.user == request.user %}
|
||||
<a href="{%url 'forum_member:profile_update' %}" class="py-3 px-4 text-xs uppercase rounded border border-slate text-orange">{% trans "Edit profile" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-full">
|
||||
<div class="card-header">{% trans "Statistics" %}</div>
|
||||
|
||||
<div class="flex mt-3 space-x-24">
|
||||
<div>
|
||||
{% blocktrans count counter=profile.posts_count %}
|
||||
<h4><strong>{{ counter }}</strong></h4>
|
||||
<p><small>Post</small></p>{% plural %}<h4><strong>{{ counter }}</strong></h4>
|
||||
<p class="mb-1"><small>Posts</small></p>
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
<div>
|
||||
{% blocktrans count counter=topics_count %}
|
||||
<h4><strong>{{ counter }}</strong></h4>
|
||||
<p><small>Topic</small></p>{% plural %}<h4><strong>{{ counter }}</strong></h4>
|
||||
<p class="mb-1"><small>Topics</small></p>
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="p-3 w-full rounded border bg-charcoal border-slate">
|
||||
<h3 class="py-2 mb-6 border-b border-slate">{% trans "Recent posts" %}
|
||||
{% if recent_posts %}
|
||||
<span class="float-right py-1 px-3 w-auto text-xs uppercase rounded text-green bg-green/10">
|
||||
<a href="{% url 'forum_member:user_posts' profile.user_id %}">{% trans "View all" %}</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
</h3>
|
||||
|
||||
<div class="divide-y divide-slate">
|
||||
{% for post in recent_posts %}
|
||||
<div class="w-full">
|
||||
<div class="text-xl">
|
||||
<a href="{% url 'forum_conversation:topic' post.topic.forum.slug post.topic.forum.pk post.topic.slug post.topic.pk %}?post={{ post.pk }}#{{ post.pk }}">{{ post.subject }}</a>
|
||||
</div>
|
||||
<p class="py-1 text-sm">
|
||||
<i class="fa fa-clock-o"></i> {% blocktrans with creation_date=post.created %}On {{ creation_date }}{% endblocktrans %}
|
||||
</p>
|
||||
<div class="py-2">
|
||||
{{ post.content.rendered|truncatechars_html:160 }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,52 +0,0 @@
|
||||
{% extends "board_base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block sub_title %}{% trans "Edit forum profile" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row member-profile-edit">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 h5 card-title">{% trans "Edit forum profile" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="." class="form" enctype="multipart/form-data" novalidate>{% csrf_token %}{% if form.avatar %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="div_id_{{ form.avatar.html_name }}" class="form-group{% if form.avatar.errors %} has-error{% endif %}">
|
||||
<div class="controls">
|
||||
{% if form.avatar.label %}<label class="control-label" for="{{ field.auto_id }}">{{ form.avatar.label }}{% if not form.avatar.field.required %} <span class="text-muted">{% trans "(optional)" %}</span>{% endif %}</label>{% endif %}
|
||||
{{ form.avatar }}
|
||||
{% if form.avatar.help_text %}<p class="help-block">{{ form.avatar.help_text }}</p>{% endif %}
|
||||
{% for error in form.avatar.errors %}<p class="error">{{ error }}</p>{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{% include "partials/form_field.html" with field=form.signature %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-actions">
|
||||
<input type="submit" class="btn btn-large btn-primary" value="{% trans "Submit" %}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block extra_css %}
|
||||
{{ form.media.css }}
|
||||
{% endblock extra_css %}
|
||||
|
||||
{% block extra_js %}
|
||||
{{ form.media.js }}
|
||||
{% endblock extra_js %}
|
||||
@@ -1,42 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block sub_title %}{% trans "Topics that you are subscribed to" %}{% endblock sub_title %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1 class="text-3xl">{% trans "Topics that you are subscribed to" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<div class="col-6 col-md-4 forum-actions-block">
|
||||
{% if paginator.count > 0 %}
|
||||
<p class="mt-1 mb-0 text-muted">
|
||||
{% blocktrans trimmed count counter=paginator.count %}
|
||||
{{ counter }} topic found
|
||||
{% plural %}
|
||||
{{ counter }} topics found
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-12 col-md-8 pagination-block">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% trans "Not topics found." as empty_message %}
|
||||
{% with topic_list_title="Topics" empty_message=empty_message %}
|
||||
{% include "forum_conversation/topic_list.html" %}
|
||||
{% endwith %}
|
||||
<div class="mt-3 row">
|
||||
<div class="col-12 pagination-block">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Subscribe to topic" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card post-delete">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Subscribe to topic" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Would you like to subscribe to this topic?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="py-2 px-3 rounded border border-orange text-orange">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="py-3 px-3 ml-3 text-white rounded border border-slate">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Unsubscribe from topic" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card post-delete">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Unsubscribe from topic" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Would you like to unsubscribe from this topic?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="py-2 px-3 rounded border border-orange text-orange">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="py-3 px-3 ml-3 text-white rounded border border-slate">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,82 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_member_tags %}
|
||||
|
||||
{% block sub_title %}{% if poster == request.user %}{% trans "My messages" %}{% else %}{% blocktrans with username=poster|forum_member_display_name %}{{ username }}'s posts{% endblocktrans %}{% endif %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{% if poster == request.user %}{% trans "My messages" %}{% else %}{% blocktrans with username=poster|forum_member_display_name %}{{ username }}'s posts{% endblocktrans %}{% endif %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6 col-md-4 forum-actions-block">
|
||||
{% if paginator.count > 0 %}
|
||||
<p class="mt-1 mb-0 text-muted">
|
||||
{% blocktrans trimmed count counter=paginator.count %}
|
||||
{{ counter }} post found
|
||||
{% plural %}
|
||||
{{ counter }} posts found
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% else %}
|
||||
<p class="mt-1 mb-0 text-muted">{% trans "No posts found" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-12 col-md-8 pagination-block">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row member-posts">
|
||||
<div class="col-12">
|
||||
{% for post in posts %}
|
||||
<div id="{{ post.id }}" class="my-3 card post">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-10 post-content-wrapper">
|
||||
{% spaceless %}
|
||||
<h4 class="subject">
|
||||
<a href="{% url 'forum_conversation:topic' post.topic.forum.slug post.topic.forum.pk post.topic.slug post.topic.pk %}?post={{ post.pk }}#{{ post.pk }}">{{ post.subject }}</a>
|
||||
</h4>
|
||||
{% endspaceless %}
|
||||
<p>
|
||||
<small class="text-muted">
|
||||
{% spaceless %}
|
||||
<i class="fas fa-clock"></i>
|
||||
{% url 'forum_member:profile' post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %}
|
||||
By: <a href="{{ poster_url }}">{{ username }}</a> on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% endspaceless %}
|
||||
</small>
|
||||
</p>
|
||||
<div class="post-content">
|
||||
{{ post.content.rendered|truncatechars_html:250 }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 post-sidebar">
|
||||
<div class="avatar">
|
||||
<a href="{% url 'forum_member:profile' post.poster_id %}">
|
||||
{% include "partials/avatar.html" with profile=post.poster placeholder=False %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="username"><a href="{% url 'forum_member:profile' post.poster_id %}"><b>{{ post.poster|forum_member_display_name }}</b></a></div>
|
||||
<div class="posts-count text-muted"><b>{% trans "Posts:" %}</b> {{ post.poster.forum_profile.posts_count }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 pagination-block">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,170 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_member_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Moderation queue" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{% trans "Moderation queue" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<div class="float-right">
|
||||
<a href="{% url 'forum_moderation:disapprove_queued_post' post.pk %}" class="btn btn-warning">{% trans "Disapprove" %}</a>
|
||||
<a href="{% url 'forum_moderation:approve_queued_post' post.pk %}" class="btn btn-success"><b>{% trans "Approve" %}</b></a>
|
||||
</div>
|
||||
<h4>{{ post.subject }}</h4>
|
||||
<p class="text-muted">{% if post.is_topic_head %}{% trans "New topic" %}{% else %}{% trans "New post" %}{% endif %}</p>
|
||||
</div>
|
||||
<div class="my-3 row">
|
||||
<div class="col-12">
|
||||
{% if post.is_topic_head and poll %}
|
||||
<div class="mb-3 card poll">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 poll-content-wrapper">
|
||||
<h4 class="question">{{ poll.question }}</h4>
|
||||
<hr />
|
||||
<div class="max-options-indication">
|
||||
{% if poll.max_options == 1 %}
|
||||
{% blocktrans trimmed %}
|
||||
<b>1</b> option may be selected
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with max_options=poll.max_options %}
|
||||
Up to <b>{{ max_options }}</b> options may be selected
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="poll-options">
|
||||
{% for option in poll_options %}
|
||||
{% if forloop.first or not forloop.counter|divisibleby:2 %}
|
||||
<div class="row">
|
||||
{% endif %}
|
||||
<div class="col-md-6">
|
||||
<div class="well well-sm">
|
||||
{% if poll.max_options == 1 %}
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="options" value="{{ option.id }}">
|
||||
{{ option.text }}
|
||||
</label>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="options" value="{{ option.id }}">
|
||||
{{ option.text }}
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if forloop.last or forloop.counter|divisibleby:2 %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="{{ post.id }}" class="card post">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-10 post-content-wrapper">
|
||||
<h4 class="subject">{{ post.subject }}</h4>
|
||||
<p>
|
||||
<small class="text-muted">
|
||||
{% spaceless %}
|
||||
<i class="fas fa-clock"></i>
|
||||
{% if post.poster %}
|
||||
{% url 'forum_member:profile' post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %}
|
||||
By: <a href="{{ poster_url }}">{{ username }}</a> on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=post.username creation_date=post.created %}
|
||||
By: {{ poster_username }} on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
||||
</small>
|
||||
</p>
|
||||
<div class="post-content">
|
||||
{{ post.content.rendered }}
|
||||
</div>
|
||||
{% include "forum_conversation/forum_attachments/attachments_detail.html" %}
|
||||
{% if post.enable_signature and post.poster.forum_profile.signature %}
|
||||
<div class="post-signature">
|
||||
{{ post.poster.forum_profile.signature.rendered }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 post-sidebar">
|
||||
{% if post.poster %}
|
||||
{% if post.poster.forum_profile.avatar %}
|
||||
<div class="avatar">
|
||||
<a href="{% url 'forum_member:profile' post.poster_id %}">
|
||||
{% include "partials/avatar.html" with profile=post.poster.forum_profile placeholder=False %}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="username"><a href="{% url 'forum_member:profile' post.poster_id %}"><b>{{ post.poster|forum_member_display_name }}</b></a></div>
|
||||
<div class="posts-count text-muted"><b>{% trans "Posts:" %}</b> {{ post.poster.forum_profile.posts_count }}</div>
|
||||
{% else %}
|
||||
<div class="username"><b>{{ post.username }}</b></div>
|
||||
<div class="username text-muted">{% trans "Anonymous user" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if previous_posts %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-review">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 h5 card-title">{% trans "Topic review" %} – {{ post.topic.subject }}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for post in previous_posts %}
|
||||
<div class="row post-review">
|
||||
<div class="col-md-10 post-content-wrapper">
|
||||
<h4 class="subject">{{ post.subject }}</h4>
|
||||
<p><small class="text-muted">
|
||||
{% spaceless %}
|
||||
<i class="fas fa-clock"></i>
|
||||
{% if post.poster %}
|
||||
{% url 'forum_member:profile' post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %}
|
||||
By: <a href="{{ poster_url }}">{{ username }}</a> on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=post.username creation_date=post.created %}
|
||||
By: {{ poster_username }} on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
||||
</small></p>
|
||||
<div class="post-content">
|
||||
{{ post.content.rendered }}
|
||||
</div>
|
||||
{% include "forum_conversation/forum_attachments/attachments_detail.html" %}
|
||||
</div>
|
||||
<div class="col-md-2 post-sidebar">
|
||||
<div class="username">{% if post.poster %}<a href="{% url 'forum_member:profile' post.poster_id %}"><b>{{ post.poster|forum_member_display_name }}</b></a>{% else %}<b>{{ post.username }}</b>{% endif %}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
@@ -1,94 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_member_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Moderation queue" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{% trans "Moderation queue" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<div class="col-6 col-md-4 forum-actions-block">
|
||||
{% if paginator.count > 0 %}
|
||||
<p class="mt-1 mb-0 text-muted">
|
||||
{% blocktrans with paginator.count as topic_length %}{{ topic_length }} posts found{% endblocktrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-12 col-md-8 pagination-block">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card postmoderationlist">
|
||||
<div class="card-header">
|
||||
<div class="row panel-row">
|
||||
<div class="col-12 col-md-8 post-name-col">
|
||||
<h3 class="m-0 card-title h5">{% trans "Moderation queue" %}</h3>
|
||||
</div>
|
||||
<div class="col-md-2 d-none d-md-block moderation-col">{% trans "Topic" %}</div>
|
||||
<div class="col-md-2 d-none d-md-block moderation-col">{% trans "Forum" %}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-0 card-body">
|
||||
{% for post in posts %}
|
||||
<div class="m-0 row">
|
||||
<div class="col-12 col-md-8 post-name">
|
||||
<table class="post-data-table">
|
||||
<tr>
|
||||
<td class="post-name">
|
||||
<a href="{% url 'forum_moderation:queued_post' post.pk %}" class="post-name-link">{{ post.subject }}</a>
|
||||
<div>
|
||||
<div class="post-created">
|
||||
{% if post.poster %}
|
||||
{% url 'forum_member:profile' post.poster_id as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %}
|
||||
By: <a href="{{ poster_url }}">{{ username }}</a> on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=post.username creation_date=post.created %}
|
||||
By: {{ poster_username }} on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-2 d-none d-md-block topic-name">
|
||||
{% if post.is_topic_head %}
|
||||
<span class="badge badge-secondary">{% trans "New topic" %}</span>
|
||||
{% else %}
|
||||
<a href="{% url 'forum_conversation:topic' forum_slug=post.topic.forum.slug forum_pk=post.topic.forum.pk slug=post.topic.slug pk=post.topic.pk %}" class="post-name-link">{{ post.topic.subject }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 d-none d-md-block forum-name">
|
||||
<a href="{% url 'forum:forum' slug=post.topic.forum.slug pk=post.topic.forum.pk %}" class="post-name-link">{{ post.topic.forum.name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="py-2 px-3 m-0 row">
|
||||
<div class="p-0 col-12">
|
||||
{% trans "No posts awaiting approval." %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 pagination-block">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Approve post" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-lock">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Approve post" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Are you sure you want to approve this post?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_moderation:queued_post' post.pk %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Disapprove post" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-lock">
|
||||
<div class=card-header>
|
||||
<h3 class="m-0 card-title h5">{% trans "Disapprove post" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Are you sure you want to disapprove this post? This post will be deleted." %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_moderation:queued_post' post.pk %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Delete topic" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-delete">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Delete topic" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Are you sure you want to delete this topic?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Lock topic" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-lock">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Lock topic" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Are you sure you want to lock this topic?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,30 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Move topic" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-move">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Move topic" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
{% include "partials/form_field.html" with field=form.forum %}
|
||||
<div class="checkbox">
|
||||
<label for="{{ form.lock_topic.auto_id }}">
|
||||
{{ form.lock_topic }}
|
||||
{{ form.lock_topic.label }}
|
||||
</label>
|
||||
</div>
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Unlock topic" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-unlock">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Unlock topic" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Are you sure you want to unlock this topic?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Change topic type" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-update-type">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Change topic type" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{{ question }}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,31 +0,0 @@
|
||||
{% load i18n %}
|
||||
|
||||
<ul class="m-0 pagination {{ pagination_size|default:"" }}">
|
||||
<li class="page-item {% if not page.has_previous %}disabled{% endif %}">
|
||||
<a href="{% if page.has_previous %}?q={{ query }}&page={{ page.previous_page_number }}{% endif %}" class="page-link">«</a>
|
||||
</li>
|
||||
{% for number in paginator.page_range %}
|
||||
{% if forloop.first %}
|
||||
<li class="page-item{% if page.number == number %} active{% endif %}"><a href="?q={{ query }}&page={{ number }}" class="page-link">{{ number }}</a></li>
|
||||
{% if page.number > 4 %}
|
||||
<li class="page-item disabled"><a href="#" class="page-link">...</a></li>
|
||||
{% endif %}
|
||||
{% elif forloop.last %}
|
||||
{% if page.number < paginator.num_pages|add:"-3" %}
|
||||
<li class="page-item disabled"><a href="#" class="page-link">...</a></li>
|
||||
{% endif %}
|
||||
<li class="page-item{% if page.number == number %} active{% endif %}"><a href="?q={{ query }}&page={{ number }}" class="page-link">{{ number }}</a></li>
|
||||
{% else %}
|
||||
{% if page.number < 3 and number <= 5 %}
|
||||
<li class="page-item{% if page.number == number %} active{% endif %}"><a href="?q={{ query }}&page={{ number }}" class="page-link">{{ number }}</a></li>
|
||||
{% elif page.number > paginator.num_pages|add:"-2" and number >= paginator.num_pages|add:"-4" %}
|
||||
<li class="page-item{% if page.number == number %} active{% endif %}"><a href="?q={{ query }}&page={{ number }}" class="page-link">{{ number }}</a></li>
|
||||
{% elif number >= page.previous_page_number|add:"-1" and number <= page.next_page_number|add:"1" %}
|
||||
<li class="page-item{% if page.number == number %} active{% endif %}"<a href="?q={{ query }}&page={{ number }}" class="page-link">{{ number }}</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<li class="page-item {% if not page.has_next %}disabled{% endif %}">
|
||||
<a href="{% if page.has_next %}?q={{ query }}&page={{ page.next_page_number }}{% endif %}" class="page-link">»</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -1,2 +0,0 @@
|
||||
{{ object.subject }}
|
||||
{{ object.content.rendered }}
|
||||
@@ -1,120 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load highlight %}
|
||||
|
||||
{% block sub_title %}{% trans "Search" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
{% if not query %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{% trans "Search" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card post-edit">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">{% trans "Search forums" %}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="get" action="." class="form">
|
||||
{% include "partials/form_field.html" with field=form.q %}
|
||||
<div class="checkbox">
|
||||
<label for="{{ form.search_topics.auto_id }}">
|
||||
{{ form.search_topics }}
|
||||
{{ form.search_topics.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% include "partials/form_field.html" with field=form.search_poster_name %}
|
||||
{% include "partials/form_field.html" with field=form.search_forums %}
|
||||
<div class="form-actions">
|
||||
<input type="submit" class="btn btn-large btn-primary" value="{% trans "Search" %}" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>{% trans "Search" %}
|
||||
|
||||
<a href="{% url 'forum_search:search' %}" class="btn btn-sm btn-primary"><i class="fas fa-search"></i> {% trans "New search" %}</a></h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<div class="col-6 col-md-4 forum-actions-block">
|
||||
<p class="mt-1 mb-0 text-muted">
|
||||
{% blocktrans trimmed count number_of_results=page.paginator.count %}
|
||||
Your search has returned <b>{{ number_of_results }}</b> result
|
||||
{% plural %}
|
||||
Your search has returned <b>{{ number_of_results }}</b> results
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-12 col-md-8 pagination-block">
|
||||
{% if page.has_previous or page.has_next %}
|
||||
{% with pagination_size="pagination-sm justify-content-end" %}
|
||||
{% include "forum_search/pagination.html" %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card resultslist">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0 card-title h5">
|
||||
<i class="fas fa-search"></i> {% trans "Results" %}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="p-0 card-body">
|
||||
<table class="table">
|
||||
{% for result in page.object_list %}
|
||||
<tr>
|
||||
<td class="post-name">
|
||||
<a href="{% url 'forum_conversation:topic' result.forum_slug result.forum result.topic_slug result.topic %}" class="topic-name-link">{{ result.topic_subject }}</a>
|
||||
<div>
|
||||
<div class="post-created">
|
||||
{% if result.poster %}
|
||||
{% url 'forum_member:profile' result.poster as poster_url %}
|
||||
{% blocktrans trimmed with poster_url=poster_url username=result.poster_name creation_date=result.created %}
|
||||
By: <a href="{{ poster_url }}">{{ username }}</a> on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with poster_username=result.poster_name creation_date=result.created %}
|
||||
By: {{ poster_username }} on {{ creation_date }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="post-content">
|
||||
{% highlight result.text with request.GET.q max_lenght 800 %}
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td>
|
||||
{% trans "No results." %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if page.has_previous or page.has_next %}
|
||||
<div class="mt-3 row">
|
||||
<div class="col-md-12 pagination-block">
|
||||
{% with pagination_size="pagination-sm justify-content-end" %}
|
||||
{% include "forum_search/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
@@ -1,23 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Mark forums read" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-delete">
|
||||
<div class="card-header"><h3 class="m-0 card-title h5">{% trans "Mark forums read" %}</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Are you sure you want to mark forums read?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{{ top_level_forum_url }}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,23 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
{% load forum_conversation_tags %}
|
||||
|
||||
{% block sub_title %}{% trans "Mark topics read" %}{% endblock sub_title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card topic-delete">
|
||||
<div class="card-header"><h3 class="m-0 card-title h5">{% trans "Mark topics read" %}</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 warning-message">{% trans "Are you sure you want to mark topics read?" %}</div>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="post" value="yes" />
|
||||
<button role="submit" class="btn btn-warning">{% trans "Yes, I'm sure" %}</button>
|
||||
<a href="{{ forum_url }}" class="btn btn-secondary">{% trans "No, take me back" %}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -1,36 +0,0 @@
|
||||
{% extends 'board_base.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block sub_title %}{% trans "View unread topics" %}{% endblock sub_title %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="row"><div class="col-12"><h1>{% trans "View unread topics" %}</h1></div></div>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-4 topic-actions-block">
|
||||
{% if paginator.count > 0 %}
|
||||
<p class="text-muted">
|
||||
{% blocktrans trimmed count topic_length=paginator.count %}
|
||||
{{ topic_length }} unread topic found{% plural %}{{ topic_length }} unread topics found
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-12 col-md-8 pagination-block">
|
||||
{% with "pagination-sm justify-content-end" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% trans "There are no unread topics." as empty_message %}
|
||||
{% with topic_list_title="Topics" empty_message=empty_message force_all_unread=True %}
|
||||
{% include "forum_conversation/topic_list.html" %}
|
||||
{% endwith %}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-12 pagination-block">
|
||||
{% with "pagination-sm" as pagination_size %}
|
||||
{% include "partials/pagination.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user