toujours cassé
This commit is contained in:
parent
3bffc2ce69
commit
f973c0a1eb
2 changed files with 0 additions and 164 deletions
|
@ -1,41 +0,0 @@
|
||||||
{% load bootstrap %}
|
|
||||||
{{ formset.non_form_errors.as_ul }}
|
|
||||||
<table id="bda_formset" class="form table">
|
|
||||||
{{ formset.management_form }}
|
|
||||||
{% for form in formset.forms %}
|
|
||||||
{% if forloop.first %}
|
|
||||||
<thead><tr>
|
|
||||||
{% for field in form.visible_fields %}
|
|
||||||
<th class="bda-field-{{ field.name }}">
|
|
||||||
{% if field.name != "DELETE" %}
|
|
||||||
{{ field.label|safe|capfirst }}
|
|
||||||
{% endif %}
|
|
||||||
<sup>{{ forloop.counter }}</sup>
|
|
||||||
</th>
|
|
||||||
{% endfor %}
|
|
||||||
</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 | bootstrap }}
|
|
||||||
</td>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
<td class="tools-cell"><div class="tools">
|
|
||||||
<input type="checkbox" name="{{ form.DELETE.html_name }}" style="display: none;" />
|
|
||||||
<a href="javascript://" class="glyphicon glyphicon-remove remove-btn" title="Supprimer"></a>
|
|
||||||
</div>
|
|
||||||
<div class="spacer"></div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
|
@ -1,123 +0,0 @@
|
||||||
{% extends "base_title.html" %}
|
|
||||||
{% load staticfiles %}
|
|
||||||
{% load bootstrap %}
|
|
||||||
|
|
||||||
{% block extra_head %}
|
|
||||||
<link href="{% static "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 "grappelli/jquery/jquery-1.6.2.min.js" %}" type="text/javascript"></script>
|
|
||||||
<script src="{% static "grappelli/jquery/ui/js/jquery-ui-1.8.15.custom.min.js" %}" type="text/javascript"></script>
|
|
||||||
<link href="{% static "grappelli/css/tools.css" %}" rel="stylesheet" type="text/css" />
|
|
||||||
<link href="{% static "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(),
|
|
||||||
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.remove-btn"));
|
|
||||||
$("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 class="no-bottom-margin">Inscription pour donner des cours particuliers</h2>
|
|
||||||
{% if success %}
|
|
||||||
<p class="success table-top">Votre inscription a été mise à jour avec succès !</p>
|
|
||||||
{% endif %}
|
|
||||||
<form class="form-horizontal petit-cours_form" id="bda_form" method="post" action="{% url 'petits-cours-inscription' %}">
|
|
||||||
{% csrf_token %}
|
|
||||||
<span style="font-size: 1.25em; font-weight: bold; color: #DE826B;"><input type="checkbox" name="receive_proposals" {% if receive_proposals %}checked="checked"{% endif %} /> Recevoir des propositions de petits cours</span>
|
|
||||||
{% include "inscription-petit-cours-formset.html" %}
|
|
||||||
<div class="inscription-bottom">
|
|
||||||
<input type="button" class="btn btn-default pull-right" value="Ajouter une autre matière" id="add_more" />
|
|
||||||
<script>
|
|
||||||
django.jQuery('#add_more').click(function() {
|
|
||||||
cloneMore('tbody.bda_formset_content tr:last-child', 'petitcoursability_set');
|
|
||||||
});
|
|
||||||
</script><br />
|
|
||||||
<div style="margin: 10px 0px;">
|
|
||||||
<span style="vertical-align: top; font-weight: bold;">Remarques:</span> <textarea name="remarques" style="width: 60%; height: 60px;">{{ remarques }}</textarea>
|
|
||||||
</div>
|
|
||||||
<input type="submit" class="btn btn-primary pull-right" value="Enregistrer" />
|
|
||||||
<p class="footnotes">
|
|
||||||
<sup>1</sup>: spécifiez les matières pour lesquelles vous êtes compétent<br />
|
|
||||||
<sup>2</sup>: spécifiez pour chaque matière le ou les niveaux pour lesquels vous souhaitez recevoir des demandes<br />
|
|
||||||
<sup>3</sup>: spécifiez si vous êtes titulaire de l'agrégation pour cette matière<br />
|
|
||||||
<sup>4</sup>: pour supprimer une ligne, cliquez sur la croix puis appuyer sur <tt>Enregistrer</tt><br />
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% endblock %}
|
|
Loading…
Reference in a new issue