From c9122f1d8c1e6622388d41d1c96559c97935309e Mon Sep 17 00:00:00 2001 From: davin baragiotta Date: Fri, 5 Aug 2011 17:51:03 -0400 Subject: [PATCH] accueil et mon profil --- project/media/css/sgrh.css | 25 +++--- project/rh/templates/rh/perso.html | 98 ------------------------ project/rh/templates/rh/profil.html | 143 +++++++++++++++++++++++++++++++++++ project/rh/urls.py | 2 +- project/rh/views.py | 27 ++++--- project/templates/accueil.html | 85 +++++++++++++++++++++ project/templates/actions.html | 3 +- project/templates/index.html | 48 ------------ project/templates/menu.html | 18 ++--- project/urls.py | 2 +- project/views.py | 14 +++- 11 files changed, 284 insertions(+), 181 deletions(-) delete mode 100644 project/rh/templates/rh/perso.html create mode 100644 project/rh/templates/rh/profil.html create mode 100644 project/templates/accueil.html delete mode 100644 project/templates/index.html diff --git a/project/media/css/sgrh.css b/project/media/css/sgrh.css index d499539..230748e 100644 --- a/project/media/css/sgrh.css +++ b/project/media/css/sgrh.css @@ -1,13 +1,16 @@ .clear { clear:both; } -.gauche { float:left; } -.gauche25 { float:left; width:25%; } -.gauche33 { float:left; width:33%; } -.gauche40 { float:left; width:40%; } -.gauche50 { float:left; width:50%; } -.gauche60 { float:left; width:60%; } +.gauche { float:left; padding-right:2%; } +.gauche25 { float:left; width:23%; padding-right:2%; } +.gauche33 { float:left; width:31%; padding-right:2%; } +.gauche40 { float:left; width:38%; padding-right:2%; } +.gauche50 { float:left; width:48%; padding-right:2%; } +.gauche60 { float:left; width:58%; padding-right:2%; } .droite { float:right; } -.droite25 { float:right; width:25%; } -.droite33 { float:right; width:33%; } -.droite40 { float:right; width:40%; } -.droite50 { float:right; width:50%; } -.droite60 { float:right; width:60%; } +.droite25 { float:right; width:23%; padding-left:2%; } +.droite33 { float:right; width:31%; padding-left:2%; } +.droite40 { float:right; width:38%; padding-left:2%; } +.droite50 { float:right; width:48%; padding-left:2%; } +.droite60 { float:right; width:58%; padding-left:2%; } + +#menu li a.disabled { color:#BBD8EC } +#menu li a.disabled:hover { color:#BBD8EC } diff --git a/project/rh/templates/rh/perso.html b/project/rh/templates/rh/perso.html deleted file mode 100644 index c4c5432..0000000 --- a/project/rh/templates/rh/perso.html +++ /dev/null @@ -1,98 +0,0 @@ -{% extends 'sgrh.html' %} - -{% block title %}RH - {{ employe }}{% endblock %} -{% block sous_titre %}Espace personnel{% endblock %} - -{% block main %} -

{{ employe.civilite }} {{ employe }}

- -
-

{{ employe.dossier.poste }}

-
- -
-

Informations professionnelles AUF

- - - - - - - -
Date d'entrée :{{ employe.date_entree }}
- -
-
-

Informations personnelles

- - - {% comment %} - - - - - {% endcomment %} - - - - - - - - - - - - - -
Nom d'affichage :{{ employe.nom_affichage }}
Date de naissance :{{ employe.date_naissance }}
Nationalité :{{ employe.nationalite }}
Situation familiale :{{ employe.situation_familiale }}
- -
- -
-

Coordonnées professionnelles AUF

- {{ employe.courriel }} -
-
-

Coordonnées personnelles

- - - - - - - - - - - - - - - -
Téléphone domicile :{{ employe.tel_domicile }}
Téléphone cellulaire :{{ employe.tel_cellulaire }}
Adresse complète : - {{ employe.adresse }}
- {% if employe.ville or employe.province %} - {{ employe.ville }} - {% if employe.ville and employe.province %}, {% endif %} - {{ employe.province }} -
- {% endif %} - {% if employe.code_postal %} - {{ employe.code_postal }}
- {% endif %} - {{ employe.pays.nom }} -
-
- -
-

Dossiers

- - -
-{% endblock %} - diff --git a/project/rh/templates/rh/profil.html b/project/rh/templates/rh/profil.html new file mode 100644 index 0000000..cb32106 --- /dev/null +++ b/project/rh/templates/rh/profil.html @@ -0,0 +1,143 @@ +{% extends 'sgrh.html' %} + +{% block title %}RH - {{ employe }}{% endblock %} +{% block sous_titre %}Mon profil RH{% endblock %} + +{% block main %} +

{{ employe.civilite }} {{ employe }}

+ +
+
+{% for d in dossiers_encours %} +

+ {{ d.poste.nom }} +

+

+ {{ d.poste.service|default_if_none:"Service inconnu" }}
+ {{ d.poste.implantation.nom }}
+ {{ d.poste.implantation.adresse_physique_ville }} +

+{% endfor %} +
+
+ Photo +
+
+
+ +
+

Informations professionnelles AUF

+ + + + + + + +
Date d'entrée :{{ employe.date_entree }}
+ +
+
+

Informations personnelles

+ + + {% comment %} + + + + + {% endcomment %} + + + + + + + + + + + + + +
Nom d'affichage :{{ employe.nom_affichage }}
Date de naissance :{{ employe.date_naissance }}
Nationalité :{{ employe.nationalite }}
Situation familiale :{{ employe.situation_familiale }}
+ +
+ +
+

Coordonnées professionnelles AUF

+ + + + + + + + + + + + + + + + + + + + + + + + +
Courriel :{{ employe.courriel }}
Téléphone IP :{{ employe.champ }}
Téléphone :{{ employe.champ }}
Télécopie :{{ employe.champ }}
Adresse postale : +
+
+
+

Coordonnées personnelles

+ + + + + + + + + + + + + + + +
Téléphone domicile :{{ employe.tel_domicile }}
Téléphone cellulaire :{{ employe.tel_cellulaire }}
Adresse complète : + {{ employe.adresse }}
+ {% if employe.ville or employe.province %} + {{ employe.ville }} + {% if employe.ville and employe.province %}, {% endif %} + {{ employe.province }} +
+ {% endif %} + {% if employe.code_postal %} + {{ employe.code_postal }}
+ {% endif %} + {{ employe.pays.nom }} +
+
+ +
+

Dossiers

+ + +
+{% endblock %} + diff --git a/project/rh/urls.py b/project/rh/urls.py index 76f1b89..3d13bb4 100644 --- a/project/rh/urls.py +++ b/project/rh/urls.py @@ -4,6 +4,6 @@ from django.conf.urls.defaults import patterns, url urlpatterns = patterns( 'project.rh.views', url(r'^employes/$', 'employes_liste', name='rh_employes'), - url(r'^employes/(?P\d+)/perso$', 'perso', name='rh_perso'), + url(r'^profil$', 'profil', name='rh_profil'), url(r'^employes/(?P\d+)$', 'employe', name='rh_employe'), ) diff --git a/project/rh/views.py b/project/rh/views.py index 6bd0eb9..c5cce58 100644 --- a/project/rh/views.py +++ b/project/rh/views.py @@ -1,25 +1,32 @@ # -*- encoding: utf-8 -*- +from datetime import date from django.contrib.auth.decorators import login_required from django.shortcuts import redirect, render_to_response, get_object_or_404 from django.template import RequestContext from datamaster_modeles import models as ref -from project.decorators import user_is_this_employe from project.lib import get_employe_from_id from rh import models as rh # homes -@user_is_this_employe -def perso(request, id): - """Espace personnel de l'employé.""" - employe = get_employe_from_id(id) +@login_required +def profil(request): + """Profil personnel de l'employé - éditable""" + rc = RequestContext(request) + c = {} - c = { - 'user':request.user, - 'employe':employe, - } - return render_to_response('rh/perso.html', c, RequestContext(request)) + employe = rc['this_employe'] + + # dossiers en cours + today = date.today() + dossiers_encours = employe.dossiers.all().exclude(date_debut__gt=today) \ + .exclude(date_fin__lt=today) + + c['user'] = request.user + c['employe'] = employe + c['dossiers_encours'] = dossiers_encours + return render_to_response('rh/profil.html', c, rc) # employes @login_required diff --git a/project/templates/accueil.html b/project/templates/accueil.html new file mode 100644 index 0000000..add2cad --- /dev/null +++ b/project/templates/accueil.html @@ -0,0 +1,85 @@ +{% extends 'sgrh.html' %} + +{% block title %}RH{% endblock %} +{% block sous_titre %}Accueil{% endblock %} + +{% block main %} +

{{ this_employe }}

+ +

