Commit e605af05 authored by Gino's avatar Gino

syntax: back of css in auth views, cleaned comments

parent 3186a7f6
#United4Earth
##Purpose
##Tech
\ No newline at end of file
......@@ -5,12 +5,11 @@
<sib-router default-route="action-group-wrapper">
<sib-route name="action-group-wrapper"></sib-route>
{% if user.is_authenticated %}
<sib-route name="edit-action-group-form">
</sib-route>
<sib-route name="edit-action-group-form"></sib-route>
{% endif %}
{% comment %} <li>
<li>
<sib-route name="test-action-edit">test-action-edit</sib-route>
</li> {% endcomment %}
</li>
</sib-router>
<div id="action-group-wrapper">
......@@ -24,10 +23,12 @@
widget-name="sib-display-h2"
bind-resources
></sib-display>
{% if user.is_authenticated %}
<sib-link
next="edit-action-group-form">
<img class="edit-icon" src="{% static 'img/edit.png' %}" alt="" title="Modifier le groupe">
</sib-link>
{% endif %}
</div>
<button id="group-membership" domain="{{ domain }}" user_id="{{ request.user.id }}" bind-resources>Groupe management</button>
</div>
......@@ -159,7 +160,7 @@
</div>
{% endif %}
{% comment %} <div id="test-action-edit" class="sib-form" hidden>
<div id="test-action-edit" class="sib-form" hidden>
<sib-form
bind-resources
id="sib-form-edit-actiongroup"
......@@ -183,5 +184,5 @@
range-actiongroups="{{ domain }}/api/action-groups/"
next="action-group-detail"
></sib-form>
</div> {% endcomment %}
</div>
</div>
\ No newline at end of file
{% load staticfiles %}
{% comment %} SiB route 1-2 'groupes-action' content /// START {% endcomment %}
<section id="agir">
{% comment %} SiB router 1-1 /// START {% endcomment %}
<sib-router default-route="groupes-action-list">
<sib-route name="groupes-action-list"></sib-route>
{% if user.is_authenticated %}
<sib-route
name="groupes-action-add"
></sib-route>
<sib-route name="groupes-action-add"></sib-route>
{% endif %}
</sib-router>
{% comment %} SiB router 1-1 /// END {% endcomment %}
<div id="groupes-action-list">
{% if user.is_authenticated %}
<div class="section-head">
<h2>Vos groupes d'action</h2>
<sib-link
next="groupes-action-add"
>
{% if user.is_authenticated %}
<sib-link next="groupes-action-add">
<button>Créer un groupe d'action</button>
</sib-link>
{% endif %}
</div>
<div class="action-groups-table">
<div class="action-groups-header">
<div class="a-col a-col1">Nom du groupe</div>
......@@ -41,7 +38,6 @@
>
</sib-display>
</div>
{% endif %}
<h2>Rejoignez de nouveaux groupes</h2>
<div class="action-groups-table">
......@@ -70,7 +66,7 @@
<sib-form
id="sib-form-add-actiongroup"
data-src="{{ domain }}/api/action-groups/"
data-fields="name, objective, description, kind, place, frequency, date, representatives, loomio, actiongroups"
data-fields="name, objective, description, kind, place, frequency, dates, representatives, loomio, actiongroups"
widget-representatives="u4e-form-auto-completion"
range-representatives="{{ domain }}/api/representatives/"
label-name="Nom de du groupe*"
......@@ -79,13 +75,13 @@
label-kind="Type d'action"
label-place="Lieu d'action"
label-frequency="Fréquence"
label-date="Dates d'action"
widget-date="u4e-form-date"
label-dates="Dates d'action"
widget-dates="u4e-form-date"
label-representatives="Élu(s)"
label-loomio="Lien sur Loomio"
widget-loomio="sib-form-multiple-value"
label-actiongroups="Groupes d'actions"
widget-actiongroups="u4e-form-auto-completion"
widget-actiongroups="sib-form-auto-completion"
range-actiongroups="{{ domain }}/api/action-groups/"
next="groupes-action-list"
></sib-form>
......@@ -93,4 +89,3 @@
{% endif %}
</section>
{% comment %} SiB route 1-2 'groupes-action' content /// END {% endcomment %}
\ No newline at end of file
......@@ -6,9 +6,9 @@
<sib-route name="representative-wrapper"></sib-route>
<sib-route name="edit-representative"></sib-route>
{% endif %}
{% comment %} <li>
<li>
<sib-route name="test-representative-edit">test-representative-edit</sib-route>
</li> {% endcomment %}
</li>
</sib-router>
<div id="representative-wrapper">
......@@ -29,10 +29,12 @@
data-fields="photo"
widget-photo="sib-display-img"
></sib-display>
{% if user.is_authenticated %}
<sib-link
next="edit-representative">
<img class="edit-icon" src="{% static 'img/edit.png' %}" alt="" title="Modifier l'élu">
</sib-link>
{% endif %}
</div>
<div class="representative-info">
<div class="representative-civil">
......@@ -102,7 +104,7 @@
{% endif %}
{% comment %} <div id="test-representative-edit" class="sib-form" hidden>
<div id="test-representative-edit" class="sib-form" hidden>
<sib-form
bind-resources
data-fields="firstname, lastname, function, title, protocol_role, protocol_person, political_party, election_department, election_region, phone_direct, phone_organization, email_direct, email_organization, address1, address2, postal_code, city, country, website, organization_type, organization_subtype, photo"
......@@ -130,6 +132,6 @@
label-photo="Photo (URL)"
next="representative-detail"
></sib-form>
</div> {% endcomment %}
</div>
</div>
\ No newline at end of file
{% load staticfiles %}
{% comment %} SiB route 1-3 'representatives-all' content /// START {% endcomment %}
<section id="nos-elus" class="representatives">
<sib-router default-route="representatives-list">
......@@ -26,11 +24,8 @@
<div id="representatives-list" class="representatives-table" hidden>
<div class="section-head">
<h1>Nos élus - Base de données collective</h1>
<sib-link
next="representatives-add"
>
{% comment %} TODO Remove this one {% endcomment %}
<button data-toggle="modal" data-target="#representatives-add">Ajouter un élu</button>
<sib-link next="representatives-add">
<button data-toggle="modal" data-target="#representatives-add">Ajouter un élu</button>
</sib-link>
</div>
<p>Tout comme les lobbies corporatifs, nous avons une base de données avec les contacts de nos élus et de leurs collaborateurs.<br>
......@@ -102,4 +97,3 @@
{% endif %}
</section>
{% comment %} SiB route 1-3 'representatives-all' content /// END {% endcomment %}
\ No newline at end of file
{% extends "base.html" %}
{% load staticfiles %}
{% block auth-top %}
{% endblock %}
{% block content %}
{% endblock %}
{% block auth-bottom %}
{% endblock %}
......@@ -9,7 +9,6 @@ urlpatterns = [
# Cheating paths:
url(r'^join_actiongroup/(?P<pk>\d+)/', views.join_actiongroup, name='join_actiongroup'),
url(r'^quit_actiongroup/(?P<pk>\d+)/', views.quit_actiongroup, name='quit_actiongroup'),
url(r'wazza/', views.wazza, name='wazza'),
# API:
url(r'^api/users/', LDPViewSet.urls(
......
......@@ -50,11 +50,3 @@ def quit_actiongroup(request, pk):
pass
return HttpResponse('')
def wazza(request):
context = {}
# actiongroup = ActionGroup.objects.get(pk=pk)
groups = request.user.actiongroup_set.all()
print("HELLO")
print(groups)
print([g.pk for g in groups])
return HttpResponse('')
\ No newline at end of file
......@@ -7,20 +7,14 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.2.0/webcomponents-loader.js" integrity="sha256-fUVqCtpScUF69qkFkeuHmcShr2N2UleRQJhRG4etHds=" crossorigin="anonymous"></script><link rel="import" href="https://cdn.happy-dev.fr/sib-core/sib-display.html" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.2.0/webcomponents-loader.js" integrity="sha256-fUVqCtpScUF69qkFkeuHmcShr2N2UleRQJhRG4etHds=" crossorigin="anonymous"></script><link rel="import" href="https://cdn.happy-dev.fr/sib-core/sib-display.html" />
<link rel="import" href="https://cdn.happy-dev.fr/sib-router/sib-router.html" />
<link href="{% static 'main.css' %}" rel="stylesheet">
<link href="{% static 'css/main.css' %}" rel="stylesheet">
<meta name="robots" content="noindex,nofollow" />
</head>
<body>
{% block auth-top %}
{% endblock %}
{% block content %}
{% endblock %}
{% block auth-bottom %}
{% endblock %}
{% block custom-js %}
{% endblock %}
......
......@@ -746,6 +746,9 @@ input[type="submit"]:active,
CONVERSATION
====================
*/
/* sib-route[name="create-thread"] {
display: none !important;
} */
.sib-conversation {
clear: both;
display: flex;
......
......@@ -151,6 +151,54 @@ class U4EFormAutoCompletion extends SIBMultipleWidget {
customElements.define('u4e-form-auto-completion', U4EFormAutoCompletion);
// Widget for Representatives input in ActionGroup Form:
class U4EFormAutoCompletion extends SIBMultipleWidget {
constructor() {
super();
this.list = [];
}
async renderList() {
const select = document.createElement('select');
select.multiple = true;
const options = this.list.map(value => {
const option = document.createElement('option');
option.value = value['@id'];
option.textContent = value.name + " " + value.lastname;
return option;
});
this.values.forEach(value => {
const option = options.find(option => {
const ret = option.value === value['@id'];
return ret;
});
if (option) option.selected = true;
});
options.forEach(option => select.appendChild(option));
this.parent.appendChild(select);
if (window.Choices) {
new window.Choices(select, { removeItemButton: true });
}
}
}
customElements.define('u4e-form-auto-completion', U4EFormAutoCompletion);
// Widget for Representative title:
class U4EDisplayRepTitle extends SIBWidget {
get template() {
......
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