templates/vehicle_tabs.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block stylesheets %}
  3.     {{ parent() }}
  4.     <style>
  5.         .backVehicles {
  6.             color: #fff;
  7.             background-color: #34495e;
  8.             border-color: #34495e;
  9.         }
  10.     </style>
  11. {% endblock %}
  12. {% block body %}
  13.     {# decide how to get the current vehicleId, directly from request or with the help of the vehicle_helper #}
  14.     {% if app.request.get('vehicleId') is not null %}
  15.         {% set current_vehicle_id = app.request.get('vehicleId') %}
  16.     {% else %}
  17.         {% set current_vehicle_id = vehicle_helper.getVehicleId() %}
  18.     {% endif %}
  19.     {#{% if app.request.get('companyId') is not null %}
  20.         {% set current_company_id = app.request.get('companyId') %}
  21.     {% else %}
  22.         {% set current_company_id = vehicle_helper.getCompanyId() %}
  23.     {% endif %}#}
  24.     {% set route = app.request.get('_route') %}
  25.     <section class="section-padding">
  26.         <!-- Main Container -->
  27.         {#<div class="{% if (route == 'revokerequests_index') or (route == 'vehicledocs_edit') %} container2  {% else %}  container {% endif %}">#}
  28.         <div class="{% if (route == 'revokerequests_index') %} container2  {% else %}  container {% endif %}">
  29.             <!-- Row -->
  30.             <div class="row">
  31.                 {% block sidebar %}{% endblock %}
  32.                 {#{% if route == 'vehicledocs_edit' %}
  33.                     <div class="col-md-7">
  34.                 {% else %}
  35.                     <div class="col-md-12">
  36.                 {% endif %}#}
  37.                 <div class="col-md-12">
  38.                     <div class="panel-body">
  39.                         {% if current_vehicle_id is not null %}
  40.                             <div class="visible-xs " style="overflow: auto;">
  41.                                 {% set vehiclePlates = vehicle_helper.getVehiclePlates(current_vehicle_id) %}
  42.                                 <div class="disabled lic_num">
  43.                                     {{ vehiclePlates[0] }}
  44.                                 </div>
  45.                                 <div class="disabled lic_num" style="background: #178b5e; direction: ltr;" >
  46.                                     {{ vehiclePlates[1] }}
  47.                                 </div>
  48.                                 <div class="disabled lic_num" >
  49.                                     {{ vehicle_helper.getVehicleNumber(current_vehicle_id) }}
  50.                                 </div>
  51.                             </div>
  52.                         {% endif %}
  53.                         <div>
  54.                             <ul id="vehicle_tabs" class="nav nav-tabs nav-justified">
  55.                                 {% if is_granted('ROLE_SUPER_ADMIN') == true or is_granted('ROLE_ADMIN') == true %}
  56.                                 <li class="tabs0">
  57.                                     <a href="{% if current_vehicle_id is not null %}{{ path('vehicles_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  58.                                         {{ "Vehicle Registration" | trans({}, "vehicles") }}
  59.                                     </a>
  60.                                 </li>
  61.                                 <li class="tabs1">
  62.                                     <a href="{% if current_vehicle_id is not null %}{{ path('vehiclebeneficiarydetails_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  63.                                         {{ "Beneficiary" | trans({}, "vehicles") }}
  64.                                     </a>
  65.                                 </li>
  66.                                 <li class="tabs2">
  67.                                     <a href="{% if current_vehicle_id is not null %}{{ path('vehicledocs_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  68.                                         {{ "Documents" | trans({}, "vehicles") }}
  69.                                     </a>
  70.                                 </li>
  71.                                 <li class="tabs3">
  72.                                     <a href="{% if current_vehicle_id is not null %}{{ path('revokerequests_index', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  73.                                         {{ "Transportation" | trans({}, "vehicles") }}
  74.                                     </a>
  75.                                 </li>
  76.                                 <li class="tabs4">
  77.                                     <a href="{% if current_vehicle_id is not null %}{{ path('vehiclesales_index', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  78.                                         {{ "Sales Data"|trans( {}, "vehicles" ) }}
  79.                                     </a>
  80.                                 </li>
  81.                                 <li class="tabs6">
  82.                                     <a href="{% if current_vehicle_id is not null %}{{ path('vehicletechnicalspecs_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  83.                                         {{ "Vehicle technical specs" | trans({}, "vehicles") }}
  84.                                     </a>
  85.                                 </li>
  86.                                 <li class="tabs7">
  87.                                     <a href="{% if current_vehicle_id is not null %}{{ path('vehiclertsactivitiesinvoices_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
  88.                                         {{ 'Invoices' | trans({}, 'vehicles') }}
  89.                                     </a>
  90.                                 </li>
  91.                                 <li class="tabs8">
  92.                                     <a href="{% if current_vehicle_id is not null %}{{ path('vehicletrafficviolations_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
  93.                                         {{ 'trafficViolations' | trans({}, 'vehicles') }}
  94.                                     </a>
  95.                                 </li>
  96.                                     {% if is_granted('ROLE_ADMIN') == true %}
  97.                                         <li class="tabs10">
  98.                                             <a href="{% if current_vehicle_id is not null %}{{ path('vehicle_repairs_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
  99.                                                 {{ 'Repair' | trans({}, 'vehicles') }}
  100.                                             </a>
  101.                                         </li>
  102.                                     {% endif %}
  103.                                     {% if is_granted('ROLE_ADMIN') == true %}
  104.                                         <li class="tabs9">
  105.                                             <a href="{% if current_vehicle_id is not null %}{{ path('vehicle_settings_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
  106.                                                 {{ 'vehicle settings' | trans({}, 'vehicles') }}
  107.                                             </a>
  108.                                         </li>
  109.                                     {% endif %}
  110.                                 {% elseif is_granted('ROLE_BENEFICIARY_REP') == true %}
  111.                                     <li class="tabs0">
  112.                                         <a href="{% if current_vehicle_id is not null %}{{ path('vehicles_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  113.                                             {{ "Vehicle Registration" | trans({}, "vehicles") }}
  114.                                         </a>
  115.                                     </li>
  116.                                     <li class="tabs2">
  117.                                         <a href="{% if current_vehicle_id is not null %}{{ path('vehicledocs_edit', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  118.                                             {{ "Documents" | trans({}, "vehicles") }}
  119.                                         </a>
  120.                                     </li>
  121.                                     <li class="tabs3">
  122.                                         <a href="{% if current_vehicle_id is not null %}{{ path('revokerequests_index', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  123.                                             {{ "Transportation" | trans({}, "vehicles") }}
  124.                                         </a>
  125.                                     </li>
  126.                                     <li class="tabs4">
  127.                                         <a href="{% if current_vehicle_id is not null %}{{ path('vehiclesales_index', { 'vehicleId': current_vehicle_id }) }}{% else %}#{% endif %}">
  128.                                             {{ "Sales Data"|trans( {}, "vehicles" ) }}
  129.                                         </a>
  130.                                     </li>
  131.                                     <li class="tabs7">
  132.                                         <a href="{% if current_vehicle_id is not null %}{{ path('vehiclertsactivitiesinvoices_index', {'vehicleId': current_vehicle_id}) }}{% else %}#{% endif %}">
  133.                                             {{ 'Invoices' | trans({}, 'vehicles') }}
  134.                                         </a>
  135.                                     </li>
  136.                                 {% endif %}
  137.                                 {% if current_vehicle_id is not null %}
  138.                                     <div class="hidden-xs">
  139.                                         {% set vehiclePlates = vehicle_helper.getVehiclePlates(current_vehicle_id) %}
  140.                                         {% set vehicleStates = vehicle_helper.getVehicleStates(current_vehicle_id) %}
  141.                                         {% set actualVehicleStates = vehicle_helper.vehicleActualState(current_vehicle_id) %}
  142.                                         <div class="disabled lic_num">
  143.                                             {{ vehiclePlates[0] }}
  144.                                         </div>
  145.                                         <div class="disabled lic_num" style="background: #178b5e; direction: ltr;" >
  146.                                             {{ vehiclePlates[1] }}
  147.                                         </div>
  148.                                         <div class="disabled lic_num" >
  149.                                             {{ vehicle_helper.getVehicleNumber(current_vehicle_id) }}
  150.                                         </div>
  151.                                         <div class="disabled lic_num" style="background: #178b5e; direction: rtl;" >
  152.                                             {% for statePiece in actualVehicleStates %}
  153.                                                 {% for key in statePiece|keys %}
  154.                                                     {{ key |trans({}, 'vehicles') }} -
  155.                                                 {% endfor %}
  156.                                             {% endfor %}
  157.                                         </div>
  158.                                     </div>
  159.                                 {% endif %}
  160.                             </ul>
  161.                             <div id="tabs-0" class="">
  162.                                 {% block tabs0_body %}{% endblock %}
  163.                             </div>
  164.                             <div id="tabs-1" class="">
  165.                                 {% block tabs1_body %}{% endblock %}
  166.                             </div>
  167.                             <div id="tabs-2" class="">
  168.                                 {% block tabs2_body %}{% endblock %}
  169.                             </div>
  170.                             <div id="tabs-3" class="">
  171.                                 {% block tabs3_body %}{% endblock %}
  172.                             </div>
  173.                             <div id="tabs-4" class="">
  174.                                 {% block tabs4_body %}{% endblock %}
  175.                             </div>
  176.                             <div id="tabs-5" class="">
  177.                                 {% block tabs5_body %}{% endblock %}
  178.                             </div>
  179.                             <div id="tabs-6" class="">
  180.                                 {% block tabs6_body %}{% endblock %}
  181.                             </div>
  182.                             <div id="tabs-7" class="">
  183.                                 {% block tabs7_body %}{% endblock %}
  184.                             </div>
  185.                             <div id="tabs-8" class="">
  186.                                 {% block tabs8_body %}{% endblock %}
  187.                             </div>
  188.                             <div id="tabs-9" class="">
  189.                                 {% block tabs9_body %}{% endblock %}
  190.                             </div>
  191.                         </div>
  192.                     </div>
  193.                     <div class="text-center">
  194.                         {% if is_granted('ROLE_ADMIN') == true %}
  195.                             <a href="{{ path('vehicles_index') }}" class="btn btn-primary backVehicles" style="">{{ "Back to vehicles list" | trans }}</a>
  196.                         {% elseif is_granted('ROLE_BENEFICIARY_REP') == true %}
  197.                             <a href="{{ path('client_vehicles_list', {'clientId': app.user.company.companyId}) }}" class="btn btn-success" style="">{{ "Back to vehicles list" | trans }}</a>
  198.                         {% else %}
  199.                             <a href="{{ path('vehicles_index') }}" class="btn btn-primary backVehicles" style="">{{ "Back to vehicles list" | trans }}</a>
  200.                         {% endif %}
  201.                     </div>
  202.                 </div>
  203.                 {% block leftSidebar %}{% endblock %}
  204.             </div>
  205.             <!-- Row End -->
  206.         </div>
  207.         <!-- Main Container End -->
  208.     </section>
  209. {% endblock %}
  210. {% block javascripts %}
  211.     {{ parent() }}
  212.     <script>
  213.         $(function () {
  214.            /* var alert = $(".alert").length;
  215.             if(alert > 0){
  216.                 setTimeout(function () {
  217.                     $(".alert").fadeOut('slow','swing');
  218.                     $(".alert").remove();
  219.                 }, 5000)
  220.             }*/
  221.         });
  222.     </script>
  223. {% endblock %}