56 lines
1.6 KiB
HTML
56 lines
1.6 KiB
HTML
{% extends "chrono/manager_agenda_view.html" %}
|
|
{% load i18n gadjo %}
|
|
|
|
{% block extrascripts %}
|
|
{{ block.super }}
|
|
{{ form.media }}
|
|
{% endblock %}
|
|
|
|
{% block breadcrumb %}
|
|
{{ block.super }}
|
|
{% if object.id %}
|
|
<a href="{% url 'chrono-manager-agenda-view' pk=object.agenda.id %}">{{object.agenda.label}}</a>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block appbar %}
|
|
{% if object.id %}
|
|
<h2>{% trans "Edit Event" %}</h2>
|
|
<span class="actions">
|
|
{% if not object.primary_event %}
|
|
<a rel="popup" href="{% url 'chrono-manager-event-delete' pk=object.agenda.id event_pk=object.id %}?next={{view.request.GET.next}}">{% trans 'Delete' %}</a>
|
|
{% endif %}
|
|
</span>
|
|
{% else %}
|
|
<h2>{% trans "New Event" %}</h2>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<form method="post" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="next" value="{% firstof request.POST.next request.GET.next %}">
|
|
{{ form|with_template }}
|
|
<div class="buttons">
|
|
<button class="submit-button">{% trans "Save" %}</button>
|
|
<a class="cancel" href="{{ view.get_success_url }}">{% trans 'Cancel' %}</a>
|
|
</div>
|
|
|
|
<script>
|
|
$(function () {
|
|
recurrence_fields = $('.widget[id^=id_recurrence]');
|
|
$('input[type=radio][name=frequency]').change(function() {
|
|
if(!this.checked)
|
|
return;
|
|
if(this.value == 'unique') {
|
|
recurrence_fields.hide();
|
|
} else {
|
|
recurrence_fields.show();
|
|
}
|
|
}).change();
|
|
});
|
|
</script>
|
|
</form>
|
|
{% endblock %}
|