Commit a75327c5 authored by Gino's avatar Gino

upadate: new cdn unpkg

parent 29d90775
......@@ -83,5 +83,5 @@ class Command(BaseCommand):
"""
def handle(self, *args, **options):
elected_importer = ElectedImporter()
elected_importer.populate(10)
elected_importer.populate()
# elected_importer.test_file()
\ No newline at end of file
......@@ -135,12 +135,12 @@ def actiongroup_generate_slug(sender, instance, **kwargs):
for index in itertools.count(1):
if not ActionGroup.objects.filter(slug=instance.slug).exists():
break
instance.slug = f"{default_slug}-{index}"
instance.slug = "{}-{}".format(default_slug, index)
@receiver(pre_save, sender=Representative)
def representative_generate_slug(sender, instance, **kwargs):
instance.slug = default_slug = slugify(f"{instance.firstname} {instance.lastname}")
instance.slug = default_slug = slugify("{} {}".format(instance.firstname, instance.lastname))
for index in itertools.count(1):
if not Representative.objects.filter(slug=instance.slug).exists():
break
instance.slug = f"{default_slug}-{index}"
\ No newline at end of file
instance.slug = "{}-{}".format(default_slug, index)
\ No newline at end of file
......@@ -83,7 +83,8 @@
label-actiongroups="Groupes d'actions"
widget-actiongroups="sib-form-auto-completion"
range-actiongroups="{{ domain }}/api/action-groups/"
next="groupes-action-list"
{% comment %} next="groupes-action-list" {% endcomment %}
next="action-group-detail"
></sib-form>
</div>
{% endif %}
......
......@@ -18,6 +18,7 @@
>► Voir tous les&nbsp;groupes
</sib-link>
<sib-display
id="testpop"
data-src="{{ domain }}/api/action-groups/"
value-voir="voir"
data-fields="name, image, voir"
......
......@@ -15,9 +15,14 @@ APP STRUCTURE:
<head>
<meta charset="utf-8">
<title>United4Earth</title>
<script type="module" src="https://cdn.happy-dev.fr/sib-router/sib-router.js"></script>
{% comment %} <script type="module" src="https://cdn.happy-dev.fr/sib-router/sib-router.js"></script>
<script type="module" src="https://cdn.happy-dev.fr/sib-core/sib-display.js"></script>
<script type="module" src="https://cdn.happy-dev.fr/sib-core/sib-form.js"></script>
<script type="module" src="https://cdn.happy-dev.fr/sib-core/sib-form.js"></script> {% endcomment %}
<script type="module" src="https://unpkg.com/@startinblox/core@latest"></script>
<script type="module" src="https://unpkg.com/@startinblox/router@latest"></script>
{% comment %} <script type="module" src="https://cdn.happy-dev.fr/sib-conversation/sib-conversation.js"></script> {% endcomment %}
{% comment %} <script type="module" src="https://unpkg.com/@startinblox/core@latest"></script>
......@@ -195,16 +200,22 @@ actiongroup_edit_button.addEventListener("click", function (e) {
alert('ok');
//location.reload();
});*/
var xyz = document.getElementById("representatives-add");
xyz.style.border = "10px solid red";
xyz.addEventListener('populate', function(e) {
alert("hello");
console.log("hello");
});
var testpop = document.getElementById("testpop");
testpop.style.border = "10px solid red";
testpop.addEventListener('populate', function(e) {
alert("hello");
});
</script>
{% comment %} <script src="https://code.j.com/j-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> {% endcomment %}
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'js/moment-with-locales.min.js' %}"></script>
<script type="module" src="{% static 'js/widgets.js' %}"></script>
{% comment %} <script type="module" src="{% static 'js/widgets-representatives.js' %}"></script> {% endcomment %}
......
......@@ -59,16 +59,24 @@
<sib-form
id="sib-form-add-representative"
data-src="{{ domain }}/api/representatives/"
data-fields="civil, political, contact"
{% comment %} set-civil="title-civil, firstname, lastname, function, title, protocol_role, protocol_person, photo" {% endcomment %}
set-civil="title-civil, lastname, firstname, civility, political_part, function, election_department, city, postal_code, country"
value-title-civil="Informations principales"
set-contact="title-contact, phone_direct, phone_organization, email_direct, email_organization, address1, city, website"
value-title-contact="Informations de contact"
{% comment %}
set-civil="title-civil, firstname, lastname, civility, title, function, title, protocol_role, protocol_person, photo"
set-civil="firstname, lastname, function, title, protocol_role, protocol_person, photo"
{% comment %} value-title-civil="salut" {% endcomment %}
{% comment %} value-title-civil="Civilité & protocole" {% endcomment %}
{% comment %} widget-title-civil="sib-display-form-title" {% endcomment %}
{% comment %} value-next-button="suivant" {% endcomment %}
{% comment %} widget-next-button="sib-display-button" {% endcomment %}
set-political="political_party, election_department, election_region, organization_type, organization_subtype"
set-contact="phone_direct, phone_organization, email_direct, email_organization, address1, address2, postal_code, city, country, website"
value-title-civil="salut"
value-title-civil="Civilité & protocole"
widget-title-civil="sib-display-form-title"
value-next-button="suivant"
widget-next-button="sib-display-button"
set-political="election_region, organization_type, organization_subtype"
label-firstname="Prénom*"
label-lastname="Nom*"
label-function="Fonction"
......@@ -91,6 +99,8 @@
label-organization_type="Type d'organisation"
label-organization_subtype="Sous-type d'organisation"
label-photo="Photo (URL)"
{% endcomment %}
next="representatives-list"
></sib-form>
</div>
......
File mode changed from 100644 to 100755
backcall==0.1.0
certifi==2018.10.15
certifi==2018.11.29
chardet==3.0.4
colorama==0.4.1
decorator==4.3.0
Django==1.11.17
Django==1.11
django-guardian==1.4.9
django-registration-redux==2.5
django-rest-framework==0.1.0
djangoldp==0.5a12
djangorestframework==3.9.0
djangorestframework-guardian==0.1.1
idna==2.7
ipython==7.2.0
ipython-genutils==0.2.0
jedi==0.13.1
parso==0.3.1
pickleshare==0.7.5
prompt-toolkit==2.0.7
psycopg2==2.7.6.1
Pygments==2.3.0
djangoldp==0.5.16
djangoldp-conversation==0.0.4
djangorestframework==3.9.1
idna==2.8
pkg-resources==0.0.0
PyLD==1.0.4
pytz==2018.7
requests==2.20.1
pytz==2018.9
requests==2.21.0
six==1.12.0
traitlets==4.3.2
urllib3==1.24.1
wcwidth==0.1.7
xlrd==1.1.0
import { SIBWidget, SIBMultipleWidget } from "https://cdn.happy-dev.fr/sib-core/widgets/sib-base-widgets.js";
//import { SIBWidget, SIBMultipleWidget, SIBFormMultipleValue, SIBFormAutoCompletion, importCSS, uniqID, store } from "https://unpkg.com/@startinblox/core@latest";
import { SIBWidget, SIBMultipleWidget, SIBFormMultipleValue, SIBFormAutoCompletion, Helpers, store } from "https://unpkg.com/@startinblox/core@latest";
//const {importCSS} = Helpers;
/*import { SIBWidget, SIBMultipleWidget } from "https://cdn.happy-dev.fr/sib-core/widgets/sib-base-widgets.js";
import { SIBFormMultipleValue, SIBFormAutoCompletion } from "https://cdn.happy-dev.fr/sib-core/widgets/sib-form-widgets.js";
import { importCSS, uniqID } from "https://cdn.happy-dev.fr/sib-core/helpers.js";
import { store } from "https://cdn.happy-dev.fr/sib-core/store.js";
import { store } from "https://cdn.happy-dev.fr/sib-core/store.js";*/
import Choices from 'https://dev.jspm.io/choices.js@4';
//import { SIBWidget, SIBMultipleWidget, SIBFormMultipleValue, SIBFormAutoCompletion, uniqID, store } from 'https://unpkg.com/@startinblox/core@latest';
......@@ -114,7 +119,7 @@ class U4EFormAutoCompletionRep extends SIBFormAutoCompletion {
options.forEach(option => select.appendChild(option));
this.parent.appendChild(select);
new Choices(select, { removeItemButton: true });
importCSS('https://dev.jspm.io/npm:choices.js@4/public/assets/styles/choices.min.css')
Helpers.importCSS('https://dev.jspm.io/npm:choices.js@4/public/assets/styles/choices.min.css')
}
// set range(url) {
// store.list(url).then(list => {
......@@ -158,7 +163,7 @@ class U4EFormAutoCompletionRep extends SIBFormAutoCompletion {
options.forEach(option => select.appendChild(option));
this.parent.appendChild(select);
new Choices(select, { removeItemButton: true });
importCSS('https://dev.jspm.io/npm:choices.js@4/public/assets/styles/choices.min.css')
Helpers.importCSS('https://dev.jspm.io/npm:choices.js@4/public/assets/styles/choices.min.css')
}
}
customElements.define('u4e-form-auto-completion-rep2', U4EFormAutoCompletionRep2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment