From 6c995a34db2c8a8e557b17331441cd67c7851614 Mon Sep 17 00:00:00 2001 From: artus40 Date: Thu, 29 Dec 2016 13:52:29 +0100 Subject: [PATCH] resolved #21, started new design (removing some panels :) --- maraudes/forms.py | 6 +++++- .../templates/compte_rendu/compterendu.html | 21 +++++++++---------- maraudes/views.py | 2 +- notes/templates/notes/table_inline.html | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/maraudes/forms.py b/maraudes/forms.py index e2578b4..d2eb6d4 100644 --- a/maraudes/forms.py +++ b/maraudes/forms.py @@ -1,6 +1,8 @@ from django import forms from django.forms import inlineformset_factory from notes.forms import * +from django_select2.forms import Select2Widget + # Models from .models import * from .notes import * @@ -22,7 +24,9 @@ class RencontreForm(forms.ModelForm): class Meta: model = Rencontre fields = ['lieu', 'heure_debut', 'duree'] - + widgets = { + 'lieu': Select2Widget(), + } ObservationInlineFormSet = inlineformset_factory( Rencontre, Observation, diff --git a/maraudes/templates/compte_rendu/compterendu.html b/maraudes/templates/compte_rendu/compterendu.html index 219047b..04c3f03 100644 --- a/maraudes/templates/compte_rendu/compterendu.html +++ b/maraudes/templates/compte_rendu/compterendu.html @@ -1,16 +1,15 @@ {% load notes %} -
- -
-

{{ maraude.binome }} & {{ maraude.referent }} - Rencontres : {{ maraude.observation_count}}

-
- +

Compte-rendu

+ +
{% for note in notes %} {% inline_table note header="sujet" %} {% endfor %} -
- {% if user.is_superuser and maraude.est_terminee %}{%endif%} + + +
+

Informations

+

Rencontres : {{ maraude.observation_count}}

+ + diff --git a/maraudes/views.py b/maraudes/views.py index e77fe7b..a6d25c5 100644 --- a/maraudes/views.py +++ b/maraudes/views.py @@ -113,7 +113,7 @@ class MaraudeDetailsView(DerniereMaraudeMixin, generic.DetailView): class PageInfo: title = "Maraude - {{maraude.date}}" header = "{{maraude.date}}" - header_small = "compte-rendu" + header_small = "{{maraude.referent}} & {{maraude.binome}}" def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) diff --git a/notes/templates/notes/table_inline.html b/notes/templates/notes/table_inline.html index 5359d61..9b9ecbd 100644 --- a/notes/templates/notes/table_inline.html +++ b/notes/templates/notes/table_inline.html @@ -8,5 +8,5 @@ -

{{text}}

+

{{text}}