* started workin on 'navbar' module

* changed bootstrap theme to bootswatch/Simplex

* big work on navbar logic

* starting creating menus using navbar

* converted app views to new Wepage decorator, updated navbar

* reimplemented DernieresMaraudes as a dropdown instead of ContextMixin

* reorganised static files, minor code cleanups

* turned Link.href into lazy-evaluated property

* collapsed 'navbar' module into 'website', dynamic building of ApplicationMenu subclasses

* minor cleanup

* blah blah blah

* added way to add admin/non-admin links

* minor style change : red border for active page instead of all dropdowns

* deleted file

* prepare adding removing menu templates files, being replaced by code

* essayé de généraliser le code pour les modaux bootstrap, non testé git status

* more preparation and thinking on navbar app_menus logic...

* added LinkManager and DropdownManager, getting closer...

* small fix in DropdownManager.__get__

* boosted up work: keep it simple so it can be merged fast, major layout changes

* added month filter on maraudes:liste

* added 'as_icon' filter to display boolean/null values as bootstrap icons

* remove inactive user from planning selection

* removed all unused 'menu' templates

* set up django_select2 to use static files

* small fix after review
This commit is contained in:
artus40
2017-02-11 18:20:13 +01:00
committed by GitHub
parent 288ca2cc20
commit 0be59a61a7
61 changed files with 665 additions and 525 deletions

View File

@@ -7,15 +7,7 @@ from .forms import *
from notes.mixins import NoteFormMixin
from notes.forms import AutoNoteForm
# Create your views here.
from utilisateurs.models import Maraudeur
from website import decorators as website
suivi = website.app_config(
name="suivi",
groups=[Maraudeur],
menu=["suivi/menu/sujets.html"],
admin_menu=["suivi/menu/admin_sujets.html"],
ajax=False,
)
from maraudes.compte_rendu import CompteRendu
@@ -30,12 +22,10 @@ def derniers_sujets_rencontres():
sujets.add(obs.sujet)
return sujets
@suivi
from .apps import suivi
@suivi.using(title=("Suivi", "Tableau de bord"))
class IndexView(NoteFormMixin, generic.TemplateView):
class PageInfo:
title = "Suivi des bénéficiaires"
header = "Suivi"
header_small = "Tableau de bord"
#NoteFormMixin
forms = {
'appel': AppelForm,
@@ -54,11 +44,10 @@ class IndexView(NoteFormMixin, generic.TemplateView):
context['derniers_sujets'] = ", ".join(map(str, derniers_sujets_rencontres()))
return context
@suivi
@suivi.using(title=('Liste des sujets',))
class SujetListView(generic.ListView):
class PageInfo:
title = "Sujet - Liste des sujets"
header = "Liste des sujets"
#ListView
model = Sujet
template_name = "sujets/sujet_liste.html"
@@ -77,15 +66,10 @@ class SujetListView(generic.ListView):
context['query_text'] = self.request.POST.get('q', None)
return context
# Import app_config from 'sujets' application, using
# its admin_menu option
from sujets.views import sujets
@sujets
@suivi.using(title=('{{sujet}}', 'suivi'))
class SuiviSujetView(NoteFormMixin, generic.DetailView):
class PageInfo:
title = "Sujet - {{sujet}}"
header = "{{sujet}}"
header_small = "suivi"
#NoteFormMixin
forms = {
'note': AutoNoteForm,