Cloned DMOJ
This commit is contained in:
parent
f623974b58
commit
49dc9ff10c
513 changed files with 132349 additions and 39 deletions
35
templates/organization/requests/detail.html
Normal file
35
templates/organization/requests/detail.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
{% extends "base.html" %}
|
||||
{% block media %}
|
||||
<style>
|
||||
th {
|
||||
text-align: left
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{{ _('User:') }}</th>
|
||||
<td>{{ link_user(object.user) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ _('Organization:') }}</th>
|
||||
<td>
|
||||
{% with org=object.organization %}
|
||||
<a href="{{ org.get_absolute_url() }}">{{ org.name }}</a>
|
||||
{% endwith %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{ _('Time:') }}</th>
|
||||
<td>{{ object.time|date(_("N j, Y, g:i a")) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">{{ _('Reason:') }}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-left: 2em">{{ object.reason }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
30
templates/organization/requests/log.html
Normal file
30
templates/organization/requests/log.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
{% include "organization/requests/tabs.html" %}
|
||||
|
||||
{% if requests %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{{ _('User') }}</th>
|
||||
<th>{{ _('Time') }}</th>
|
||||
<th>{{ _('State') }}</th>
|
||||
<th>{{ _('Reason') }}</th>
|
||||
</tr>
|
||||
{% for r in requests %}
|
||||
<tr id="request-{{ r.id }}">
|
||||
<td>{{ link_user(r.user) }}</td>
|
||||
<td>
|
||||
<a href="{{ url('request_organization_detail', object.id, object.slug, r.id) }}">
|
||||
{{- r.time|date(_("N j, Y, H:i")) -}}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ r.state }}</td>
|
||||
<td>{{ r.reason|truncatechars(50) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<p>{{ _('There are no requests to approve.') }}</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
39
templates/organization/requests/pending.html
Normal file
39
templates/organization/requests/pending.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
{% include "messages.html" %}
|
||||
{% include "organization/requests/tabs.html" %}
|
||||
|
||||
{% if formset.forms %}
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ formset.management_form }}
|
||||
<table>
|
||||
<tr>
|
||||
<th>{{ _('User') }}</th>
|
||||
<th>{{ _('Time') }}</th>
|
||||
<th>{{ _('State') }}</th>
|
||||
<th>{{ _('Reason') }}</th>
|
||||
{% if formset.can_delete %}
|
||||
<th>{{ _('Delete?') }}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for form in formset %}
|
||||
<tr id="request-{{ form.instance.id }}">
|
||||
<td>{{ form.id }}{{ link_user(form.instance.user) }}</td>
|
||||
<td><a href="{{ url('request_organization_detail', object.id, object.slug, form.instance.id) }}">
|
||||
{{ form.instance.time|date(_("N j, Y, H:i")) }}
|
||||
</a></td>
|
||||
<td>{{ form.state }}</td>
|
||||
<td>{{ form.instance.reason|truncatechars(50) }}</td>
|
||||
{% if formset.can_delete %}
|
||||
<td>{{ form.DELETE }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<button type="submit">{{ _('Update') }}</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>{{ _('There are no requests to approve.') }}</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
22
templates/organization/requests/request.html
Normal file
22
templates/organization/requests/request.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block js_media %}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#id_reason').keydown(function (e) {
|
||||
if (e.ctrlKey && (e.keyCode === 13 || e.keyCode === 10)) {
|
||||
$(this).closest('form').submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
<p><label for="{{ form.reason.id_for_label }}"><b>{{ _('Your reason for joining:') }}</b></label></p>
|
||||
<p>{{ form.reason }}</p>
|
||||
<button type="submit">{{ _('Request') }}</button>
|
||||
</form>
|
||||
{% endblock %}
|
16
templates/organization/requests/tabs.html
Normal file
16
templates/organization/requests/tabs.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<div class="tabs">
|
||||
<ul>
|
||||
<li{% if tab == 'pending' %} class="active"{% endif %}>
|
||||
<a href="{{ url('organization_requests_pending', object.id, object.slug) }}">{{ _('Pending') }}</a>
|
||||
</li>
|
||||
<li{% if tab == 'log' %} class="active"{% endif %}>
|
||||
<a href="{{ url('organization_requests_log', object.id, object.slug) }}">{{ _('Log') }}</a>
|
||||
</li>
|
||||
<li{% if tab == 'approved' %} class="active"{% endif %}>
|
||||
<a href="{{ url('organization_requests_approved', object.id, object.slug) }}">{{ _('Approved') }}</a>
|
||||
</li>
|
||||
<li{% if tab == 'rejected' %} class="active"{% endif %}>
|
||||
<a href="{{ url('organization_requests_rejected', object.id, object.slug) }}">{{ _('Rejected') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue