Add unapproved/removed docs to Mod Dashboard

This commit is contained in:
Keegan 2020-03-23 05:20:30 -04:00
parent 50d88f2c04
commit f79d19f5ef
3 changed files with 36 additions and 3 deletions

View File

@ -3,8 +3,7 @@
<h1 class="text-4xl font-bold">Study Bank</h1> <h1 class="text-4xl font-bold">Study Bank</h1>
<h3> Welcome, {{ user }}</h3> <h3> Welcome, {{ user }}</h3>
{% if is_mod %} {% if is_mod %}
<a href='{% url 'mod:dash' %}'>Moderator Dashboard</a> <p><a href='{% url 'mod:dash' %}'>Moderator Dashboard</a></p>
{% endif %} {% endif %}
<p><a href='{% url 'course:index' %}'>View Courses</a></p>
<a href='{% url 'course:index' %}'>View Courses</a>
{% endblock %} {% endblock %}

View File

@ -1,4 +1,19 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block head %}
<style>
.unapproved {
border: 5px;
border-color: blue;
border-style: solid;
}
.removed {
border: 5px;
border-color: red;
border-style: solid;
}
</style>
{% endblock %}
{% block body %} {% block body %}
<div class="header"> <div class="header">
<h1>Classes Moderated by {{ user }}</h1> <h1>Classes Moderated by {{ user }}</h1>
@ -9,6 +24,25 @@
<div> <div>
<a href="{% url 'courses:show' class.url %}">{{class.name}}</a> <a href="{% url 'courses:show' class.url %}">{{class.name}}</a>
<p>{{ class.files.all|length }} Document</p> <p>{{ class.files.all|length }} Document</p>
{% for doc in class.unapproved_files.all %}
<div class='unapproved'>
<h3>UNAPPROVED</h3>
<h3>{{ doc.name }}</h3>
<a href="{{ doc.payload.url }}">Download</a>
<p>Uploaded By {{ doc.uploader }}</p>
<a href="{% url 'courses:approve' course_url=class.url doc_id=doc.id %}">APPROVE</a>
<a href="{% url 'courses:remove' course_url=class.url doc_id=doc.id %}">REMOVE</a>
</div>
{% endfor %}
{% for doc in class.rejected_files.all %}
<div class='removed'>
<h3>UNAPPROVED</h3>
<h3>{{ doc.name }}</h3>
<a href="{{ doc.payload.url }}">Download</a>
<p>Uploaded By {{ doc.uploader }}</p>
<a href="{% url 'courses:undelete' course_url=class.url doc_id=doc.id %}">UNDELETE</a>
</div>
{% endfor %}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>