Add post modify view

This allows moderators to modify posts (add sticky, etc).

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-30 16:21:36 -07:00
parent 2947ab6cf2
commit 6f99472f16
13 changed files with 124 additions and 22 deletions

View File

@@ -2,10 +2,6 @@
{% load i18n static %}
{# Title #}
{% block title %}{% translate "Ban success" %}{% endblock %}
{# Extra JS #}
{% block extrajs %}
<script src="{% static 'board/ban_window.js' %}"></script>
{% endblock extrajs %}
{# Body #}
{% block content %}
<div class="row" id="message">

View File

@@ -7,13 +7,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{% block title %}{% if title %}{{title}}{% else %}Index{% endif %}{% endblock %}</title>
<link rel="stylesheet" href="{% static 'board/style.css' %}">
<link rel="stylesheet" href="{% static 'board/font-awesome/css/font-awesome.min.css' %}">
{% block extrastyle %}{% endblock %}
<script src="{% static 'board/jquery.js' %}"></script>
<script src="{% static 'board/jsframe.min.js' %}"></script>
<script src="{% static 'board/post.js' %}"></script>
{% if perms.board.create_ban %}
<script src="{% static 'board/ban_window.js' %}"></script>
<script src="{% static 'board/ban_menu.js' %}"></script>
{% endif %}
{% block extrajs %}{% endblock %}
</head>

View File

@@ -0,0 +1,17 @@
{% extends "board/base.html" %}
{% load i18n %}
{% block content %}
<form method="post" action="{% url 'board:post_modify' post.id %}">
{% csrf_token %}
<table>
{% if perms.board.can_sticky %}
<tr>
<th>{{form.sticky.label_tag}}</th>
<td>{{form.sticky}}</td>
</tr>
{% endif %}
<tr><td>&nbsp;</td><td><input type="submit" value="Modify post" /></td></tr>
</table>
</form>
{% endblock content %}

View File

@@ -6,6 +6,9 @@
{% if perms.board.create_ban %}
data-ban-url="{% url 'board:ban_create' board.url post.id %}"
{% endif %}
{% if perms.board.can_sticky %}
data-modify-url="{% url 'board:post_modify' post.id %}"
{% endif %}
>
{# Image #}
{% if post.thumbnail %}
@@ -24,7 +27,10 @@
</div>
{% endif %}
{# Post ID, username, time #}
{# Post ID, sticky, username, time #}
{% if post.sticky and not post.op %}
<span title="Stickied" class="fa fa-sticky-note"></span>
{% endif %}
<a href="#p{{post.id}}">#.</a>
<span class="post_id">{{post.id}}</span>
{% if post.subject %}