Commit 2ec9730b authored by Alexandre's avatar Alexandre

feature: home page revamped, ready for integration

parent 519bf7f9
......@@ -7,9 +7,11 @@ Lobby.tool is an open-source tool designed to empower citizens to give them the
python3 -m venv env # optional venv
. env/bin/activate # optional venv
pip3 install -r requirements.txt
cd data_manager
cp settings_sample.py settings.py
cd ..
python3 manage.py migrate
python manage.py import_elected
python3 manage.py import_elected
python3 manage.py runserver
......
from djangoldp.permissions import AnonymousReadOnly
from django.db.models.base import ModelBase
class ThreadPermission(AnonymousReadOnly):
......@@ -9,7 +10,14 @@ class ThreadPermission(AnonymousReadOnly):
return request.user in obj.members.all()
return super().has_object_permission(request, view, obj)
def user_permissions(self, user, obj):
#def user_permissions(self, user, obj):
#if user in obj.actiongroup_set.get().members.all():
return ['view','add']
#return ['view','add']
#return super().user_permissions(user, obj)
def user_permissions(self, user, obj_or_model):
if isinstance(obj_or_model, ModelBase):
return ['view', 'add']
elif user in obj_or_model.actiongroup_set.get().members.all():
return ['view', 'add']
return super().user_permissions(user, obj_or_model)
......@@ -25,10 +25,11 @@
<div class="actiongroup-date-objectives">
<div>
<strong>Résumé des objectifs :</strong>
<sib-display
bind-resources
data-fields="objective"
label-objective="Résumé des objectifs :"
widget-objective="sib-display-labelled-div"
></sib-display>
</div>
<div>
......
{% load staticfiles %}
<div id="home" hidden>
<div id="sitetitle">
<h1><span class="green-text">United4</span>Earth</h1>
<p id="baseline">Unissons-nous pour <span class="green-text">agir</span></p>
<div>
<h1>Unissons nous pour agir !</h1>
</div>
<h2>Groupes d'action</h2>
<p>Bienvenue dans l'outil de Lobbying Citoyen. Découvrez les différents groupes d'action et rejoignez les initiatives qui vous plaisent !<br>
De là vous pourrez agir collectivement pour amener le changement. ;-)</p>
<section id="action-groups-list-home" class="action-groups">
<sib-link class="see-all"
next="agir"
>► Voir tous les&nbsp;groupes
<section>
<div>
<sib-link next="agir">
<h2>Groupes d'action</h2>
<p>Découvrez les différents groupes d'action et rejoignez les initiatives qui vous plaisent !<p>
</sib-link>
<sib-display
data-src="{{ domain }}/api/action-groups/"
value-voir="voir"
data-fields="name, image, voir"
widget-image="sib-display-img"
next="action-group-detail"
>
</sib-display>
<sib-link class="see-all-mobile"
next="agir"
>► Voir tous les groupes
</sib-link>
</section>
<h2>Nos élus - Base de données collective</h2>
<p>Tout comme les lobbies corporatifs, nous avons une base de données avec les contacts de nos élus et de leurs collaborateurs.<br>
Gérée et améliorée de manière collaborative, elle nous permet de mener à bien les actions du collectif.</p>
<section id="representatives-home" class="representatives-list">
<sib-link class="see-all"
next="nos-elus"
>► Voir tous les&nbsp;élus
data-src="{{ domain }}/api/action-groups/"
data-fields="image, kind, name, description, see-more"
value-see-more="voir plus"
widget-image="sib-display-img"
next="action-group-detail"
></sib-display>
</div>
<div>
<sib-link next="nos-elus">
<h2>Contacts récents</h2>
<p>Nous avons une base de données avec les contacts de nos élus et de leurs collaborateurs.<p>
</sib-link>
<sib-display
data-src="{{ domain }}/api/representatives/"
data-fields="firstname, lastname, photo, job"
set-job="title, election_department"
data-fields="photo, election_region, name, job, verify"
set-name="firstname, lastname"
set-job="title, political_party"
value-verify="Vérifier l'info"
widget-photo="sib-display-img"
next="representative-detail"
>
</sib-display>
<sib-link class="see-all-mobile"
next="nos-elus"
>► Voir tous les élus
</sib-link>
></sib-display>
</div>
</section>
<sib-calendar2
data-src="{{ domain }}/api/action-groups/5/"
>
</sib-calendar2>
</div>
......@@ -10,7 +10,7 @@
<script type="module" src="https://unpkg.com/@startinblox/core@0.6"></script>
<!--<script type="module" src="http://127.0.0.1/sib-core/src/index.js"></script>-->
<script type="module" src="https://unpkg.com/@startinblox/router@0.6"></script>
<!--<script type="module" src="https://unpkg.com/@startinblox/component-conversation@0.1.5"></script>-->
<script type="module" src="https://unpkg.com/@startinblox/component-conversation@0.1.5"></script>
<script src="https://code.jquery.com/jquery-1.7.2.min.js" integrity="sha256-R7aNzoy2gFrVs+pNJ6+SokH04ppcEqJ0yFLkNGoFALQ=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.js"></script>
<link href="{% static 'css/main.css' %}" rel="stylesheet">
......
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