Merge branch 'masse-salariale' into dev
[auf_rh_dae.git] / project / settings.py
1 # -*- encoding: utf-8 -*-
2
3 import os
4 import socket
5 from project.conf import * # NOQA
6
7 PROJET_TITRE = "Ressources humaines"
8
9 # Rapports d'erreurs
10 SERVER_EMAIL = 'ne-pas-repondre@auf.org'
11 EMAIL_SUBJECT_PREFIX = '[auf_rh_dae - %s] ' % socket.gethostname()
12 ADMINS = (
13 ('Équipe ARI-SI', 'developpeurs@ca.auf.org'),
14 )
15
16 MANAGERS = ADMINS
17
18 TIME_ZONE = 'America/Montreal'
19 DATE_FORMAT = 'd-m-Y'
20 DATE_INPUT_FORMATS = (
21 '%d-%m-%Y', '%d/%m/%Y', '%d %m %Y',
22 )
23 SHORT_DATE_FORMAT = 'd-m-Y'
24
25 SESSION_SAVE_EVERY_REQUEST = True
26 SESSION_EXPIRE_AT_BROWSER_CLOSE = True
27
28 LANGUAGE_CODE = 'fr-ca'
29 USE_L10N = True
30 USE_THOUSAND_SEPARATOR = True
31
32 # Absolute path to the directory that holds media.
33 # Example: "/home/media/media.lawrence.com/"
34 MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media')
35 PRIVE_MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media_prive')
36
37 STATICFILES_DIRS = (
38 os.path.join(os.path.dirname(__file__), 'assets'),
39 )
40
41
42 STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static')
43 STATIC_URL = '/static/'
44
45 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
46 # trailing slash if there is a path component (optional in other cases).
47 # Examples: "http://media.lawrence.com", "http://example.com/media/"
48 MEDIA_URL = '/media/'
49 PRIVE_MEDIA_URL = '/prive/'
50 OE_PRIVE_MEDIA_URL = '/recrutement/prive/'
51
52 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
53 # trailing slash.
54 # Examples: "http://foo.com/media/", "/media/".
55 #ADMIN_MEDIA_PREFIX = '/media/django/'
56
57 # Don't share this with anybody.
58 SECRET_KEY = '^2w#%abp_d+e#(7f5w$leef50)c@4y38cnn#ccji@84$2^rt#l'
59
60 MIDDLEWARE_CLASSES = (
61 'django.middleware.common.CommonMiddleware',
62 'django.contrib.sessions.middleware.SessionMiddleware',
63 'django.contrib.messages.middleware.MessageMiddleware',
64 'django.contrib.auth.middleware.AuthenticationMiddleware',
65 'django.middleware.doc.XViewMiddleware',
66 'reversion.middleware.RevisionMiddleware',
67 )
68
69 ROOT_URLCONF = 'project.urls'
70
71 INSTALLED_APPS = (
72 'auf.django.skin',
73 'auf.django.references',
74 'auf.django.emploi',
75 'auf.django.admingroup',
76 'auf.django.workflow',
77 'auf.django.permissions',
78 'auf.django.emploi',
79 'admin_tools',
80 'admin_tools.theming',
81 'admin_tools.menu',
82 'admin_tools.dashboard',
83 'django.contrib.admin',
84 'django.contrib.auth',
85 'django.contrib.contenttypes',
86 'django.contrib.humanize',
87 'django.contrib.messages',
88 'django.contrib.sessions',
89 'django.contrib.staticfiles',
90 'django_qbe',
91 'ajax_select',
92 'south',
93 'reversion',
94 'alphafilter',
95 'form_utils',
96 'tinymce',
97 'captcha',
98 'project.rh',
99 'project.dae',
100 'project.recrutement',
101 )
102
103 TEMPLATE_CONTEXT_PROCESSORS = (
104 'django.contrib.auth.context_processors.auth',
105 'django.core.context_processors.debug',
106 'django.core.context_processors.i18n',
107 'django.core.context_processors.media',
108 'django.core.context_processors.static',
109 'django.contrib.messages.context_processors.messages',
110 'django.core.context_processors.request',
111 'auf.django.skin.context_processors.auf',
112 'project.dae.context_processors.user_in_dae_groupes',
113 )
114
115 AUTHENTICATION_BACKENDS = (
116 'auf.django.auth.backends.CascadeBackend',
117 'auf.django.permissions.backends.AuthenticationBackend',
118 )
119 LOGIN_URL = "/connexion"
120 LOGIN_REDIRECT_URL = "/"
121
122 TEMPLATE_DIRS = (
123 os.path.join(os.path.dirname(__file__), "templates"),
124 )
125
126
127 ADMIN_TOOLS_INDEX_DASHBOARD = 'project.dashboard.CustomIndexDashboard'
128 ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'project.dashboard.CustomAppIndexDashboard'
129 ADMIN_TOOLS_MENU = 'project.menu.CustomMenu'
130
131 AJAX_LOOKUP_CHANNELS = {
132 'responsables': ('project.dae.catalogues', 'Responsable'),
133 'dossiers': ('project.dae.catalogues', 'Dossier'),
134 'dae_postes': ('project.dae.catalogues', 'Poste'),
135 'pays': ('project.rh.catalogues', 'Pays'),
136 'implantations': ('project.rh.catalogues', 'Implantation'),
137 'typepostes': ('project.rh.catalogues', 'TypePoste'),
138 'postes': ('project.rh.catalogues', 'Poste'),
139 'valeurpoints': ('project.rh.catalogues', 'ValeurPoint'),
140 'employes': ('project.rh.catalogues', 'Employe'),
141 'dossiers': ('project.rh.catalogues', 'Dossier'),
142 }
143 AJAX_SELECT_INLINES = 'inline'
144
145
146 TINYMCE_DEFAULT_CONFIG = {
147 'theme': "advanced",
148 'plugins': "paste",
149 'theme_advanced_buttons1': (
150 "bold,italic,underline,|,formatselect,|,bullist,numlist,|,undo,redo,|,"
151 "link,unlink"
152 ),
153 'theme_advanced_buttons2': "",
154 'theme_advanced_buttons3': "",
155 'theme_advanced_statusbar_location': "bottom",
156 'theme_advanced_toolbar_align': "left",
157 'theme_advanced_styles': "Titre=titre;Sous-titre=sous-titre;Normal=normal",
158 'width': "800",
159 'height': "200",
160 'theme_advanced_resizing': "true",
161 'custom_undo_redo_levels': 10,
162 'theme_advanced_toolbar_location': 'top',
163 'inline_styles': 'false',
164 'paste_use_dialog': 'false',
165 'paste_auto_cleanup_on_paste': 'true',
166 'paste_convert_headers_to_strong': 'false',
167 'paste_strip_class_attributes': 'all',
168 'paste_remove_spans': 'true',
169 'paste_remove_styles': 'true',
170 'content_css': '/media/css/tinymce.css',
171 }
172
173 # django-sendfile
174 SENDFILE_BACKEND = 'sendfile.backends.simple'
175
176 QBE_DISPLAY_DATABASES = False
177
178 # Il est *très* important de respecter la case.
179 QBE_CUSTOM_MODELS = {'Rh': {
180 'Employe': {},
181 'Poste': {},
182 'Dossier': {},
183 'Remuneration': {},
184 'Contrat': {},
185 }}
186
187 QBE_ALLOWED_FIELDS = {'Rh': {
188 'Employe': [
189 'nom', 'prenom', 'genre', 'date_naissance', 'situation_familiale',
190 'date_entree'
191 ],
192 'Poste': ['nom', 'date_debut', 'date_fin'],
193 'Dossier': [
194 'statut_residence', 'regime_travail',
195 'regime_travail_nb_heure_semaine', 'date_debut', 'date_fin'
196 ],
197 'Remuneration': ['montant', 'date_debut', 'date_fin'],
198 'Contrat': ['date_debut', 'date_fin'],
199 }}