forked from DGNum/gestioCOF
Merge branch 'Elarnon/templates'
This commit is contained in:
commit
d16022164b
71 changed files with 0 additions and 0 deletions
27
bda/templates/bda-attrib-extra.html
Normal file
27
bda/templates/bda-attrib-extra.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
{% extends "bda-attrib.html" %}
|
||||
|
||||
{% block extracontent %}
|
||||
|
||||
<h1>Attribution (détails)</h1>
|
||||
<h2>Token : {{ token }}</h2>
|
||||
<h2>Placés : {{ total_slots }} ; Déçus : {{ total_losers }}</h2>
|
||||
|
||||
<table>
|
||||
{% for member, shows in members2 %}
|
||||
<tr>
|
||||
<td>{{ member.user.get_full_name }}</td>
|
||||
<td>{{ member.user.email }}</td>
|
||||
<td>Total: {{ member.total }}€</td>
|
||||
<td style="width: 120px;"></td>
|
||||
</tr>
|
||||
{% for show in shows %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>{{ show }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
42
bda/templates/bda-attrib.html
Normal file
42
bda/templates/bda-attrib.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
{% extends "base_title.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link type="text/css" rel="stylesheet" href="{% static "css/bda.css" %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block realcontent %}
|
||||
|
||||
<h1>Attribution</h1>
|
||||
<h2>Token : {{ token }}</h2>
|
||||
<h2>Placés : {{ total_slots }} ; Déçus : {{ total_losers }}</h2>
|
||||
{% if user.profile.is_buro %}<h2>Déficit total: {{ total_deficit }} €, Opéra: {{ opera_deficit }} €, Attribué: {{ total_sold }} €</h2>{% endif %}
|
||||
<h2>Temps de calcul : {{ duration|floatformat }}s</h2>
|
||||
|
||||
{% for show, members, losers in results %}
|
||||
<div class="attribresult">
|
||||
<h2>{{ show.title }} - {{ show.date_no_seconds }} @ {{ show.location }}</h2>
|
||||
<p>
|
||||
<strong>{{ show.nrequests }} demandes pour {{ show.slots }} places</strong>
|
||||
{{ show.price }}€ par place{% if user.profile.is_buro and show.nrequests < show.slots %}, {{ show.deficit }}€ de déficit{% endif %}
|
||||
</p>
|
||||
Places :
|
||||
<ul>
|
||||
{% for member, rank, origrank, double in members %}
|
||||
<li>{{ member.user.get_full_name }} <span class="details">(souhait {{ origrank }} — rang {{ rank }})</span></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
Déçus :
|
||||
{% if not losers %}/{% else %}
|
||||
<ul class="losers">
|
||||
{% for member, rank, origrank, double in losers %}
|
||||
{% if not forloop.first %} ; {% endif %}
|
||||
<li>{{ member.user.get_full_name }} <span class="details">(souhait {{ origrank }} — rang {{ rank }})</span></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% block extracontent %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
7
bda/templates/bda-emails.html
Normal file
7
bda/templates/bda-emails.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h2>{{ spectacle }}</h2>
|
||||
<textarea style="width: 100%; height: 100px; margin-top: 10px;">
|
||||
{% for attrib in spectacle.attribues.all %}{{ attrib.participant.user.email }}, {% endfor %}</textarea>
|
||||
{% endblock %}
|
6
bda/templates/bda-notpaid.html
Normal file
6
bda/templates/bda-notpaid.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h1><strong>Nope</strong></h1>
|
||||
<p>Avant de revendre des places, il faut aller les payer !</p>
|
||||
{% endblock %}
|
26
bda/templates/bda-revente.html
Normal file
26
bda/templates/bda-revente.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
{% extends "base_title.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link type="text/css" rel="stylesheet" href="{% static "css/bda.css" %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block realcontent %}
|
||||
|
||||
<h1>Revente de place</h1>
|
||||
<form action="" method="post" id="resellform">
|
||||
{% csrf_token %}
|
||||
{% if form.spectacle.errors %}<ul class="errorlist"><li>Sélectionnez un spetacle</li></ul>{% endif %}
|
||||
<p>
|
||||
<code>
|
||||
Bonjour,<br />
|
||||
<br />
|
||||
Je souhaite revendre {{ form.count }} place(s) pour {{ form.spectacle }}.<br />
|
||||
Contactez-moi par email si vous êtes intéressé !<br />
|
||||
<br />
|
||||
{{ user.get_full_name }} ({{ user.email }})
|
||||
</code>
|
||||
</p>
|
||||
<input type="submit" value="Envoyer" />
|
||||
</form>
|
||||
{% endblock %}
|
12
bda/templates/bda-success.html
Normal file
12
bda/templates/bda-success.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% extends "base_title.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link type="text/css" rel="stylesheet" href="{% static "css/bda.css" %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block realcontent %}
|
||||
|
||||
<h1>Revente de place</h1>
|
||||
<p class="success">Votre offre de revente de {{ places }} pour {{ show.title }} le {{ show.date_no_seconds }} ({{ show.location }}) à {{ show.price }}€ a bien été envoyée.</p>
|
||||
{% endblock %}
|
13
bda/templates/bda-token.html
Normal file
13
bda/templates/bda-token.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h2>Tirage au sort du BdA</h2>
|
||||
<form action="" method="post" id="tokenform">
|
||||
{% csrf_token %}
|
||||
<strong>La graine :</strong>
|
||||
<div>
|
||||
{{ form.token }}
|
||||
</div>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
{% endblock %}
|
7
bda/templates/bda-unpaid.html
Normal file
7
bda/templates/bda-unpaid.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h2>Impayés</h2>
|
||||
<textarea style="width: 100%; height: 100px; margin-top: 10px;">
|
||||
{% for participant in unpaid %}{{ participant.user.email }}, {% endfor %}</textarea>
|
||||
{% endblock %}
|
49
bda/templates/etat-places.html
Normal file
49
bda/templates/etat-places.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h2>État des inscriptions BdA</h2>
|
||||
<table class="etat-bda">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sort="string">Titre</th>
|
||||
<th data-sort="int">Date</th>
|
||||
<th data-sort="string">Lieu</th>
|
||||
<th data-sort="int">Places</th>
|
||||
<th data-sort="int">Demandes</th>
|
||||
<th data-sort="float">Ratio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for spectacle in spectacles %}
|
||||
<tr>
|
||||
<td>{{ spectacle.title }}</td>
|
||||
<td data-sort-value="{{ spectacle.timestamp }}">{{ spectacle.date_no_seconds }}</td>
|
||||
<td data-sort-value="{{ spectacle.location }}">{{ spectacle.location }}</td>
|
||||
<td data-sort-value="{{ spectacle.slots }}">{{ spectacle.slots }} places</td>
|
||||
<td data-sort-value="{{ spectacle.total }}">{{ spectacle.total }} demandes</td>
|
||||
<td data-sort-value="{{ spectacle.ratio |stringformat:".3f" }}">
|
||||
<div class={% if spectacle.ratio < 1.0 %}
|
||||
"greenratio"
|
||||
{% else %}
|
||||
{% if spectacle.ratio < 2.5 %}
|
||||
"orangeratio"
|
||||
{% else %}
|
||||
"redratio"
|
||||
{% endif %}
|
||||
{% endif %}>
|
||||
{{ spectacle.ratio |floatformat }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<strong>Total : <u>{{ total }} demandes</u></strong>
|
||||
<script type="text/javascript" src="/gestion/media/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/gestion/media/js/joequery-Stupid-Table-Plugin/stupidtable.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("table.etat-bda").stupidtable();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
118
bda/templates/inscription-bda.html
Normal file
118
bda/templates/inscription-bda.html
Normal file
|
@ -0,0 +1,118 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link href="{{ STATIC_URL }}grappelli/jquery/ui/css/custom-theme/jquery-ui-1.8.custom.css" rel="stylesheet" type="text/css" media="screen" title="no title" charset="utf-8" />
|
||||
<script src="{{ STATIC_URL }}grappelli/jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
|
||||
<script src="{{ STATIC_URL }}grappelli/jquery/ui/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
|
||||
<link href="{{ STATIC_URL }}grappelli/css/tools.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ STATIC_URL }}grappelli/css/jquery-ui-grappelli-extensions.css" rel="stylesheet" type="text/css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block realcontent %}
|
||||
<script type="text/javascript">
|
||||
var django = {
|
||||
"jQuery": jQuery.noConflict(true)
|
||||
};
|
||||
|
||||
(function($) {
|
||||
cloneMore = function(selector, type) {
|
||||
var newElement = $(selector).clone(true);
|
||||
var total = $('#id_' + type + '-TOTAL_FORMS').val();
|
||||
newElement.find(':input').each(function() {
|
||||
var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-');
|
||||
var id = 'id_' + name;
|
||||
$(this).attr({'name': name, 'id': id}).val('').removeAttr('checked');
|
||||
});
|
||||
newElement.find('label').each(function() {
|
||||
var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-');
|
||||
$(this).attr('for', newFor);
|
||||
});
|
||||
total++;
|
||||
$('#id_' + type + '-TOTAL_FORMS').val(total);
|
||||
$(selector).after(newElement);
|
||||
}
|
||||
deleteButtonHandler = function(elem) {
|
||||
elem.bind("click", function() {
|
||||
var deleteInput = $(this).prev().prev(),
|
||||
form = $(this).parents(".dynamic-form").first();
|
||||
// callback
|
||||
// toggle options.predeleteCssClass and toggle checkbox
|
||||
if (form.hasClass("has_original")) {
|
||||
form.toggleClass("predelete");
|
||||
if (deleteInput.attr("checked")) {
|
||||
deleteInput.attr("checked", false);
|
||||
} else {
|
||||
deleteInput.attr("checked", true);
|
||||
}
|
||||
}
|
||||
// callback
|
||||
});
|
||||
};
|
||||
$(document).ready(function($) {
|
||||
deleteButtonHandler($("table#bda_formset tbody.bda_formset_content").find("a.delete-handler"));
|
||||
$("table#bda_formset tbody.bda_formset_content").sortable({
|
||||
handle: "a.drag-handler",
|
||||
items: "tr",
|
||||
axis: "y",
|
||||
appendTo: 'body',
|
||||
forceHelperSize: true,
|
||||
placeholder: 'ui-sortable-placeholder',
|
||||
forcePlaceholderSize: true,
|
||||
containment: 'form#bda_form',
|
||||
tolerance: 'pointer',
|
||||
start: function(evt, ui) {
|
||||
var template = "",
|
||||
len = ui.item.children("td").length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
template += "<td style='height:" + (ui.item.outerHeight() + 12 ) + "px' class='placeholder-cell'> </td>"
|
||||
}
|
||||
template += "";
|
||||
ui.placeholder.html(template);
|
||||
},
|
||||
stop: function(evt, ui) {
|
||||
// Toggle div.table twice to remove webkits border-spacing bug
|
||||
$("table#bda_formset").toggle().toggle();
|
||||
},
|
||||
});
|
||||
$("#bda_form").bind("submit", function(){
|
||||
var sortable_field_name = "priority";
|
||||
var i = 1;
|
||||
$(".bda_formset_content").find("tr").each(function(){
|
||||
var fields = $(this).find("td :input[value]"),
|
||||
select = $(this).find("td select");
|
||||
if (select.val() && fields.serialize()) {
|
||||
$(this).find("input[name$='"+sortable_field_name+"']").val(i);
|
||||
i++;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
})(django.jQuery);
|
||||
</script>
|
||||
|
||||
<h2>Inscription au tirage au sort du BdA</h2>
|
||||
{% if success %}
|
||||
<p class="success">Votre inscription a été mise à jour avec succès !</p>
|
||||
{% endif %}
|
||||
{% if stateerror %}
|
||||
<p class="error">Impossible d'enregistrer vos modifications: vous avez apporté d'autres modifications entre temps</p>
|
||||
{% endif %}
|
||||
<form id="bda_form" method="post" action="{% url 'bda-tirage-inscription' %}">
|
||||
{% csrf_token %}
|
||||
{% include "inscription-formset.html" %}
|
||||
<input type="button" class="btn-addmore" value="Ajouter un autre vœu" id="add_more">
|
||||
<script>
|
||||
django.jQuery('#add_more').click(function() {
|
||||
cloneMore('tbody.bda_formset_content tr:last-child', 'choixspectacle_set');
|
||||
});
|
||||
</script>
|
||||
<input type="hidden" name="dbstate" value="{{ dbstate }}" />
|
||||
<input type="submit" class="btn-submit" value="Enregistrer" />
|
||||
Prix total actuel : {{ total_price }}€
|
||||
<hr />
|
||||
<p class="footnotes">
|
||||
<sup>1</sup>: cette liste de vœu est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu<br />
|
||||
</p>
|
||||
</form>
|
||||
{% endblock %}
|
116
bda/templates/inscription-bda.html.save
Normal file
116
bda/templates/inscription-bda.html.save
Normal file
|
@ -0,0 +1,116 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link href="{{ STATIC_URL }}grappelli/jquery/ui/css/custom-theme/jquery-ui-1.8.custom.css" rel="stylesheet" type="text/css" media="screen" title="no title" charset="utf-8" />
|
||||
<script src="{{ STATIC_URL }}grappelli/jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
|
||||
<script src="{{ STATIC_URL }}grappelli/jquery/ui/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
|
||||
<link href="{{ STATIC_URL }}grappelli/css/tools.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ STATIC_URL }}grappelli/css/jquery-ui-grappelli-extensions.css" rel="stylesheet" type="text/css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block realcontent %}
|
||||
<script type="text/javascript">
|
||||
var django = {
|
||||
"jQuery": jQuery.noConflict(true)
|
||||
};
|
||||
|
||||
(function($) {
|
||||
cloneMore = function(selector, type) {
|
||||
var newElement = $(selector).clone(true);
|
||||
var total = $('#id_' + type + '-TOTAL_FORMS').val();
|
||||
newElement.find(':input').each(function() {
|
||||
var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-');
|
||||
var id = 'id_' + name;
|
||||
$(this).attr({'name': name, 'id': id}).val('').removeAttr('checked');
|
||||
});
|
||||
newElement.find('label').each(function() {
|
||||
var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-');
|
||||
$(this).attr('for', newFor);
|
||||
});
|
||||
total++;
|
||||
$('#id_' + type + '-TOTAL_FORMS').val(total);
|
||||
$(selector).after(newElement);
|
||||
}
|
||||
deleteButtonHandler = function(elem) {
|
||||
elem.bind("click", function() {
|
||||
var deleteInput = $(this).prev().prev(),
|
||||
form = $(this).parents(".dynamic-form").first();
|
||||
// callback
|
||||
// toggle options.predeleteCssClass and toggle checkbox
|
||||
if (form.hasClass("has_original")) {
|
||||
form.toggleClass("predelete");
|
||||
if (deleteInput.attr("checked")) {
|
||||
deleteInput.attr("checked", false);
|
||||
} else {
|
||||
deleteInput.attr("checked", true);
|
||||
}
|
||||
}
|
||||
// callback
|
||||
});
|
||||
};
|
||||
$(document).ready(function($) {
|
||||
deleteButtonHandler($("table#bda_formset tbody.bda_formset_content").find("a.delete-handler"));
|
||||
$("table#bda_formset tbody.bda_formset_content").sortable({
|
||||
handle: "a.drag-handler",
|
||||
items: "tr",
|
||||
axis: "y",
|
||||
appendTo: 'body',
|
||||
forceHelperSize: true,
|
||||
placeholder: 'ui-sortable-placeholder',
|
||||
forcePlaceholderSize: true,
|
||||
containment: 'form#bda_form',
|
||||
tolerance: 'pointer',
|
||||
start: function(evt, ui) {
|
||||
var template = "",
|
||||
len = ui.item.children("td").length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
template += "<td style='height:" + (ui.item.outerHeight() + 12 ) + "px' class='placeholder-cell'> </td>"
|
||||
}
|
||||
template += "";
|
||||
ui.placeholder.html(template);
|
||||
},
|
||||
stop: function(evt, ui) {
|
||||
// Toggle div.table twice to remove webkits border-spacing bug
|
||||
$("table#bda_formset").toggle().toggle();
|
||||
},
|
||||
});
|
||||
$("#bda_form").bind("submit", function(){
|
||||
var sortable_field_name = "priority";
|
||||
var i = 1;
|
||||
$(".bda_formset_content").find("tr").each(function(){
|
||||
var fields = $(this).find("td :input[value]"),
|
||||
select = $(this).find("td select");
|
||||
if (select.val() && fields.serialize()) {
|
||||
$(this).find("input[name$='"+sortable_field_name+"']").val(i);
|
||||
i++;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
})(django.jQuery);
|
||||
</script>
|
||||
|
||||
<h2>Inscription au tirage au sort du BDA</h2>
|
||||
{% if success %}
|
||||
<p class="success">Votre inscription a été mise à jour avec succès !</p>
|
||||
{% endif %}
|
||||
<form id="bda_form" method="post" action="{% url 'bda-tirage-inscription' %}">
|
||||
{% csrf_token %}
|
||||
{% include "inscription-formset.html" %}
|
||||
<input type="button" class="btn-addmore" value="Ajouter un autre vœu" id="add_more">
|
||||
<script>
|
||||
django.jQuery('#add_more').click(function() {
|
||||
cloneMore('tbody.bda_formset_content tr:last-child', 'choixspectacle_set');
|
||||
});
|
||||
</script>
|
||||
<input type="submit" class="btn-submit" value="Enregistrer" />
|
||||
Prix total actuel : {{ total_price }}€
|
||||
<hr />
|
||||
<p class="footnotes">
|
||||
<sup>1</sup>: demander deux places pour ce spectacle<br />
|
||||
<sup>2</sup>: abandonner une place si impossible d'en obtenir une seconde pour ce spectacle (si vous avez coché l'option <tt>Deux places</tt> pour ce spectacle)<br />
|
||||
<sup>3</sup>: cette liste de vœu est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu<br />
|
||||
</p>
|
||||
</form>
|
||||
{% endblock %}
|
120
bda/templates/inscription-bda2.html
Normal file
120
bda/templates/inscription-bda2.html
Normal file
|
@ -0,0 +1,120 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link href="{{ STATIC_URL }}grappelli/jquery/ui/css/custom-theme/jquery-ui-1.8.custom.css" rel="stylesheet" type="text/css" media="screen" title="no title" charset="utf-8" />
|
||||
<script src="{{ STATIC_URL }}grappelli/jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
|
||||
<script src="{{ STATIC_URL }}grappelli/jquery/ui/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
|
||||
<link href="{{ STATIC_URL }}grappelli/css/tools.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ STATIC_URL }}grappelli/css/jquery-ui-grappelli-extensions.css" rel="stylesheet" type="text/css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block realcontent %}
|
||||
<script type="text/javascript">
|
||||
var django = {
|
||||
"jQuery": jQuery.noConflict(true)
|
||||
};
|
||||
|
||||
(function($) {
|
||||
cloneMore = function(selector, type) {
|
||||
var newElement = $(selector).clone(true);
|
||||
var total = $('#id_' + type + '-TOTAL_FORMS').val();
|
||||
newElement.find(':input').each(function() {
|
||||
var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-');
|
||||
var id = 'id_' + name;
|
||||
$(this).attr({'name': name, 'id': id}).val('').removeAttr('checked');
|
||||
});
|
||||
newElement.find('label').each(function() {
|
||||
var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-');
|
||||
$(this).attr('for', newFor);
|
||||
});
|
||||
total++;
|
||||
$('#id_' + type + '-TOTAL_FORMS').val(total);
|
||||
$(selector).after(newElement);
|
||||
}
|
||||
deleteButtonHandler = function(elem) {
|
||||
elem.bind("click", function() {
|
||||
var deleteInput = $(this).prev().prev(),
|
||||
form = $(this).parents(".dynamic-form").first();
|
||||
// callback
|
||||
// toggle options.predeleteCssClass and toggle checkbox
|
||||
if (form.hasClass("has_original")) {
|
||||
form.toggleClass("predelete");
|
||||
if (deleteInput.attr("checked")) {
|
||||
deleteInput.attr("checked", false);
|
||||
} else {
|
||||
deleteInput.attr("checked", true);
|
||||
}
|
||||
}
|
||||
// callback
|
||||
});
|
||||
};
|
||||
$(document).ready(function($) {
|
||||
deleteButtonHandler($("table#bda_formset tbody.bda_formset_content").find("a.delete-handler"));
|
||||
$("table#bda_formset tbody.bda_formset_content").sortable({
|
||||
handle: "a.drag-handler",
|
||||
items: "tr",
|
||||
axis: "y",
|
||||
appendTo: 'body',
|
||||
forceHelperSize: true,
|
||||
placeholder: 'ui-sortable-placeholder',
|
||||
forcePlaceholderSize: true,
|
||||
containment: 'form#bda_form',
|
||||
tolerance: 'pointer',
|
||||
start: function(evt, ui) {
|
||||
var template = "",
|
||||
len = ui.item.children("td").length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
template += "<td style='height:" + (ui.item.outerHeight() + 12 ) + "px' class='placeholder-cell'> </td>"
|
||||
}
|
||||
template += "";
|
||||
ui.placeholder.html(template);
|
||||
},
|
||||
stop: function(evt, ui) {
|
||||
// Toggle div.table twice to remove webkits border-spacing bug
|
||||
$("table#bda_formset").toggle().toggle();
|
||||
},
|
||||
});
|
||||
$("#bda_form").bind("submit", function(){
|
||||
var sortable_field_name = "priority";
|
||||
var i = 1;
|
||||
$(".bda_formset_content").find("tr").each(function(){
|
||||
var fields = $(this).find("td :input[value]"),
|
||||
select = $(this).find("td select");
|
||||
if (select.val() && fields.serialize()) {
|
||||
$(this).find("input[name$='"+sortable_field_name+"']").val(i);
|
||||
i++;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
})(django.jQuery);
|
||||
</script>
|
||||
|
||||
<h2>Inscription au tirage au sort du BdA</h2>
|
||||
{% if success %}
|
||||
<p class="success">Votre inscription a été mise à jour avec succès !</p>
|
||||
{% endif %}
|
||||
{% if stateerror %}
|
||||
<p class="error">Impossible d'enregistrer vos modifications: vous avez apporté d'autres modifications entre temps</p>
|
||||
{% endif %}
|
||||
<form id="bda_form" method="post" action="{% url 'bda2-tirage-inscription' %}">
|
||||
{% csrf_token %}
|
||||
{% include "inscription-formset.html" %}
|
||||
<input type="button" class="btn-addmore" value="Ajouter un autre vœu" id="add_more">
|
||||
<script>
|
||||
django.jQuery('#add_more').click(function() {
|
||||
cloneMore('tbody.bda_formset_content tr:last-child', 'choixspectacle_set');
|
||||
});
|
||||
</script>
|
||||
<input type="hidden" name="dbstate" value="{{ dbstate }}" />
|
||||
<input type="submit" class="btn-submit" value="Enregistrer" />
|
||||
Prix total actuel : {{ total_price }}€
|
||||
<hr />
|
||||
<p class="footnotes">
|
||||
<sup>1</sup>: demander deux places pour ce spectable<br />
|
||||
<sup>2</sup>: abandonner une place si impossible d'en obtenir une seconde pour ce spectacle (si vous avez coché l'option <tt>Deux places</tt> pour ce spectacle)<br />
|
||||
<sup>3</sup>: cette liste de vœu est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu<br />
|
||||
</p>
|
||||
</form>
|
||||
{% endblock %}
|
120
bda/templates/inscription-bda3.html
Normal file
120
bda/templates/inscription-bda3.html
Normal file
|
@ -0,0 +1,120 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link href="{{ STATIC_URL }}grappelli/jquery/ui/css/custom-theme/jquery-ui-1.8.custom.css" rel="stylesheet" type="text/css" media="screen" title="no title" charset="utf-8" />
|
||||
<script src="{{ STATIC_URL }}grappelli/jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
|
||||
<script src="{{ STATIC_URL }}grappelli/jquery/ui/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
|
||||
<link href="{{ STATIC_URL }}grappelli/css/tools.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ STATIC_URL }}grappelli/css/jquery-ui-grappelli-extensions.css" rel="stylesheet" type="text/css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block realcontent %}
|
||||
<script type="text/javascript">
|
||||
var django = {
|
||||
"jQuery": jQuery.noConflict(true)
|
||||
};
|
||||
|
||||
(function($) {
|
||||
cloneMore = function(selector, type) {
|
||||
var newElement = $(selector).clone(true);
|
||||
var total = $('#id_' + type + '-TOTAL_FORMS').val();
|
||||
newElement.find(':input').each(function() {
|
||||
var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-');
|
||||
var id = 'id_' + name;
|
||||
$(this).attr({'name': name, 'id': id}).val('').removeAttr('checked');
|
||||
});
|
||||
newElement.find('label').each(function() {
|
||||
var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-');
|
||||
$(this).attr('for', newFor);
|
||||
});
|
||||
total++;
|
||||
$('#id_' + type + '-TOTAL_FORMS').val(total);
|
||||
$(selector).after(newElement);
|
||||
}
|
||||
deleteButtonHandler = function(elem) {
|
||||
elem.bind("click", function() {
|
||||
var deleteInput = $(this).prev().prev(),
|
||||
form = $(this).parents(".dynamic-form").first();
|
||||
// callback
|
||||
// toggle options.predeleteCssClass and toggle checkbox
|
||||
if (form.hasClass("has_original")) {
|
||||
form.toggleClass("predelete");
|
||||
if (deleteInput.attr("checked")) {
|
||||
deleteInput.attr("checked", false);
|
||||
} else {
|
||||
deleteInput.attr("checked", true);
|
||||
}
|
||||
}
|
||||
// callback
|
||||
});
|
||||
};
|
||||
$(document).ready(function($) {
|
||||
deleteButtonHandler($("table#bda_formset tbody.bda_formset_content").find("a.delete-handler"));
|
||||
$("table#bda_formset tbody.bda_formset_content").sortable({
|
||||
handle: "a.drag-handler",
|
||||
items: "tr",
|
||||
axis: "y",
|
||||
appendTo: 'body',
|
||||
forceHelperSize: true,
|
||||
placeholder: 'ui-sortable-placeholder',
|
||||
forcePlaceholderSize: true,
|
||||
containment: 'form#bda_form',
|
||||
tolerance: 'pointer',
|
||||
start: function(evt, ui) {
|
||||
var template = "",
|
||||
len = ui.item.children("td").length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
template += "<td style='height:" + (ui.item.outerHeight() + 12 ) + "px' class='placeholder-cell'> </td>"
|
||||
}
|
||||
template += "";
|
||||
ui.placeholder.html(template);
|
||||
},
|
||||
stop: function(evt, ui) {
|
||||
// Toggle div.table twice to remove webkits border-spacing bug
|
||||
$("table#bda_formset").toggle().toggle();
|
||||
},
|
||||
});
|
||||
$("#bda_form").bind("submit", function(){
|
||||
var sortable_field_name = "priority";
|
||||
var i = 1;
|
||||
$(".bda_formset_content").find("tr").each(function(){
|
||||
var fields = $(this).find("td :input[value]"),
|
||||
select = $(this).find("td select");
|
||||
if (select.val() && fields.serialize()) {
|
||||
$(this).find("input[name$='"+sortable_field_name+"']").val(i);
|
||||
i++;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
})(django.jQuery);
|
||||
</script>
|
||||
|
||||
<h2>Inscription au tirage au sort du BdA</h2>
|
||||
{% if success %}
|
||||
<p class="success">Votre inscription a été mise à jour avec succès !</p>
|
||||
{% endif %}
|
||||
{% if stateerror %}
|
||||
<p class="error">Impossible d'enregistrer vos modifications: vous avez apporté d'autres modifications entre temps</p>
|
||||
{% endif %}
|
||||
<form id="bda_form" method="post" action="{% url 'bda3-tirage-inscription' %}">
|
||||
{% csrf_token %}
|
||||
{% include "inscription-formset.html" %}
|
||||
<input type="button" class="btn-addmore" value="Ajouter un autre vœu" id="add_more">
|
||||
<script>
|
||||
django.jQuery('#add_more').click(function() {
|
||||
cloneMore('tbody.bda_formset_content tr:last-child', 'choixspectacle_set');
|
||||
});
|
||||
</script>
|
||||
<input type="hidden" name="dbstate" value="{{ dbstate }}" />
|
||||
<input type="submit" class="btn-submit" value="Enregistrer" />
|
||||
Prix total actuel : {{ total_price }}€
|
||||
<hr />
|
||||
<p class="footnotes">
|
||||
<sup>1</sup>: demander deux places pour ce spectable<br />
|
||||
<sup>2</sup>: abandonner une place si impossible d'en obtenir une seconde pour ce spectacle (si vous avez coché l'option <tt>Deux places</tt> pour ce spectacle)<br />
|
||||
<sup>3</sup>: cette liste de vœu est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu<br />
|
||||
</p>
|
||||
</form>
|
||||
{% endblock %}
|
40
bda/templates/inscription-formset.html
Normal file
40
bda/templates/inscription-formset.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
{{ formset.non_form_errors.as_ul }}
|
||||
<table id="bda_formset" class="form">
|
||||
{{ formset.management_form }}
|
||||
{% for form in formset.forms %}
|
||||
{% if forloop.first %}
|
||||
<thead><tr>
|
||||
{% for field in form.visible_fields %}
|
||||
{% if field.name != "DELETE" and field.name != "priority" %}
|
||||
<th class="bda-field-{{ field.name }}">{{ field.label|safe|capfirst }}</th>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<th><sup>1</sup></th>
|
||||
</tr></thead>
|
||||
<tbody class="bda_formset_content">
|
||||
{% endif %}
|
||||
<tr class="{% cycle row1,row2 %} dynamic-form {% if form.instance.pk %}has_original{% endif %}">
|
||||
{% for field in form.visible_fields %}
|
||||
{% if field.name != "DELETE" and field.name != "priority" %}
|
||||
<td class="bda-field-{{ field.name }}">
|
||||
{% if forloop.first %}
|
||||
{{ form.non_field_errors }}
|
||||
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
|
||||
{% endif %}
|
||||
{{ field.errors.as_ul }}
|
||||
{{ field }}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<td class="tools-cell"><div class="tools">
|
||||
<a href="javascript://" class="icon drag-handler" title="Déplacer"></a>
|
||||
<input type="checkbox" name="{{ form.DELETE.html_name }}" style="display: none;" />
|
||||
<input type="hidden" name="{{ form.priority.html_name }}" style="{{ form.priority.value }}" />
|
||||
<a href="javascript://" class="icon delete-handler" title="Supprimer"></a>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
10
bda/templates/liste_spectacles.ics
Normal file
10
bda/templates/liste_spectacles.ics
Normal file
|
@ -0,0 +1,10 @@
|
|||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:-//GESTIOCOF/bda//EN
|
||||
{% for spectacle in spectacles %}BEGIN:VEVENT
|
||||
DTSTART;TZID=Europe/Paris:{{ spectacle.date|date:'Ymd\\THis' }}
|
||||
DTEND;TZID=Europe/Paris:{{ spectacle.dtend|date:'Ymd\\THis' }}
|
||||
SUMMARY:{{ spectacle.title|safe }}
|
||||
LOCATION:{{ spectacle.location.name|safe }}
|
||||
END:VEVENT
|
||||
{% endfor %}END:VCALENDAR
|
16
bda/templates/resume_inscription.html
Normal file
16
bda/templates/resume_inscription.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h1><strong>{{ error_title }}</strong></h1>
|
||||
<p>{{ error_description }}</p>
|
||||
{% if choices %}
|
||||
<h3>Vos vœux:</h3>
|
||||
<ol>
|
||||
{% for choice in choices %}
|
||||
<li>{{ choice.spectacle }}{% if choice.double %} (deux places{% if autoquit %}, abandon automatique{% endif %}){% endif %}</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% else %}
|
||||
<h3>Vous n'avez enregistré aucun vœu pour le tirage au sort</h3>
|
||||
{% endif %}
|
||||
{% endblock %}
|
19
bda/templates/resume_places.html
Normal file
19
bda/templates/resume_places.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h3><strong>Places attribuées</strong></h3>
|
||||
{% if warning %}
|
||||
<h3 class="error">Attention, vous avez reçu plusieurs places pour des spectacles différents à la même date !</h3>
|
||||
{% endif %}
|
||||
{% if places %}
|
||||
<ol>
|
||||
{% for place in places %}
|
||||
<li>{{ place.spectacle }}{% if place.double %} (deux places){% endif %}</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
<h4>Total à payer : {{ total|floatformat }}€</h4>
|
||||
<h4><a href="{% url "bda-places-attribuees-ics" %}">Exporter au format calendrier</a> (.ics, compatible avec tous les logiciels d'agenda)</h4>
|
||||
{% else %}
|
||||
<h3>Vous n'avez aucune place :(</h3>
|
||||
{% endif %}
|
||||
{% endblock %}
|
10
bda/templates/resume_places.ics
Normal file
10
bda/templates/resume_places.ics
Normal file
|
@ -0,0 +1,10 @@
|
|||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:-//GESTIOCOF/bda//EN
|
||||
{% for place in places %}BEGIN:VEVENT
|
||||
DTSTART;TZID=Europe/Paris:{{ place.spectacle.date|date:'Ymd\\THis' }}
|
||||
DTEND;TZID=Europe/Paris:{{ place.spectacle.dtend|date:'Ymd\\THis' }}
|
||||
SUMMARY:{{ place.spectacle.title|safe }}{% if place.double %} (deux places){% endif %}
|
||||
LOCATION:{{ place.spectacle.location.name|safe }}
|
||||
END:VEVENT
|
||||
{% endfor %}END:VCALENDAR
|
11
bda/templates/spectacle_list.html
Normal file
11
bda/templates/spectacle_list.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h1><strong>Spectacles</strong></h1>
|
||||
<ul>
|
||||
<li><a href="{% url 'bda-unpaid' %}">Pas payé</a></li>
|
||||
{% for spectacle in object_list %}
|
||||
<li><a href="{% url 'bda-spectacle' spectacle.id %}">{{ spectacle }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue