Add home and rules pages
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
33
board/templates/board/home.html
Normal file
33
board/templates/board/home.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% extends "board/base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Home {{block.super}}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="column"> </div>
|
||||
<div class="column"><h2>Welcome to interchan!</h2></div>
|
||||
<div class="column"> </div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="column"> </div>
|
||||
<div class="column">
|
||||
<div class="row">
|
||||
<p>interchan is an experimental image board using a homebrew *chan implementation.</p>
|
||||
<p>Before you post anything, please familiarize yourself with the <a href="{% url 'board:rules_list' %}">rules</a>.</p>
|
||||
</div>
|
||||
<div class="row"><h2>Boards</h2></div>
|
||||
{% for board in boards %}
|
||||
<div class="row">
|
||||
<a href="{% url 'board:board_detail' url=board.url %}">/{{board.url}}/ - {{board.name}}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="row"><h2>Other links</h2></div>
|
||||
<div class="row"><a href="{% url 'board:news_list' %}">News</a></div>
|
||||
<div class="row"><a href="{% url 'board:rules_list' %}">Rules</a></div>
|
||||
</div>
|
||||
<div class="column"> </div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
27
board/templates/board/rules.html
Normal file
27
board/templates/board/rules.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{% extends "board/base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="column"> </div>
|
||||
<div class="column"><h2>Rules</h2></div>
|
||||
<div class="column"> </div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="column"> </div>
|
||||
<div class="column">
|
||||
<div class="row"><h2>Boards</h2></div>
|
||||
{% for board in boards %}
|
||||
<div class="row">
|
||||
<a href="{% url 'board:board_detail' url=board.url %}">/{{board.url}}/ - {{board.name}}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="row"><h2>Other links</h2></div>
|
||||
<div class="row"><a href="{% url 'board:news_list' %}">News</a></div>
|
||||
<div class="row"><a href="{% url 'board:rules_list' %}">News</a></div>
|
||||
</div>
|
||||
<div class="column"> </div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
@@ -2,13 +2,23 @@ from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.urls import path
|
||||
from django.utils.translation import gettext as _
|
||||
from django.views.generic.base import TemplateView
|
||||
|
||||
from board.views import *
|
||||
|
||||
|
||||
app_name = "board"
|
||||
urlpatterns = [
|
||||
# Index
|
||||
path("", HomeView.as_view(), name="home"),
|
||||
# News views
|
||||
path("news/", NewsListView.as_view(), name="board_news"),
|
||||
path("news/", NewsListView.as_view(), name="news_list"),
|
||||
# Rules views
|
||||
path(
|
||||
"rules/",
|
||||
TemplateView.as_view(template_name="board/rules.html"),
|
||||
name="rules_list",
|
||||
),
|
||||
# Reports
|
||||
path("report/<slug:url>/<int:id>/", ReportView.as_view(), name="report_form"),
|
||||
path(
|
||||
|
||||
@@ -24,6 +24,7 @@ __all__ = (
|
||||
"BanSuccessView",
|
||||
"BannedView",
|
||||
"BoardView",
|
||||
"HomeView",
|
||||
"NewsListView",
|
||||
"PostCreateView",
|
||||
"PostModifyView",
|
||||
@@ -48,6 +49,15 @@ def can_modify(user):
|
||||
)
|
||||
|
||||
|
||||
class HomeView(TemplateView):
|
||||
template_name = "board/home.html"
|
||||
|
||||
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["boards"] = Board.objects.filter(readonly=False)
|
||||
return context
|
||||
|
||||
|
||||
class ActionSuccessView(TemplateView):
|
||||
template_name = "board/action_success.html"
|
||||
message = "Action completed."
|
||||
|
||||
Reference in New Issue
Block a user