qualif: use select2 to select formdef
This commit is contained in:
parent
db070fad8f
commit
f93dcc82d5
|
@ -1,2 +1,3 @@
|
|||
Django>=1.7
|
||||
gadjo
|
||||
django-select2
|
||||
|
|
1
setup.py
1
setup.py
|
@ -99,6 +99,7 @@ setup(
|
|||
],
|
||||
install_requires=['django>=1.7',
|
||||
'gadjo',
|
||||
'django-select2',
|
||||
],
|
||||
zip_safe=False,
|
||||
cmdclass={
|
||||
|
|
|
@ -38,6 +38,7 @@ INSTALLED_APPS = (
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django_select2',
|
||||
'welco.sources.mail',
|
||||
'welco.qualif',
|
||||
'gadjo',
|
||||
|
|
|
@ -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%;
|
||||
}
|
||||
|
|
|
@ -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); }
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{% load i18n %}
|
||||
<div>
|
||||
<form>
|
||||
<p>{% trans 'Associated Form' %}</p>
|
||||
{% if association %}
|
||||
<ul>
|
||||
{% for formdef in association.formdefs.all %}
|
||||
|
|
Loading…
Reference in New Issue