qualif: use select2 to select formdef

This commit is contained in:
Frédéric Péters 2015-07-10 16:56:51 +02:00
parent db070fad8f
commit f93dcc82d5
7 changed files with 11 additions and 5 deletions

View File

@ -1,2 +1,3 @@
Django>=1.7
gadjo
django-select2

View File

@ -99,6 +99,7 @@ setup(
],
install_requires=['django>=1.7',
'gadjo',
'django-select2',
],
zip_safe=False,
cmdclass={

View File

@ -38,6 +38,7 @@ INSTALLED_APPS = (
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_select2',
'welco.sources.mail',
'welco.qualif',
'gadjo',

View File

@ -115,7 +115,7 @@ div#content .cell.qualif form button.done {
bottom: 1ex;
}
div#content .cell.qualif .select2-container,
div#content .cell.qualif select {
max-width: 100%;
width: 98%;
}

View File

@ -11,7 +11,10 @@ $(function() {
source_pk: source_pk},
async: true,
dataType: 'html',
success: function(data) { $('.cell.qualif > div').replaceWith(data); },
success: function(data) {
$('.cell.qualif > div').replaceWith(data);
$('.cell.qualif select').select2();
},
error: function(error) { console.log(':(', error); }
});
});

View File

@ -1,5 +1,5 @@
{% extends "gadjo/base.html" %}
{% load static %}
{% load static django_select2_tags %}
{% block page-title %}Welco{% endblock %}
{% block site-title %}Welco{% endblock %}
@ -10,4 +10,5 @@
{% block extrascripts %}
{{ block.super }}
<script src="{% static "js/welco.js" %}"></script>
{% import_django_select2_js_css %}
{% endblock %}

View File

@ -1,7 +1,6 @@
{% load i18n %}
<div>
<form>
<p>{% trans 'Associated Form' %}</p>
{% if association %}
<ul>
{% for formdef in association.formdefs.all %}