Escolar Documentos
Profissional Documentos
Cultura Documentos
et usermanagement:
- python manage.py makemigrations
- python manage.py migrate
******...\elink\elink\templates\index.html
- ligne 4:
<!-- 19-07-2017 Intgration de nouveau filtre dans le template -->
{% load app_filters %}
<!-- --------------------------------------------------------- -->
- lignes 10 19:
<!-- 22-07-2017 Ajout de styles pour la prsentation -->
<style type="text/css">
.evaluate-relation-container{
background: white;
z-index: 500;
}
.table {
width: 600px;
margin: auto;
}
</style>
<!-- ----------------------------------------------- -->
- lignes 43 57:
<!-- 22-07-2017 Affichage des valuations de mise en relation pour nombres
etoiles suprieurs 4 -->
<table class="table">
<tbody>
{% for mission in liste_mission %}
<tr>
<td>Mission : {{ mission.id }}</td>
<td style="width: 20px">
<div id="note_misenrela" class="evaluate-
relation-container">
<div data-name="mise_en" data-average="{{
mission.note_misenrela|str_strip }}" class="scoring-div-relation scoring-div
jDisabled" readonly></div>
</div>
</td>
<td>{{ mission.note_commentaire }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<!--
-----------------------------------------------------------------------------------
--------- -->
- lignes 393 412:
<!-- 22-07-2017 Script d'affichage pour les toiles d'valuation -->
<script type="text/javascript">
$(document).ready(function(){
$('.scoring-div-relation').jRating({
type:"star", // "small" pour avoir une toile plus petite
length: 5, // nombre d'toile
rateMax: 5, // valeur max du rating
decimalLength: 1, // nombre de chiffre aprs virgule, supprimer si
entier
phpPath: "http://google.fr", // action ajax, url relative
sendRequest: false,
canRateAgain: true,
nbRates : 50,
/**
paramtres envoys:
rate: valeur rating;
besoin_id: id de l'lment mettre jour
action=rating (probablement inutile)
*/
});
});
</script>
<!-- ------------------------------------------------------------ -->
******...\elink\elink\templates\needs\besoin_user_list.html
- ligne 4:
<!-- 19-07-2017 Intgration de nouveau filtre dans le template -->
{% load app_filters %}
<!-- --------------------------------------------------------- -->
- ligne 132:
<!-- 19-07-2017 Modification de la valeur average en format texte standard
-->
<div data-name="mise_en" data-average=" {{ besoin.note_misenrela|str_strip }}
" class="scoring-div-relation scoring-div jDisabled" data-id="{{ besoin.id }}"
readonly></div>
<!-- ---------------------------------------------------------------------
-->
- ligne 143:
<!-- 22-07-2017 Modification du champ statut_presta en statut_eval_salarie
-->
{% if not besoin.statut_eval_salarie %}
- ligne 150:
<!-- 22-07-2017 Ajout du besoin.id-->
<div data-name="tech" style="float:right;" data-average="3" class="scoring-
div-prestataire-tech scoring-div" data-id="{{ besoin.mission_presta_id }}" data-
besoin="{{ besoin.id }}" ></div>
- ligne 155:
<!-- 22-07-2017 Ajout du besoin.id-->
<div data-name="orga" style="float:right;" data-average="3" class="scoring-
div-prestataire-orga scoring-div" data-id="{{ besoin.mission_presta_id }}" data-
besoin="{{ besoin.id }}" ></div>
- ligne 160:
<!-- 22-07-2017 Ajout du besoin.id-->
<div data-name="comp" style="float:right;" data-average="3" class="scoring-
div-prestataire-comp scoring-div" data-id="{{ besoin.mission_presta_id }}" data-
besoin="{{ besoin.id }}" ></div>
- ligne 165:
<!-- 22-07-2017 Ajout du besoin.id-->
<div data-name="comm" style="float:right;" data-average="3" class="scoring-
div-prestataire-comm scoring-div" data-id="{{ besoin.mission_presta_id }}" data-
besoin="{{ besoin.id }}" ></div>
-ligne 178:
<!-- 20-07-2017 Modification de la valeur average en format texte standard
pour affichage de l'valuation prestataire, ajout du besoin.id, et affichage des
nouveaux champs notes-->
<div data-name="tech" style="float:right;" data-
average="{{ besoin.note_tech_s|str_strip }}" class="scoring-div-prestataire-tech
scoring-div jDisabled" data-id="{{ besoin.mission_presta_id }}" data-
besoin="{{ besoin.id }}" ></div>
- ligne 183:
<!-- 20-07-2017 Modification de la valeur average en format texte standard
pour affichage de l'valuation prestataire, ajout du besoin.id et affichage des
nouveaux champs notes-->
<div data-name="orga" style="float:right;" data-
average="{{ besoin.note_orga_s|str_strip }}" class="scoring-div-prestataire-orga
scoring-div jDisabled" data-id="{{ besoin.mission_presta_id }}" data-
besoin="{{ besoin.id }}" ></div>
- ligne 188:
<!-- 20-07-2017 Modification de la valeur average en format texte standard
pour affichage de l'valuation prestataire, ajout du besoin.id et affichage des
nouveaux champs notes-->
<div data-name="comp" style="float:right;" data-
average="{{ besoin.note_compo_s|str_strip }}" class="scoring-div-prestataire-comp
scoring-div jDisabled" data-id="{{ besoin.mission_presta_id }}" data-
besoin="{{ besoin.id }}" ></div>
- ligne 193:
<!-- 20-07-2017 Modification de la valeur average en format texte standard
pour affichage de l'valuation prestataire, ajout du besoin.id et affichage des
nouveaux champs notes-->
<div data-name="comm" style="float:right;" data-
average="{{ besoin.note_commu_s|str_strip }}" class="scoring-div-prestataire-comm
scoring-div jDisabled" data-id="{{ besoin.mission_presta_id }}" data-
besoin="{{ besoin.id }}" ></div>
$(e.target).parents(".evaluate-prestataire-
container:first").parent().addClass('toChange');
$('.toChange').find(".jRatingAverage").each(function(i, e){
if($(e).parent().data("name")=="tech") {
if($(e).css('width')=="0px") {
$('.toDisplay .scoring-div-prestataire-tech
.jRatingColor').css('width',$(e).parent().find(".jRatingColor").css('width'));
} else {
$('.toDisplay .scoring-div-prestataire-tech
.jRatingColor').css('width',$(e).css('width'));
}
}
if($(e).parent().data("name")=="orga") {
if($(e).css('width')=="0px") {
$('.toDisplay .scoring-div-prestataire-orga
.jRatingColor').css('width',$(e).parent().find(".jRatingColor").css('width'));
} else {
$('.toDisplay .scoring-div-prestataire-orga
.jRatingColor').css('width',$(e).css('width'));
}
}
if($(e).parent().data("name")=="comp") {
if($(e).css('width')=="0px") {
$('.toDisplay .scoring-div-prestataire-comp
.jRatingColor').css('width',$(e).parent().find(".jRatingColor").css('width'));
} else {
$('.toDisplay .scoring-div-prestataire-comp
.jRatingColor').css('width',$(e).css('width'));
}
}
if($(e).parent().data("name")=="comm") {
if($(e).css('width')=="0px") {
$('.toDisplay .scoring-div-prestataire-comm
.jRatingColor').css('width',$(e).parent().find(".jRatingColor").css('width'));
} else {
$('.toDisplay .scoring-div-prestataire-comm
.jRatingColor').css('width',$(e).css('width'));
}
}
});
$.ajax({
url: '/user/noter-prestataire-' + besoin + '-' + besoin_id + '-' +
params["tech"] + '-' + params["orga"] + '-' + params["comp"] + '-' +
params["comm"],
type: 'POST',
data: {
csrfmiddlewaretoken: '{{ csrf_token }}',
},
success: function(response) {
//console.log(response.chaine);
var tab = response.chaine.split('-');
$('.toDisplay').find(".scoring-div").each(function(i, e){
if($(e).data("name")=="tech") $(e).attr("data-
average", tab[0]);
if($(e).data("name")=="orga") $(e).attr("data-
average", tab[1]);
if($(e).data("name")=="comp") $(e).attr("data-
average", tab[2]);
if($(e).data("name")=="comm") $(e).attr("data-
average", tab[3]);
});
$('.toChange').html($('.toDisplay').html());
}
});
//$('#note_salarie').hide();
});
//--------------------------------------------
******...\elink\elink\templatetags\app_filters.py
- lignes 2 10:
#19-07-2017 Ajout de filtre template
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter(name='str_strip')
@stringfilter
def str_strip(value):
return value.replace(" ","").strip()
#-----------------------------------
******...\elink\elink\views.py
- lignes 29 35:
#19-07-2017 Precision sur le type salarie
elif request.user.type_de_personne_id==18:
#service_list = request.user.type_de_service
#titre_en_haut = "Proposer un service"
#titre_h3 = "Vous proposer le service suivant: "
titre_h3 = "Mes missions"
#url_nom = "proposer"
liste_mission =
Besoin.objects.filter(mission_presta_id=request.user.id).order_by('created')
#-----------------------------------------
- ligne 39:
#22-07-2017 Ajout liste evaluation relation dans la page principale en non
connecte
liste_mission =
Besoin.objects.filter(note_misenrela__gt=4).order_by('created')
******...\elink\needs\urls.py
- lignes 27 30:
#19-07-2017 Modification parametre commentaire et ajout url ayant des cas
optionnels
url(r'^noter-mis-en-relation-(?P<pk>\d+)-(?P<note>\d+.\d+)-(?P<comment>.*)$',
views.scoring, name="scoring"),
url(r'^noter-mis-en-relation-(?P<pk>\d+)-(?P<note>\d+)-(?P<comment>.*)$',
views.scoring, name="scoring"),
url(r'^noter-mis-en-relation-(?P<pk>\d+)-(?P<note>\d+)$', views.scoring,
name="scoring"),
url(r'^noter-mis-en-relation-(?P<pk>\d+)-(?P<note>\d+.\d+)$', views.scoring,
name="scoring"),
#-------------------------------------------------
******...\elink\needs\views.py
- lignes 94 110:
#19-07-2017 Modification de l'argument comment en optionnel et gestion pour
dj value
@login_required
def scoring(request, pk, note,comment=""):
"""
Evaluation de la mise en relation
"""
besoin = Besoin.objects.get(id=pk)
chaine=[]
if request.POST:
besoin.note_misenrela = note
besoin.note_commentaire = comment
besoin.statut_eval = True
if comment!="":
besoin.statut_com = True
besoin.save()
chaine.append(str(note))
chaine.append(str(comment))
return JsonResponse({'chaine':chaine})
#return HttpResponseRedirect(reverse('besoin_user_list'))
#-----------------------------------------------------------
*****...\elink\usermanagement\urls.py
- lignes 43 et 44:
#19-07-2017 Modification url pour les cas de parametres optionnels et ajout
du parametre besoin sur les profils prestataire, client
url(r'^noter-prestataire-(?P<besoin>\d+)-(?P<mission>\d+)-(?P<note_tech>\d+
(\.\d{1}|))-(?P<note_orga>\d+(\.\d{1}|))-(?P<note_comp>\d+(\.\d{1}|))-(?
P<note_comm>\d+(\.\d{1}|))$', usermanagement_views.scoring_prestataire,
name="scoring_prestataire"),
url(r'^noter-client-(?P<besoin>\d+)-(?P<mission>\d+)-(?P<note_tech>\d+
(\.\d{1}|))-(?P<note_orga>\d+(\.\d{1}|))-(?P<note_comp>\d+(\.\d{1}|))-(?
P<note_comm>\d+(\.\d{1}|))$', usermanagement_views.scoring_client,
name="scoring_client"),
#----------------------------------------------------------------------------------
----------------------------
******...\elink\needs\models.py
- lignes 30 et 31:
#22-07-2017 Modification du champ statut_presta en statut_eval_salarie et ajout
statut_eval_client
statut_eval_client = models.BooleanField(verbose_name="Test evaluation client",
default=False)
statut_eval_salarie = models.BooleanField(verbose_name="Test evaluation
prestataire", default=False)
#----------------------------------------------------------------------------------
---------------
- lignes 57 60:
#22-07-2017 Ajouter les champs notes Client
note_tech_c = models.FloatField(default=None, verbose_name="Note
technique", null = True)
note_orga_c = models.FloatField(default = None, verbose_name="Note
organisation", null = True)
note_compo_c = models.FloatField(default = None, verbose_name="Note
comportement", null = True)
note_commu_c = models.FloatField(default = None, verbose_name="Note
communication", null = True)
#---------------------------------------------------
- lignes 63 66:
#22-07-2017 Ajouter les champs notes Salari
note_tech_s = models.FloatField(default=None, verbose_name="Note
technique", null = True)
note_orga_s = models.FloatField(default = None, verbose_name="Note
organisation", null = True)
note_compo_s = models.FloatField(default = None, verbose_name="Note
comportement", null = True)
note_commu_s = models.FloatField(default = None, verbose_name="Note
communication", null = True)
#---------------------------------------------------
******...\elink\usermanagement\models.py
- lignes 43 46:
#22-07-2017 Enlever les champs notes de UserProfile
# note_tech = models.FloatField(default=None, verbose_name="Note
technique", null = True)
# note_orga = models.FloatField(default = None, verbose_name="Note
organisation", null = True)
# note_compo = models.FloatField(default = None, verbose_name="Note
comportement", null = True)
# note_commu = models.FloatField(default = None, verbose_name="Note
communication", null = True)
#---------------------------------------------------
******...\elink\usermanagement\views.py
- ligne 11:
#22-07-2017 Ajout format de rponse json
from django.http import JsonResponse
chaine = note_tech+"-"+note_orga+"-"+note_comp+"-"+note_comm
return JsonResponse({'chaine':chaine})
#return render(request, 'needs/besoin_user_list.html')
#----------------------------------------------------------------------------------
------------
chaine = note_tech+"-"+note_orga+"-"+note_comp+"-"+note_comm
return JsonResponse({'chaine':chaine})
#return render(request, 'mission/proposition_user_list.html')
#----------------------------------------------------------------------------------
------------