+L'ensemble des applications RH sera regroupé dans ce système de gestion des ressources humaines (SGRH). +

+

+Voici pour chaque module les actions que vous pouvez faire. +

+ +
+
+ {% if user_in_dae_groupes %} +

Demande d'autorisation d'engagement (DAE)

+

+ Voici vos actions possibles : +

+

+ En développement... accédez directement au module DAE. +

+ {% else %} +

Demande d'autorisation d'engagement (DAE)

+

+ Vous n'avez pas accès au module DAE. +

+ {% endif %} +
+ +
+ {% if user_in_recrutement_groupes %} +

Recrutement

+

+ Voici vos actions possibles : +

+

+ En développement... accédez directement au module Recrutement. +

+ {% else %} +

Recrutement

+

+ Vous n'avez pas accès au module Recrutement. +

+ {% endif %} +
+ +
+

Contrats

+

+ Le module Contrats n'est pas encore intégré à ce système.
+ Le système de gestion de contrats est encore accessible à son ancien emplacement :
+ http://contrats.auf/ +

+
+ +
+

Évaluations

+

+ Le module Évaluations n'est pas encore intégré à ce système.
+ Le système d'évaluation est encore accessible à son ancien emplacement :
+ http://rh-evaluation.auf +

+
+
+
+

Employés

+ +
+

Dix employés au hasard...

+ {% for e in employes %} + + {% endfor %} +
+
+ Recherche rapide : +
+
+ +{% endblock %} diff --git a/project/templates/actions.html b/project/templates/actions.html index 6efaf46..4e57578 100644 --- a/project/templates/actions.html +++ b/project/templates/actions.html @@ -1,10 +1,11 @@
    {% if user.is_authenticated %} {% if this_employe %} -
  • {{ this_employe }}
  • +
  • {{ this_employe }}
  • {% else %}
  • {{ user }}
  • {% endif %} +
  • Mon profil RH
  • {% if user_is_admin or user_in_dae_groupes or user_in_recrutement_groupes %}
  • Administration
  • {% endif %} diff --git a/project/templates/index.html b/project/templates/index.html deleted file mode 100644 index e2fa48d..0000000 --- a/project/templates/index.html +++ /dev/null @@ -1,48 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}RH{% endblock %} -{% block sous_titre %}Accueil{% endblock %} - -{% block main %} -

    Ressources humaines

    - -

    -L'ensemble des applications RH sera regroupé dans ce système de gestion des ressources humaines (SGRH). -

    -

    -Voici les applications actuellement disponibles : -

    - -

    -L'accès aux applications est géré par des permissions d'accès. -

    - -

    Vos permissions d'accès

    - -{% if user.groups.all %} -

    Vous faites partie des groupes suivants :

    -
      - {% for g in request.user.groups.all %} -
    • {{ g.name }}
    • - {% endfor %} -
    -{% else %} - Vous n'avez aucune permission d'accès particulière. -{% endif %} -{% endblock %} diff --git a/project/templates/menu.html b/project/templates/menu.html index 0dd8848..ccb73f3 100644 --- a/project/templates/menu.html +++ b/project/templates/menu.html @@ -1,13 +1,8 @@ {% load auf_menu dae %} + {% else %} + {% endif %} {% if user_in_recrutement_groupes %} - + + {% else %} + {% endif %} + + + {% endif %}
diff --git a/project/urls.py b/project/urls.py index 43b6bb6..c0438ad 100644 --- a/project/urls.py +++ b/project/urls.py @@ -11,7 +11,7 @@ handler500 # Pyflakes urlpatterns = patterns( '', # système - url(r'^$', 'project.views.index', name='accueil'), + url(r'^$', 'project.views.accueil', name='accueil'), (r'^admin/', include(admin.site.urls)), url(r'^api/(?P[a-z_-]+)/$', 'recrutement.api.api', diff --git a/project/views.py b/project/views.py index b14a92b..5bff05e 100644 --- a/project/views.py +++ b/project/views.py @@ -3,9 +3,19 @@ from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.template import RequestContext +import rh.models as rh + @login_required -def index(request): - return render_to_response('index.html', {}, RequestContext(request)) +def accueil(request): + """Accueil = Tableau de bord de l'utilisateur""" + rc = RequestContext(request) + c = {} + + # TODO : debug + employes = rh.Employe.objects.filter(actif=True).exclude(supprime=True).order_by('?') + + c['employes'] = employes[0:10] + return render_to_response('acceuil.html', c, rc) def erreur404(request) : c = { -- 1.7.10.4