edit schedule templates
This commit is contained in:
parent
bea34fa689
commit
09bce70aed
2 changed files with 40 additions and 1 deletions
|
@ -11,7 +11,16 @@
|
|||
{% for slot in row.slots %}
|
||||
<td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slow.rowspan }}">
|
||||
{% if slot.kind.label == "talk" %}
|
||||
<span class="schedule-controls"><b>add</b>: <a href="{# url schedule_slot_add slot.pk "talk" #}" rel="facebox">talk</a></span>
|
||||
{% if not slot.presentation %}
|
||||
<a class="btn btn-mini edit-slot" data-action="{% url schedule_slot_edit slot.pk %}" href="#">+</a>
|
||||
{% else %}
|
||||
<div class="title">{{ slot.presentation.title }}</div>
|
||||
<div class="speaker">{{ slot.presentation.speaker }}</div>
|
||||
|
||||
<span class="schedule-controls">
|
||||
<a class="btn btn-mini" onClick="modalEdit({% url schedule_slot_edit slot.pk %})" href="#">Edit</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ slot.kind.label }}
|
||||
{% endif %}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{% extends "site_base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load bootstrap_tags %}
|
||||
|
||||
{% block head_title %}Conference Schedule Edit{% endblock %}
|
||||
|
||||
{% block body_class %}full{% endblock %}
|
||||
|
@ -77,5 +80,32 @@
|
|||
{% include "schedule/_grid.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="modal fade hide" id="slotEditModal">
|
||||
<form id="slotEditForm" class="modal-form" method="POST">
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h3>{% trans "Edit Slot" %}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{% csrf_token %}
|
||||
{{ form|as_bootstrap }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_script %}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("a.edit-slot").click(function() {
|
||||
$("#slotEditForm").get(0).setAttribute("action", $(this).data("action"));
|
||||
$("#slotEditModal").modal("show");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue