Project

General

Profile

Download (961 Bytes) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / views.py @ e01a19ba

1
# -*- coding: utf-8 -*-
2

    
3
from django.shortcuts import render
4
from django.template.defaultfilters import slugify
5

    
6
SERVICES = ( u'CMPP', u'CAMSP', u'SESSAD TED', u'SESSAD DYS' )
7

    
8
SERVICES_MAP = dict(((slugify(s), s) for s in SERVICES))
9

    
10
APPLICATIONS = (
11
        (u'Gestion des dossiers', 'dossiers'),
12
        (u'Agenda', 'agenda'),
13
        (u'Saisie des actes', 'actes'),
14
        (u'Facturation et décompte', 'facturation'),
15
        (u'Gestion des personnes', 'personnes'),
16
        (u'Gestion des ressources', 'ressources'),
17
)
18

    
19
def homepage(request, service, services=SERVICES, applications=APPLICATIONS,
20
        template_name='calebasse/homepage.html'):
21
    services = [ (s, slugify(s)) for s in services]
22
    services_map = dict(((b, a) for a, b in services ))
23
    return render(request, template_name, {
24
        'applications': applications,
25
        'services': services,
26
        'service': service,
27
        'service_name': services_map.get(service),
28
    })
29

    
(9-9/10)