ninegate/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Projecttask/view.html.twig

169 lines
6.2 KiB
Twig

{% extends '@CadolesCore/base.html.twig' %}
{% block localstyle %}
.slider-volume {
width:100%
}
{% endblock %}
{% block appmenu %}
<ul class="nav navbar-top-links navbar-left">
<li id="menuproject-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer">
<a href="{{ path("cadoles_portal_user_project_view") }}">
Tout
</a>
</li>
{% for project in projects %}
<li id="menuproject-{{project.id}}" data-open="{% if project.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==project.id%}active{%endif%}" style="cursor:pointer">
<a href="{{ path("cadoles_portal_user_project_view",{'id':project.id}) }}">
{{ project.name }}
{% if project.canadd %}
<i class="fa fa-pencil"></i>
{% else %}
<i class="fa fa-lock"></i>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% endblock %}
{% block pagewrapper %}
{% if access=="config" %}
<div class="pagemenu">
<a href="{{ path('cadoles_portal_config_project_view', {id:entity.project.id})}}">{{ entity.project.name }}</a>
</div>
{% else %}
<br>
<ul class="nav navbar-default nav-pills">
<li id="menuproject-0" class="{% if entity.id is not defined %}active{%endif%}" style="cursor:pointer">
<a href="{{ path("cadoles_portal_user_project_view") }}">
Tout
</a>
</li>
{% for project in projects %}
<li id="menuproject-{{project.id}}" data-open="{% if project.canupdate %}true{%endif%}" class="{% if entity.id is defined and entity.id==project.id%}active{%endif%}" style="cursor:pointer">
<a href="{{ path("cadoles_portal_user_project_view",{'id':project.id}) }}">
{{ project.name }}
{% if project.canadd %}
<i class="fa fa-pencil"></i>
{% else %}
<i class="fa fa-lock"></i>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
<div class="projecttask">
<div class="row">
<div class="col col-md-9">
<div class="projecttitle">
<legend>
<h1 >{{entity.name}}</h1>
</legend>
{% if canadd %}
<br><a class="pull-right btn btn-primary" href="{{ path("cadoles_portal_"~access~"_projecttask_update",{'id':entity.id}) }}">Modifier</a>
{% endif %}
<small>Affectée à =
{% if entity.user is empty %}
{{ entity.owner.username }}
{% else %}
{{ entity.user.username }}
{%endif%}
<br>Crée le = {{ entity.submit|date("d/m/Y à H:i") }}
<br>Dans le projet = {{entity.project.name }}</small>
<br><small>Priorité = {{ entity.priority }}</small>
{% if entity.end %}
<br><small>A Réaliser avant le = {{ entity.end|date("d/m/Y") }}</small>
{%endif%}
{% if entity.projecttasktag %}
<br><small>Type = {{ entity.projecttasktag.name }}</small>
{% endif %}
{% if entity.projecttaskstatus %}
<br><small>Statut = {{ entity.projecttaskstatus.name }}</small>
{% endif %}
</div>
<div class="projectbody">
{{ entity.description | raw }}
</div>
</div>
<div class="col col-md-3" style="margin-top:20px; text-align:center">
Réalisé à<br>
<span id="percentage" style="font-size:60px">{{ entity.percentage}}</span><small>%</small>
{% if canadd %}
<br>
<div id="slider"></div>
{% endif %}
<div data-toggle="modal" data-target="#mymodal" onclick="ModalLoad('mymodal','Fichiers','/ninegate/user/config/file/upload/projecttask-{{entity.id}}');" title="Ajouter des fichiers" class="grid-item-content" style="cursor:pointer;margin-top:20px;">
<img class="grid-item-img imageshadow" height="60" src="/ninegate/uploads/icon/icon_add.png">
<br>Ajouter un fichier
</div>
</div>
</div>
</div>
{% endblock %}
{% block localjavascript %}
var idproject;
$('document').ready(function(){
{% if canadd %}
$( "#slider" ).slider({
min: 0,
max: 100,
step: 10,
value: {{ entity.percentage }}
});
{% endif %}
{% if entity.id is defined %}
{% for project in projects %}
{% if project.id==entity.project.id %}
showProject({{ project.id }}, {{ project.canupdate }});
{% endif %}
{% endfor %}
{% else %}
showProject(0, {{ canupdate }});
{% endif %}
});
{% if canadd %}
$( "#slider" ).on( "slidestop", function( event, ui ) {
$.ajax({
method: "POST",
url: "{{ path('cadoles_portal_'~access~'_projecttask_percentage',{'id':entity.id}) }}",
data: {
percentage:ui.value,
},
success: function() {
$("#percentage").html(ui.value);
}
});
} );
{% endif %}
// Affichages des projects
function showProject(id,canupdate) {
// Rendre actif le page en cours dans le menu
$(".navbar-top-links li").removeClass("active");
$(".nav-pills li").removeClass("active");
$("#menuproject-"+id).addClass("active");
}
{% endblock %}