hide buttons that modify stuff when CFP is not open or camp is readonly

This commit is contained in:
Thomas Steen Rasmussen 2018-05-27 16:27:41 +02:00
parent 183da3d161
commit 3d100c2f8a
2 changed files with 34 additions and 6 deletions

View file

@ -3,13 +3,21 @@
{% block program_content %}
{% if not camp.call_for_participation_open %}
<div class="alert alert-danger">
<strong>Note!</strong> This Call for Particilation is not open.
</div>
{% endif %}
<h2>{{ eventproposal.title }} Details</h2>
<div class="panel panel-default">
<div class="panel-heading">{{ eventproposal.title }}</div>
<div class="panel-body">
{{ eventproposal.abstract|commonmark }}
{% if camp.call_for_participation_open and not camp.read_only %}
<a href="{% url 'program:eventproposal_update' camp_slug=camp.slug pk=eventproposal.uuid %}" class="btn btn-primary btn-sm pull-right"><i class="fas fa-edit"></i><span class="h5"> Modify</span></a>
{% endif %}
</div>
<div class="panel-footer">Status: <span class="badge">{{ eventproposal.proposal_status }}</span> ID: <span class="badge">{{ eventproposal.uuid }}</span></div>
</div>
@ -22,7 +30,9 @@
{% else %}
<i>Nothing found.</i>
{% endif %}
{% if camp.call_for_participation_open and not camp.read_only %}
<a href="{% url 'program:eventproposalurl_create' camp_slug=camp.slug event_uuid=eventproposal.uuid %}" class="btn btn-success btn-sm pull-right"><i class="fas fa-plus"></i><span class="h5"> Add URL</span></a>
{% endif %}
</div>
</div>
@ -34,17 +44,21 @@
{% else %}
<i>Nothing found.</i>
{% endif %}
{% if eventproposal.get_available_speakerproposals.exists %}
<a href="{% url 'program:eventproposal_selectperson' camp_slug=camp.slug event_uuid=eventproposal.uuid %}" class="btn btn-success pull-right"><i class="fas fa-plus"></i><span class="h5"> Add {{ eventproposal.event_type.host_title }}</span></a>
{% else %}
<a href="{% url 'program:speakerproposal_create' camp_slug=camp.slug event_uuid=eventproposal.uuid %}" class="btn btn-success pull-right"><i class="fas fa-plus"></i><span class="h5"> Add {{ eventproposal.event_type.host_title }}</span></a>
{% if camp.call_for_participation_open and not camp.read_only %}
{% if eventproposal.get_available_speakerproposals.exists %}
<a href="{% url 'program:eventproposal_selectperson' camp_slug=camp.slug event_uuid=eventproposal.uuid %}" class="btn btn-success pull-right"><i class="fas fa-plus"></i><span class="h5"> Add {{ eventproposal.event_type.host_title }}</span></a>
{% else %}
<a href="{% url 'program:speakerproposal_create' camp_slug=camp.slug event_uuid=eventproposal.uuid %}" class="btn btn-success pull-right"><i class="fas fa-plus"></i><span class="h5"> Add {{ eventproposal.event_type.host_title }}</span></a>
{% endif %}
{% endif %}
</div>
</div>
<p>
<a href="{% url 'program:proposal_list' camp_slug=camp.slug %}" class="btn btn-primary">Back to List</a>
<a href="{% url 'program:eventproposal_delete' camp_slug=camp.slug pk=eventproposal.uuid %}" class="btn btn-danger pull-right"><i class="fas fa-times"></i><span class="h5"> Delete</span></a>
{% if camp.call_for_participation_open and not camp.read_only %}
<a href="{% url 'program:eventproposal_delete' camp_slug=camp.slug pk=eventproposal.uuid %}" class="btn btn-danger pull-right"><i class="fas fa-times"></i><span class="h5"> Delete</span></a>
{% endif %}
</p>
{% endblock program_content %}

View file

@ -3,13 +3,21 @@
{% block program_content %}
{% if not camp.call_for_participation_open %}
<div class="alert alert-danger">
<strong>Note!</strong> This Call for Particilation is not open.
</div>
{% endif %}
<h2>{{ speakerproposal.name }} Details</h2>
<div class="panel panel-default">
<div class="panel-heading">{{ speakerproposal.name }}</div>
<div class="panel-body">
{{ speakerproposal.biography|commonmark }}
{% if camp.call_for_participation_open and not camp.read_only %}
<a href="{% url 'program:speakerproposal_update' camp_slug=camp.slug pk=speakerproposal.uuid %}" class="btn btn-primary btn-sm pull-right"><i class="fas fa-edit"></i><span class="h5"> Modify</span></a>
{% endif %}
</div>
<div class="panel-footer">Status: <span class="badge">{{ speakerproposal.proposal_status }}</span> | ID: <span class="badge">{{ speakerproposal.uuid }}</span></div>
</div>
@ -22,7 +30,9 @@
{% else %}
<i>Nothing found.</i>
{% endif %}
{% if camp.call_for_participation_open and not camp.read_only %}
<a href="{% url 'program:speakerproposalurl_create' camp_slug=camp.slug speaker_uuid=speakerproposal.uuid %}" class="btn btn-success btn-sm pull-right"><i class="fas fa-plus"></i><span class="h5"> Add URL</span></a>
{% endif %}
</div>
</div>
@ -34,14 +44,18 @@
{% else %}
<i>Nothing found.</i>
{% endif %}
{% if camp.call_for_participation_open and not camp.read_only %}
<a href="{% url 'program:eventproposal_typeselect' camp_slug=camp.slug speaker_uuid=speakerproposal.uuid %}" class="btn btn-success btn-sm pull-right"><i class="fas fa-plus"></i><span class="h5"> Add New Event</span></a>
{% endif %}
</div>
</div>
<p>
<a href="{% url 'program:proposal_list' camp_slug=camp.slug %}" class="btn btn-primary">Back to List</a>
{% if not speakerproposal.eventproposals.all %}
{% if camp.call_for_participation_open and not camp.read_only %}
{% if not speakerproposal.eventproposals.all %}
<a href="{% url 'program:speakerproposal_delete' camp_slug=camp.slug pk=speakerproposal.uuid %}" class="btn btn-danger pull-right"><i class="fas fa-times"></i><span class="h5"> Delete Person</span></a>
{% endif %}
{% endif %}
</p>