Files
schedule/src/schedule-2.0/templates/base.html.twig

570 lines
20 KiB
Twig
Raw Normal View History

2020-05-11 15:53:07 +02:00
<!DOCTYPE html>
<html>
{% set color = app.session.get('color') %}
<head>
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />
<title>{% block title %}{{ appName }}{% endblock %}</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
{% block head_style %}
{{ encore_entry_link_tags('app') }}
{% endblock head_style %}
{% block stylesheets %}{% endblock %}
<link rel="shortcut icon" href="/{{ appAlias }}/images/logo.png" />
</head>
<style>
/* global */
h1{
padding: 40px 0px 9px 0px;
border-bottom: 1px solid #eee;
}
.nav a{
background: none;
color: #CFD8DC;
font-size: 14px;
padding: 5px 0px 5px 25px;
display: block;
}
/* Sidebar Styles */
.contentsidebar {
margin-left:250px;
}
#sidebar {
z-index: 1000;
position: fixed;
left: 250px;
width: 250px;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #37474F;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#sidebar header {
background-color: #263238;
font-size: 20px;
line-height: 52px;
text-align: center;
}
#sidebar header a {
color: #fff;
display: block;
text-decoration: none;
}
#sidebar header a:hover {
color: #fff;
}
#sidebar .nav{
display: block;
}
#sidebar .nav a {
padding: 0px 10px 5px 10px;
}
#sidebar .nav .last{
border-bottom: 5px solid #455A64;
padding-bottom:5px;
}
#sidebar .title {
color: #CFD8DC;
font-size: 16px;
padding: 0px 10px 0px 10px;
display: block;
text-transform: uppercase;
margin-left: 0px !important;
font-weight: bold;
}
#sidebar .nav .last{
border-bottom: 5px solid #455A64;
padding-bottom:5px;
}
#sidebar .nav a:hover{
background: none;
color: #ECEFF1;
}
#sidebar .nav a .fa{
margin-right: 5px;
}
#sidebar .nav .select-control {
padding: 0px 10px 5px 10px;
margin-top: -12px;
}
.avatar {
background-color: #343a40;
width: 35px;
height: 35px;
border-radius: 100%;
margin-top: -5px;
}
.avatar.big{
width: 90px;
height: 90px;
margin-bottom: 10px;
}
@media (max-width: 991px) {
.contentsidebar {
margin-left: auto;
}
#sidebar {
position: static;
margin:0px -15px;
width: auto;
}
}
a.btn {
color:#ffffff;
}
@media (min-width: 992px) {
#sidebar {
display: block;
}
}
{% if useheader is defined and useheader %}
#main {
padding-top:55px;
}
{% endif %}
th.dt-center, td.dt-center { text-align: center; }
.new-page {display:none;}
{% if fgprint is defined and fgprint %}
.no-print {display:none}
.new-page {
clear: both;
display: block;
border :1px solid transparent;
page-break-after: always;
}
#sidebar,.navbar,.sf-toolbar {
display: none;
}
#mycontent{
margin:0px;
//width:800px;
}
#main{
margin:0px;
padding:10px;
}
.homecard {
display:inline-block;
float:none;
}
{% endif %}
{% block localstyle %}
{% endblock %}
</style>
<body>
{% if useheader is defined and useheader %}
<nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="{{ path('app_home')}}">
<img src="/{{appAlias}}/images/logo.png" style="height:30px;margin-top:-3px;">
{{appName}}
</a>
{% if usesidebar is defined and usesidebar %}
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#sidebar" aria-controls="sidebar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
{% endif %}
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
</ul>
</div>
<ul class="nav navbar-top-links navbar-right">
2021-02-04 16:13:35 +01:00
{% if app.user and ("ROLE_USER" in app.user.roles or "ROLE_MASTER" in app.user.roles or "ROLE_VALIDATOR" in app.user.roles or "ROLE_ADMIN" in app.user.roles)%}
2020-05-11 15:53:07 +02:00
<li>
<a href="{{path("app_user_profil")}}">
<img src="\{{appAlias}}\uploads\avatar\{{app.user.avatar}}" class="avatar">
</a>
</li>
{% endif %}
{% set routeignore = ["app_home","app_event","app_customer_submit","app_project_submit","app_offer_submit","app_task_submit","app_service_submit","app_user_submit","app_nature_submit","app_nature_update","app_job_submit","app_breakday_submit","app_breakday_update"] %}
{% if app.request.attributes.get('_route') not in routeignore %}
<li>
<a onClick="myprint()" style="cursor:pointer"><i class="fa fa-print fa-fw"></i></a>
</li>
{%endif%}
<li>
{% if app.user %}
{% if appAuth=="MYSQL" %}
<a href="{{path("app_logout")}}"><i class="fa fa-sign-out-alt fa-fw"></i></a>
{% elseif appAuth=="CAS" %}
<a href="{{path("app_logoutcas")}}"><i class="fa fa-sign-out-alt fa-fw"></i></a>
{% endif %}
{% else %}
{% if appAuth=="MYSQL" %}
<a href="{{path("app_login")}}"><i class="fa fa-sign-in-alt fa-fw"></i></a>
{% elseif appAuth=="CAS" %}
<a href="{{path("app_logincas")}}"><i class="fa fa-sign-in-alt fa-fw"></i></a>
{% endif %}
{% endif %}
</li>
</ul>
</nav>
{% endif %}
<main id="main" class="container-fluid">
{% set contentsidebar="" %}
{% if usesidebar is defined and usesidebar %}
{% set contentsidebar="contentsidebar" %}
<div id="sidebar" class="collapse">
2020-07-30 09:04:28 +02:00
<ul style="padding-bottom:70px" class="nav">
2020-05-11 15:53:07 +02:00
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_VALIDATOR') or is_granted('ROLE_MASTER') or is_granted('ROLE_USER') %}
<p></p>
<li>
<a>
<label class="control-label">
Nombre de Mois
</label>
</a>
<div class="select-control">
<select class="form-control select2entity" id="sidemonth" name="sidemonth">
{% set selected="" %}
{% for i in 1..48 %}
{% set selected="" %}
{%if i==app.session.get('nbmonth') %}
{% set selected="selected" %}
{% endif %}
<option value="{{i}}" {{selected}}>{{i}}</option>
{% endfor %}
</select>
</div>
<a>
<label class="control-label">
Service
</label>
</a>
<div class="select-control">
<select class="form-control select2entity" id="sideservice" name="sideservice">
2020-10-06 15:56:01 +02:00
<option value="all" selected>Tous les services</option>
{% for service in app.session.get('services') %}
{% set selected="" %}
{%if service.id==app.session.get('idservice') %}
{% set selected="selected" %}
{% endif %}
<option value="{{service.id}}" {{selected}}>{{service.name}}</option>
{% endfor %}
</select>
</div>
2020-05-11 15:53:07 +02:00
<a>
<label class="control-label">
Intervenant
</label>
</a>
<div class="select-control">
2020-09-01 11:45:41 +02:00
<select class="form-control select2entity" id="sideuser" name="sideuser">
<option value="all" selected>Tout le monde</option>
2020-05-11 15:53:07 +02:00
{% for user in app.session.get('users') %}
{% set selected="" %}
2020-09-01 11:45:41 +02:00
{%if user.id==app.session.get('iduser') %}
{% set selected="selected" %}
2020-05-11 15:53:07 +02:00
{% endif %}
<option value="{{user.id}}" {{selected}}>{{user.displayname}}</option>
{% endfor %}
</select>
</div>
<a>
<label class="control-label">
Projet
</label>
</a>
<div class="select-control">
<select class="form-control select2entity" id="sideproject" name="sideproject">
2020-10-06 15:56:01 +02:00
<option value="all" selected>Tous les projets</option>
2020-05-11 15:53:07 +02:00
{% for project in app.session.get('projects') %}
{% set selected="" %}
{%if project.id==app.session.get('idproject') %}
{% set selected="selected" %}
{% endif %}
<option value="{{project.id}}" {{selected}}>{{project.displayname}}</option>
{% endfor %}
</select>
</div>
2020-05-11 15:53:07 +02:00
</li>
<li class="last"></li>
<li class="title">Planning</li>
<li>
<a href="{{path("app_synthese")}}">
<i class="fa fa-id-card"></i>Synthese
</a>
</li>
<li>
<a href="{{path("app_planning")}}">
<i class="fa fa-tachometer-alt"></i>Planning
</a>
</li>
<li>
<a href="{{path("app_report")}}">
<i class="fa fa-pen-square"></i>Rapport
</a>
</li>
<li>
<a href="{{path("app_event")}}">
<i class="fa fa-calendar-alt"></i>Calendrier
</a>
</li>
2020-07-01 15:54:52 +02:00
<li>
<a href="{{path("app_timer")}}">
<i class="fa fa-stopwatch"></i>Suivi Horaire
</a>
</li>
<li>
2020-05-11 15:53:07 +02:00
<a href="{{path("app_holiday")}}">
<i class="fa fa-umbrella-beach"></i>Mes Congés
2020-05-11 15:53:07 +02:00
</a>
</li>
2020-10-14 12:01:28 +02:00
<li>
<a href="{{path("app_stat_view")}}">
<i class="fas fa-chart-line"></i>Statistiques
</a>
</li>
<li class="last">
<a href="{{path("app_export_view")}}">
<i class="fa fa-file-download"></i>Exports
</a>
</li>
2020-05-11 15:53:07 +02:00
{% endif %}
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_VALIDATOR') %}
<li class="title">Validations</li>
<li>
<a href="{{path("app_validation")}}">
<i class="fa fa-user-check"></i>Validation Calendrier
2020-05-11 15:53:07 +02:00
</a>
</li>
<li>
2020-05-11 15:53:07 +02:00
<a href="{{path("app_validationholiday")}}">
<i class="fa fa-user-tag"></i>Validation Congés
</a>
</li>
<li class="last">
<a href="{{path("app_validationtimer")}}">
<i class="fa fa-user-clock"></i>Validation Horaires
2020-05-11 15:53:07 +02:00
</a>
</li>
2020-05-11 15:53:07 +02:00
{% endif %}
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MASTER') %}
<li class="title">Projets</li>
<li>
<a href="{{path("app_customer")}}">
<i class="fa fa-user"></i>Clients
</a>
</li>
<li>
<a href="{{path("app_project")}}">
<i class="fa fa-suitcase"></i>Projets
</a>
</li>
<li>
<a href="{{path("app_offer")}}">
2020-06-16 11:26:03 +02:00
<i class="fa fa-euro-sign"></i>Commandes
2020-05-11 15:53:07 +02:00
</a>
</li>
<li class="last">
<a href="{{path("app_task")}}">
<i class="fa fa-tasks"></i>Tâches
</a>
</li>
{% endif %}
{% if is_granted('ROLE_ADMIN') %}
<li class="title">Organisation</li>
<li>
<a href="{{path("app_service")}}">
<i class="fa fa-building"></i>Services
</a>
</li>
<li>
<a href="{{path("app_user")}}">
<i class="fa fa-users"></i>Utilisateurs
</a>
</li>
<li>
<a href="{{path("app_nature")}}">
<i class="fa fa-folder"></i>Natures
</a>
</li>
<li>
<a href="{{path("app_job")}}">
<i class="fa fa-clipboard-list"></i>Métiers
</a>
</li>
<li class="last">
<a href="{{path("app_breakday")}}">
<i class="fa fa-gifts"></i>Jours Fériés
</a>
</li>
{% endif %}
</ul>
</div>
{%endif%}
<div id="mycontent" class="content {{contentsidebar}}">
{% block body %}
{% endblock %}
</div>
</main>
{{ encore_entry_script_tags('app') }}
{% block localexternalscript %}
{% endblock %}
<script>
$(document).ready(function() {
var doit = true;
$("a[data-method]").on('click',function(){
if($(this).data('confirm')){
doit = confirm($(this).data('confirm'));
if(!doit) return false;
}
});
});
$('#sidemonth').on('select2:select', function (e) {
var data = e.params.data;
console.log(data.id);
$.ajax({
type: "POST",
data: {
nbmonth: data.id,
},
url: "{{ path('app_home_selectmonth') }}",
success: function (response) {
location.reload();
}
});
});
$('#sideuser').on('select2:select', function (e) {
var data = e.params.data;
$.ajax({
type: "POST",
data: {
iduser: data.id,
},
url: "{{ path('app_home_selectuser') }}",
success: function (response) {
location.reload();
}
});
});
$('#sideproject').on('select2:select', function (e) {
var data = e.params.data;
$.ajax({
type: "POST",
data: {
idproject: data.id,
},
url: "{{ path('app_home_selectproject') }}",
success: function (response) {
location.reload();
}
});
});
$('#sideservice').on('select2:select', function (e) {
var data = e.params.data;
$.ajax({
type: "POST",
data: {
idservice: data.id,
},
url: "{{ path('app_home_selectservice') }}",
success: function (response) {
location.reload();
}
});
});
</script>
<script>
{% block localjavascript %}
{% endblock %}
</script>
</body>
</html>