This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
Episodes.Community/Discussions/templates/boards.html

77 lines
2.3 KiB
HTML

{% extends "base.html" %}
{% block title %}
{{show.name}} Discussions - Episodes.Community
{% endblock %}
{% block content %}
<div class="container mb-5 mt-5">
<h1>{{show.name}} Discussion Boards</h1>
<div class="d-flex flex-row-reverse mb-4">
{% if user.is_authenticated %}
<a href="/show/{{show.abbr}}/discuss/board/new" class="btn btn-primary"><i class="fa fa-fw fa-pencil"></i>&nbsp;Create New Board</a>
{% else %}
<a href="/login">Log in</a> to create boards
{% endif %}
</div>
<div class="bg-light rounded p-2 row">
<div class="col">Board Name</div>
<div class="col-2">Latest Reply</div>
</div>
{% for board in boards %}
<div class="board border-bottom">
<div class="row">
<div class="col">
<h2><a href="/show/{{show.abbr}}/discuss/board/{{board.pk}}-{{board.title|slugify}}">{{board.title}}</a></h2>
<span class="text-muted font-weight-light">Submitted {{board.timestamp}} by
{% if board.user.is_staff %}
<span class="mod"><i class="fa fa-fw fa-shield"></i></span>
{% endif %}
<span class="display_name">{{board.user.display_name}}</span>
</span>
</div>
<div class="col-2">
<span class="text-muted font-weight-light">No replies</span>
</div>
</div>
</div>
{% empty %}
<h3>Nobody has started any discussions for this show!</h3>
{% endfor %}
{% if boards.has_other_pages %}
<nav aria-label="Boards navigation">
<ul class="pagination">
{% if boards.has_previous %}
<li class="page-item">
<a href="?page={{ boards.previous_page_number }}" class="page-link">Previous</a>
</li>
{% else %}
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1">Previous</a>
</li>
{% endif %}
{% for i in boards.paginator.page_range %}
{% if boards.number == i %}
<li class="page-item active">
<span class="page-link">{{ i }} <span class="sr-only">(current)</span></span>
</li>
{% else %}
<li class="page-item">
<span class="page-link" href="?page={{ i }}">{{ i }}</span>
</li>
{% endif %}
{% endfor %}
{% if users.has_next %}
<li class="page-item">
<a href="?page={{ boards.next_page_number }}" class="page-link">Next</a>
</li>
{% else %}
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1">Next</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
</div>
{% endblock %}