Major changes to permission system
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
|
||||
{% block page %}
|
||||
<div class="hero">
|
||||
<h3 class="is-size-3">Sorry, you do not have permission to do that!</h3>
|
||||
<p>{{ exception }}</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
|
||||
{% block page %}
|
||||
<div class="hero">
|
||||
<h3 class="is-size-3">Sorry, that resource is not found.</h3>
|
||||
<p>{{ exception }}</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -8,7 +8,10 @@
|
||||
{% block page %}
|
||||
<h3 class="subtitle">{% firstof title view.title %}</h3>
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-form-group">
|
||||
<div class="column is-two-thirds">
|
||||
{% if instructions %}
|
||||
<p>{{ instructions }}</p>
|
||||
{% endif %}
|
||||
{% crispy form %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,49 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "interface/project_base.html" %}
|
||||
{% load md2 %}
|
||||
|
||||
{% block admin %}
|
||||
<a href="{% url 'project_create' object.slug %}" class="button is-link">
|
||||
<span class="icon"><i class="fas fa-plus-circle"></i></span>
|
||||
<span>Add project</span>
|
||||
</a>
|
||||
{% if inactive %}
|
||||
<a href="?" class="button is-link">
|
||||
<span class="icon"><i class="fas fa-archive"></i></span>
|
||||
<span>Hide old</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="?inactive" class="button is-link">
|
||||
<span class="icon"><i class="fas fa-archive"></i></span>
|
||||
<span>Show all</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
<h3 class="title">Projects for {{ensemble.name }}</h3>
|
||||
<p>{{ ensemble.details|markdown }}</p>
|
||||
|
||||
{% block content %}
|
||||
<h2>{{ ensemble.name }}</h2>
|
||||
<p>{{ ensemble.details }}</p>
|
||||
<h4>Administrators</h4>
|
||||
<ul>
|
||||
{% for admin in ensemble.admins.all %}
|
||||
<li><a href="mailto:{{ admin.email }}">{% firstof admin.get_full_name admin.get_username %}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% include 'interface/project_items.html' %}
|
||||
|
||||
<div class="">
|
||||
<div class="card">
|
||||
<header class="card header">
|
||||
<p class="card-header-title">Admin Details</p>
|
||||
</header>
|
||||
<div class="card-content">
|
||||
|
||||
<p>
|
||||
Joining instructions for participants<br/><br/>
|
||||
URL: <a href="{{ ensemble_link }}">{{ ensemble_link }}</a><br/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -2,40 +2,51 @@
|
||||
{% load md2 %}
|
||||
|
||||
{% block page %}
|
||||
{% comment %}
|
||||
<div class="admin-tools is-pulled-right">
|
||||
<a class="button is-link" href="{% url 'register' %}">
|
||||
<span class="icon"><i class="fas fa-plus-circle"></i></span>
|
||||
<span>Register another</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endcomment %}
|
||||
|
||||
<h3 class="title">My Ensembles</h3>
|
||||
|
||||
<div class="columns is-multiline">
|
||||
{% for ensemble in object_list %}
|
||||
<div class="column is-half">
|
||||
<div class="column is-half-tablet is-one-third-widescreen">
|
||||
<div class="card">
|
||||
<header class="card-header{% if ensemble.pk == ensemble_id %} has-background-link-light{% endif %}">
|
||||
<a class="card-header-title" href="{% url 'register' %}?code={{ ensemble.code }}">
|
||||
{{ ensemble.name }}
|
||||
</a>
|
||||
<a class="card-header-icon" href="{% url 'ensemble_forget' pk=ensemble.id %}">
|
||||
<span class="delete"></span>
|
||||
</a>
|
||||
</header>
|
||||
<div class="card-content">
|
||||
{% if ensemble.details %}
|
||||
<div class="content">
|
||||
{{ ensemble.details | markdown }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
{% with projects=ensemble.active_projects.count %}
|
||||
<p>{{ projects }} active project{{ projects|pluralize }}</p>
|
||||
{% endwith %}
|
||||
<div class="media">
|
||||
<div class="media-left">
|
||||
<figure class="image is-48x48">
|
||||
<img src="https://bulma.io/images/placeholders/96x96.png" alt="Placeholder image">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="media-content">
|
||||
<a href="{% url 'ensemble_detail' ensemble.slug %}">
|
||||
<p class="title is-4">{{ ensemble.name }}</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% if ensemble.details %}
|
||||
<div class="content">
|
||||
{{ ensemble.details | markdown }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{% with projects=ensemble.active_projects.count %}
|
||||
<a class="card-footer-item" href="{% url 'ensemble_detail' ensemble.slug %}">{{ projects }} active project{{ projects|pluralize }}</a>
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% empty %}
|
||||
<div class="hero">
|
||||
You don't currently have access to any ensembles - ask your administrator for a link.
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,73 +0,0 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
{% load md2 %}
|
||||
|
||||
{% block admin %}
|
||||
<a href="{% url 'project_create' %}" class="button is-link">
|
||||
<span class="icon"><i class="fas fa-plus-circle"></i></span>
|
||||
<span>Add new</span>
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block page %}
|
||||
<h3 class="title">Projects for {{ ensemble.name }}</h3>
|
||||
|
||||
<div class="columns is-multiline">
|
||||
{% for project in ensemble.active_projects %}
|
||||
<div class="column is-half">
|
||||
<div class="card">
|
||||
|
||||
<a class="" href="{% url 'project_detail' project=project.id %}">
|
||||
<header class="card-header">
|
||||
<p class="card-header-title">{{ project.name }}</p>
|
||||
<p class="card-header-icon" style="color: black;">{{ project.rough_date }}</p>
|
||||
</header>
|
||||
</a>
|
||||
<div class="card-content">
|
||||
<div class="content">
|
||||
{{ project.description | markdown }}
|
||||
</div>
|
||||
<p><small>
|
||||
{% if project.deadline %}In {{ project.deadline|timeuntil }}<br/>{% endif %}
|
||||
{% if project.works.count %}
|
||||
<a href="{% url 'item_list' project=project.pk %}">
|
||||
{{ project.works.count }} works
|
||||
</a>
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if project.submissions.count %}{{ project.submissions.count }} submissions<br/>{% endif %}
|
||||
</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="hero">
|
||||
<div class="hero-body">
|
||||
<p class="title">No projects currently planned</p>
|
||||
<p class="subtitle">Go put your feet up!</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if request.is_admin %}
|
||||
<div class="">
|
||||
<div class="card">
|
||||
<header class="card header">
|
||||
<p class="card-header-title">Admin Details</p>
|
||||
</header>
|
||||
<div class="card-content">
|
||||
|
||||
<p>
|
||||
Joining instructions for participants<br/><br/>
|
||||
URL: <a href="{{ ensemble_url }}">{{ ensemble_url }}</a><br/>
|
||||
Code: {{ ensemble.ensemble_code }}<br/>
|
||||
Passphrase: {{ ensemble.passphrase }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -12,7 +12,7 @@
|
||||
<p class="menu-label">My Things</p>
|
||||
<ul class="menu-list">
|
||||
<li><a href="{% url 'ensemble_list' %}">Ensembles</a></li>
|
||||
<li><a href="{% url 'ensemble_detail' %}">Projects</a></li>
|
||||
<li><a href="{% url 'project_list' %}">Projects</a></li>
|
||||
<li><a href="{% url 'work_list' %}">Library</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -76,10 +76,10 @@
|
||||
{% if project.resources.count %}
|
||||
<li><a href="{% url 'resource_list' project=project.pk %}">Resources</a></li>
|
||||
{% endif %}
|
||||
{% if project.enable_library %}
|
||||
{% if 'library' in modules %}
|
||||
<li><a href="{% url 'item_list' project=project.pk %}">My Music</a></li>
|
||||
{% endif %}
|
||||
{% if project.enable_submissions %}
|
||||
{% if 'submission' in modules %}
|
||||
<li><a href="{% url 'submission_create' project=project.pk %}">Send File</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
@@ -97,14 +97,8 @@
|
||||
{% block page %}
|
||||
No content
|
||||
{% endblock %}
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if ensemble %}
|
||||
<div class="project-footer">
|
||||
{{ ensemble.name }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -58,5 +58,11 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if request.is_admin %}
|
||||
<div class="block">
|
||||
<a href="{{ project_link }}">Project Link</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block media %}
|
||||
{{ form.media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
<h3 class="subtitle">{% firstof title view.title %}</h3>
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-form-group">
|
||||
{% if instructions %}
|
||||
<p>{{ instructions }}</p>
|
||||
{% endif %}
|
||||
{% crispy form %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,21 +1,18 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block media %}
|
||||
{{ form.media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
<style>
|
||||
TEXTAREA {
|
||||
height: 200px;
|
||||
}
|
||||
FORM.vertical {
|
||||
max-width: 90%;
|
||||
}
|
||||
</style>
|
||||
<div>
|
||||
<h3>{{ title }}</h3>
|
||||
<p>{{ instructions }}</p>
|
||||
<form class="vertical" method="POST">
|
||||
{% csrf_token %}
|
||||
{{ form | crispy }}
|
||||
</form>
|
||||
<h3 class="subtitle">{% firstof title view.title %}</h3>
|
||||
<div class="columns is-centered">
|
||||
<div class="column">
|
||||
{% if instructions %}
|
||||
<p>{{ instructions }}</p>
|
||||
{% endif %}
|
||||
{% crispy form %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -7,7 +7,6 @@
|
||||
<div class="box is-half">
|
||||
<p class="block">
|
||||
Login is only required to administer a project.<br/>
|
||||
If you have an ensemble code <a href="{% url 'register' %}">enter it here</a> instead.
|
||||
</p>
|
||||
<form method="POST" class="vertical">
|
||||
{% csrf_token %}
|
||||
@@ -15,7 +14,7 @@
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<button class="button is-link">Login</button>
|
||||
<a href="{% url 'ensemble_detail' %}" class="button is-light">Cancel</a>
|
||||
<a href="{% url 'home' %}" class="button is-light">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user