templates/vehicle_tabs.html.twig line 1
{% extends 'base.html.twig' %}
{% block stylesheets %}
{{ parent() }}
<style>
.backVehicles {
color: #fff;
background-color: #34495e;
border-color: #34495e;
}
</style>
{% endblock %}
{% block body %}
{# decide how to get the current vehicleId, directly from request or with the help of the vehicle_helper #}
{% if app.request.get('vehicleId') is not null %}
{% set current_vehicle_id = app.request.get('vehicleId') %}
{% else %}
{% set current_vehicle_id = vehicle_helper.getVehicleId() %}
{% endif %}
{#{% if app.request.get('companyId') is not null %}
{% set current_company_id = app.request.get('companyId') %}
{% else %}
{% set current_company_id = vehicle_helper.getCompanyId() %}
{% endif %}#}
{% set route = app.request.get('_route') %}
<section class="section-padding">
<!-- Main Container -->
{#<div class="{% if (route == 'revokerequests_index') or (route == 'vehicledocs_edit') %} container2 {% else %} container {% endif %}">#}
<div class="{% if (route == 'revokerequests_index') %} container2 {% else %} container {% endif %}">
<!-- Row -->
<div class="row">
{% block sidebar %}{% endblock %}
{#{% if route == 'vehicledocs_edit' %}
<div class="col-md-7">
{% else %}
<div class="col-md-12">
{% endif %}#}
<div class="col-md-12">
<div class="panel-body">
{% if current_vehicle_id is not null %}
<div class="visible-xs " style="overflow: auto;">
{% set vehiclePlates = vehicle_helper.getVehiclePlates(current_vehicle_id) %}
<div class="disabled lic_num">
{{ vehiclePlates[0] }}
</div>
<div class="disabled lic_num" style="background: #178b5e; direction: ltr;" >
{{ vehiclePlates[1] }}
</div>
<div class="disabled lic_num" >
{{ vehicle_helper.getVehicleNumber(current_vehicle_id) }}
</div>
</div>
{% endif %}
<div>
<ul id="vehicle_tabs" class="nav nav-tabs nav-justified">
{% if is_granted('ROLE_SUPER_ADMIN') == true or is_granted('ROLE_ADMIN') == true %}
<li class="tabs0">
<a href="{% if current_vehicle_id is not null %}{{ path('vehicles_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Vehicle Registration" | trans({}, "vehicles") }}
</a>
</li>
<li class="tabs1">
<a href="{% if current_vehicle_id is not null %}{{ path('vehiclebeneficiarydetails_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Beneficiary" | trans({}, "vehicles") }}
</a>
</li>
<li class="tabs2">
<a href="{% if current_vehicle_id is not null %}{{ path('vehicledocs_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Documents" | trans({}, "vehicles") }}
</a>
</li>
<li class="tabs3">
<a href="{% if current_vehicle_id is not null %}{{ path('revokerequests_index', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Transportation" | trans({}, "vehicles") }}
</a>
</li>
<li class="tabs4">
<a href="{% if current_vehicle_id is not null %}{{ path('vehiclesales_index', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Sales Data"|trans( {}, "vehicles" ) }}
</a>
</li>
<li class="tabs6">
<a href="{% if current_vehicle_id is not null %}{{ path('vehicletechnicalspecs_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Vehicle technical specs" | trans({}, "vehicles") }}
</a>
</li>
<li class="tabs7">
<a href="{% if current_vehicle_id is not null %}{{ path('vehiclertsactivitiesinvoices_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
{{ 'Invoices' | trans({}, 'vehicles') }}
</a>
</li>
<li class="tabs8">
<a href="{% if current_vehicle_id is not null %}{{ path('vehicletrafficviolations_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
{{ 'trafficViolations' | trans({}, 'vehicles') }}
</a>
</li>
{% if is_granted('ROLE_ADMIN') == true %}
<li class="tabs10">
<a href="{% if current_vehicle_id is not null %}{{ path('vehicle_repairs_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
{{ 'Repair' | trans({}, 'vehicles') }}
</a>
</li>
{% endif %}
{% if is_granted('ROLE_ADMIN') == true %}
<li class="tabs9">
<a href="{% if current_vehicle_id is not null %}{{ path('vehicle_settings_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
{{ 'vehicle settings' | trans({}, 'vehicles') }}
</a>
</li>
{% endif %}
{% elseif is_granted('ROLE_BENEFICIARY_REP') == true %}
<li class="tabs0">
<a href="{% if current_vehicle_id is not null %}{{ path('vehicles_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Vehicle Registration" | trans({}, "vehicles") }}
</a>
</li>
<li class="tabs2">
<a href="{% if current_vehicle_id is not null %}{{ path('vehicledocs_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Documents" | trans({}, "vehicles") }}
</a>
</li>
<li class="tabs3">
<a href="{% if current_vehicle_id is not null %}{{ path('revokerequests_index', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Transportation" | trans({}, "vehicles") }}
</a>
</li>
<li class="tabs4">
<a href="{% if current_vehicle_id is not null %}{{ path('vehiclesales_index', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
{{ "Sales Data"|trans( {}, "vehicles" ) }}
</a>
</li>
<li class="tabs7">
<a href="{% if current_vehicle_id is not null %}{{ path('vehiclertsactivitiesinvoices_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
{{ 'Invoices' | trans({}, 'vehicles') }}
</a>
</li>
{% endif %}
{% if current_vehicle_id is not null %}
<div class="hidden-xs">
{% set vehiclePlates = vehicle_helper.getVehiclePlates(current_vehicle_id) %}
{% set vehicleStates = vehicle_helper.getVehicleStates(current_vehicle_id) %}
{% set actualVehicleStates = vehicle_helper.vehicleActualState(current_vehicle_id) %}
<div class="disabled lic_num">
{{ vehiclePlates[0] }}
</div>
<div class="disabled lic_num" style="background: #178b5e; direction: ltr;" >
{{ vehiclePlates[1] }}
</div>
<div class="disabled lic_num" >
{{ vehicle_helper.getVehicleNumber(current_vehicle_id) }}
</div>
<div class="disabled lic_num" style="background: #178b5e; direction: rtl;" >
{% for statePiece in actualVehicleStates %}
{% for key in statePiece|keys %}
{{ key |trans({}, 'vehicles') }} -
{% endfor %}
{% endfor %}
</div>
</div>
{% endif %}
</ul>
<div id="tabs-0" class="">
{% block tabs0_body %}{% endblock %}
</div>
<div id="tabs-1" class="">
{% block tabs1_body %}{% endblock %}
</div>
<div id="tabs-2" class="">
{% block tabs2_body %}{% endblock %}
</div>
<div id="tabs-3" class="">
{% block tabs3_body %}{% endblock %}
</div>
<div id="tabs-4" class="">
{% block tabs4_body %}{% endblock %}
</div>
<div id="tabs-5" class="">
{% block tabs5_body %}{% endblock %}
</div>
<div id="tabs-6" class="">
{% block tabs6_body %}{% endblock %}
</div>
<div id="tabs-7" class="">
{% block tabs7_body %}{% endblock %}
</div>
<div id="tabs-8" class="">
{% block tabs8_body %}{% endblock %}
</div>
<div id="tabs-9" class="">
{% block tabs9_body %}{% endblock %}
</div>
</div>
</div>
<div class="text-center">
{% if is_granted('ROLE_ADMIN') == true %}
<a href="{{ path('vehicles_index') }}" class="btn btn-primary backVehicles" style="">{{ "Back to vehicles list" | trans }}</a>
{% elseif is_granted('ROLE_BENEFICIARY_REP') == true %}
<a href="{{ path('client_vehicles_list', {'clientId': app.user.company.companyId}) }}" class="btn btn-success" style="">{{ "Back to vehicles list" | trans }}</a>
{% else %}
<a href="{{ path('vehicles_index') }}" class="btn btn-primary backVehicles" style="">{{ "Back to vehicles list" | trans }}</a>
{% endif %}
</div>
</div>
{% block leftSidebar %}{% endblock %}
</div>
<!-- Row End -->
</div>
<!-- Main Container End -->
</section>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script>
$(function () {
/* var alert = $(".alert").length;
if(alert > 0){
setTimeout(function () {
$(".alert").fadeOut('slow','swing');
$(".alert").remove();
}, 5000)
}*/
});
</script>
{% endblock %}