Add a proposal edit permission.

This commit is contained in:
Víðir Valberg Guðmundsson 2018-08-18 16:35:21 +02:00
parent 313ac788a4
commit f15f878508
4 changed files with 34 additions and 5 deletions

View file

@ -29,15 +29,18 @@
</a> </a>
{% endif %} {% endif %}
{% if perms.program.can_approve_proposals %}
<a href="{% url 'backoffice:manage_proposals' camp_slug=camp.slug %}" class="list-group-item">
<h4 class="list-group-item-heading">Manage Proposals</h4>
<p class="list-group-item-text">Use this view to manage SpeakerProposals and EventProposals</p>
</a>
{% endif %}
{% if user.is_superuser %} {% if user.is_superuser %}
<a href="{% url 'backoffice:public_credit_names' camp_slug=camp.slug %}" class="list-group-item"> <a href="{% url 'backoffice:public_credit_names' camp_slug=camp.slug %}" class="list-group-item">
<h4 class="list-group-item-heading">Approve Public Credit Names</h4> <h4 class="list-group-item-heading">Approve Public Credit Names</h4>
<p class="list-group-item-text">Use this view to check and approve users Public Credit Names</p> <p class="list-group-item-text">Use this view to check and approve users Public Credit Names</p>
</a> </a>
<a href="{% url 'backoffice:manage_proposals' camp_slug=camp.slug %}" class="list-group-item">
<h4 class="list-group-item-heading">Manage Proposals</h4>
<p class="list-group-item-text">Use this view to manage SpeakerProposals and EventProposals</p>
</a>
<a href="{% url 'backoffice:merchandise_orders' camp_slug=camp.slug %}" class="list-group-item"> <a href="{% url 'backoffice:merchandise_orders' camp_slug=camp.slug %}" class="list-group-item">
<h4 class="list-group-item-heading">Merchandise Orders</h4> <h4 class="list-group-item-heading">Merchandise Orders</h4>
<p class="list-group-item-text">Use this view to look at Merchandise Orders</p> <p class="list-group-item-text">Use this view to look at Merchandise Orders</p>

View file

@ -23,6 +23,10 @@ class InfodeskMixin(CampViewMixin, PermissionRequiredMixin):
permission_required = ("camps.infodesk_permission") permission_required = ("camps.infodesk_permission")
class ContentTeamMixin(CampViewMixin, PermissionRequiredMixin):
permission_required = ("program.can_approve_proposals")
class BackofficeIndexView(InfodeskMixin, TemplateView): class BackofficeIndexView(InfodeskMixin, TemplateView):
template_name = "index.html" template_name = "index.html"
@ -78,7 +82,7 @@ class ApproveNamesView(BackofficeViewMixin, ListView):
return Profile.objects.filter(public_credit_name_approved=False).exclude(public_credit_name='') return Profile.objects.filter(public_credit_name_approved=False).exclude(public_credit_name='')
class ManageProposalsView(BackofficeViewMixin, ListView): class ManageProposalsView(ContentTeamMixin, ListView):
""" """
This view shows a list of pending SpeakerProposal and EventProposals. This view shows a list of pending SpeakerProposal and EventProposals.
""" """

View file

@ -0,0 +1,17 @@
# Generated by Django 2.1 on 2018-08-18 14:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('program', '0066_speaker_email'),
]
operations = [
migrations.AlterModelOptions(
name='eventproposal',
options={'permissions': (('can_approve_proposals', 'Can approve proposals'),)},
),
]

View file

@ -311,6 +311,11 @@ class SpeakerProposal(UserSubmittedModel):
class EventProposal(UserSubmittedModel): class EventProposal(UserSubmittedModel):
""" An event proposal """ """ An event proposal """
class Meta:
permissions = (
("can_approve_proposals", "Can approve proposals"),
)
track = models.ForeignKey( track = models.ForeignKey(
'program.EventTrack', 'program.EventTrack',
related_name='eventproposals', related_name='eventproposals',