templates/base.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <!-- saved from url=(0014)about:internet -->
  3. <html lang="en">
  4.     <head>
  5.         <meta charset="utf-8">
  6.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.         <meta name="viewport" content="width=device-width, initial-scale=1">
  8.         <meta name="description" content="">
  9.         <meta name="author" content="">
  10.         <link rel='icon' href={{asset('dist/img/favicon.ico')}} type='image/x-icon'/>
  11.         <title>CSWeb</title>
  12.         <!-- DataTables CSS -->
  13.         <link href={{asset('bower_components/datatables/dataTables.bootstrap4.min.css')}} rel="stylesheet">
  14.         <!-- Custom CSS -->
  15.         <link href={{asset('dist/css/sb-admin-2.css')}} rel="stylesheet">
  16.         <!-- Custom Fonts -->
  17.         <link href={{asset('bower_components/fontawesome-free/css/all.min.css')}} rel="stylesheet" type="text/css">
  18.         <!-- ALW - Custom CSS -->
  19.         <link href={{asset('dist/css/cspro-styles.css')}} rel="stylesheet">
  20.         {% block resources %} {% endblock %}
  21.     </head>
  22.     <body>
  23.         <div id="wrapper">
  24.             <ul class="navbar-nav navbar-cspro sidebar sidebar-dark accordion" id="side-menu">
  25.                 <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
  26.                     <i class="fas fa-bars"></i>
  27.                 </button>
  28.                 <a class="sidebar-brand d-flex align-items-center justify-content-center navbar-cspro" href="{{ path('dashboard') }}">
  29.                     <img src={{asset('dist/img/logo_silver.png')}} class="icon" >
  30.                     <p class="navbar navbar-version">CSWeb {{ csproVersion }}</p>
  31.                 </a>
  32.                 <!-- Divider -->
  33.                 <hr class="sidebar-divider my-0">
  34.                 <!-- /.navbar-header -->
  35.                 {% if is_granted('ROLE_DATA_ALL') == true %}
  36.                     <li id="data-nav-item" class="nav-item">
  37.                         <a class="nav-link" href="{{ path('dashboard') }}">
  38.                             <i class="fas fa-fw fa-database"></i>
  39.                             <span>Data</span></a>
  40.                     </li>
  41.                 {% endif %}
  42.                 {% block nav %}
  43.                     {% if is_granted('ROLE_REPORTS_ALL') == true %}
  44.                         <li id="sync-report-nav-item" class="nav-item">
  45.                             <a class="nav-link collapsed" href="{{ path('sync-report') }}" 
  46.                                data-toggle="collapse" onclick={window.location.href="{{ path('sync-report') }}";}>
  47.                                 <i class="fas fa-fw fa-table"></i>
  48.                                 <span>Sync Report</span>
  49.                             </a>
  50.                         </li>
  51.                         <li id="map-report-nav-item" class="nav-item">
  52.                             <a class="nav-link collapsed" href="{{ path('map-report') }}" data-toggle="collapse" onclick={window.location.href="{{ path('map-report') }}";}>
  53.                                 <i class="fas fa-fw fa-table"></i>
  54.                                 <span>Map Report</span>
  55.                             </a>
  56.                         </li>
  57.                     {% endif %}
  58.                 {% endblock %}
  59.                 {# nav #}
  60.                 {% if is_granted('ROLE_APPS_ALL') == true %}
  61.                     <li id="apps-nav-item" class="nav-item">
  62.                         <a class="nav-link" href="{{ path('apps') }}">
  63.                             <i class="fas fa-fw fa-desktop"></i>
  64.                             <span>Apps</span></a>
  65.                     </li>
  66.                     <li id="files-nav-item" class="nav-item">
  67.                         <a class="nav-link" href="{{ path('files') }}">
  68.                             <i class="fas fa-fw fa-file"></i>
  69.                             <span>Files</span></a>
  70.                     </li>
  71.                 {% endif %}
  72.                 {% if is_granted('ROLE_USERS_ALL') == true %}
  73.                     <li id="users-nav-item" class="nav-item">
  74.                         <a class="nav-link" href="{{ path('users') }}">
  75.                             <i class="fas fa-fw fa-users"></i>
  76.                             <span>Users</span></a>
  77.                     </li>
  78.                 {% endif %}
  79.                 {% if is_granted('ROLE_ROLES_ALL') == true %}
  80.                     <li id="roles-nav-item" class="nav-item">
  81.                         <a class="nav-link" href="{{ path('roles') }}">
  82.                             <i class="fas fa-fw fa-user"></i>
  83.                             <span>Roles</span></a>
  84.                     </li>
  85.                 {% endif %}
  86.                 {% block navSettings %}
  87.                 {% if is_granted('ROLE_SETTINGS_ALL') == true %}
  88.                     <li id="settings-nav-item" class="nav-item">
  89.                         <a class="nav-link collapsed" href="{{ path('dataSettings') }}" 
  90.                            data-toggle="collapse" onclick={window.location.href="{{ path('dataSettings') }}";}>
  91.                             <i class="fas fa-fw fa-cog"></i>
  92.                         <span>Settings</span>
  93.                         </a>
  94.                     </li>
  95.                 {% endif %}
  96.                 {% endblock %}
  97.             </ul>
  98.             {% block modal %} {% endblock %}
  99.             <!-- Content Wrapper -->
  100.             <div id="content-wrapper" class="d-flex flex-column">
  101.                     <nav class="navbar navbar-expand navbar-light topbar mb-4 static-top shadow navbar-cspro" role="navigation" style="margin-bottom: 0">
  102.                         <!-- Sidebar Toggle (Topbar) -->
  103.                         <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
  104.                             <i class="fas fa-bars"></i>
  105.                         </button>
  106.                         {% set userinfo = app.request.cookies.has('username') ? app.request.cookies.get('username')  : null %}
  107.                         {% set accessToken = app.request.cookies.has('access_token') ? app.request.cookies.get('access_token') : null %}
  108.                         <ul class="navbar-nav ml-auto">
  109.                             <li class="nav-item mx-1">
  110.                                 {{ userinfo }}
  111.                             </li>
  112.                             <li class="nav-item mx-1" >
  113.                                 <a href="{{ path('logout') }}" class="nav-text-cspro"><i class="fas fa-sign-out-alt fa-fw"></i> Logout</a>
  114.                             </li>
  115.                             {% block helps %} {% endblock %}
  116.                         </ul>
  117.                         <!-- /.sidebar-collapse -->
  118.                     </nav>
  119.                 <!-- /.navbar-static-side -->
  120.                 <!-- Page Content -->
  121.                 <div id="page-wrapper" class="container-fluid">
  122.                     {% block content %}
  123.                     {% endblock %}
  124.                 </div>
  125.             </div>
  126.         </div>
  127.         <!-- /#page-wrapper -->
  128.     </div>
  129.     <!-- /#wrapper -->
  130.     <!-- jQuery -->
  131.     <script src={{asset('bower_components/jquery/jquery.min.js')}}></script>
  132.     <!-- Bootstrap Core JavaScript -->
  133.     <script src={{asset('bower_components/bootstrap/js/bootstrap.bundle.min.js')}}></script>
  134.     <!-- Core plugin JavaScript-->
  135.     <script src={{asset('bower_components/jquery-easing/jquery.easing.min.js')}}></script>
  136.     <!-- DataTables JavaScript -->
  137.     <script src={{asset('bower_components/datatables/jquery.dataTables.min.js')}}></script>
  138.     <script src={{asset('bower_components/datatables/dataTables.bootstrap4.min.js')}}></script>
  139.     <!-- Custom Theme JavaScript -->
  140.     <script src={{asset('dist/js/sb-admin-2.min.js')}}></script>
  141.     <!-- Page-Level Scripts -->
  142.     {# Script block contains script tags to preserve syntax highlighting #}
  143.     {% block scripts %}
  144.         <script>
  145.             "use strict";
  146.             function showAlert(message, alertStyle) {
  147.                 $("#alert").replaceWith("<div id='alert' class='" + alertStyle + " alert-margin-cspro'>" + message + "</div>");
  148.                 $("#alert").show();
  149.             }
  150.             $(document).ready(function () {
  151.                 // Delete app functionality
  152.                 (function () {
  153.                     var tr;
  154.                     $(".delete-button-class").on("click", function (event) {
  155.                         tr = $(event.target).closest("tr");
  156.                         var appName = $(tr).data("appname");
  157.                         var modalText = 'Are you sure you want to delete the application \"' + appName + '\"?';
  158.                         $("#delete-app-modal").find('.modal-body').text(modalText);
  159.                         $("#delete-app-modal").modal("show");
  160.                     });
  161.                     $("#delete-button").on("click", function (event) {
  162.                         event.preventDefault();
  163.                         $("#delete-app-modal").modal("hide");
  164.                         // get the user name of the nearest row
  165.                         var appName = $(tr).data("appname");
  166.                         $.ajax({
  167.                             type: "DELETE",
  168.                             url: "{{ url('apps') }}/" + encodeURIComponent(appName),
  169.                             dataType: "json",
  170.                             success: function (response) {
  171.                                 if (response.code === 200) {
  172.                                     var alertMsg = "Application " + appName + " deleted";
  173.                                     showAlert(alertMsg, "alert alert-success");
  174.                                     $(tr).remove();
  175.                                 } else {
  176.                                     var alertMsg = "Failed to delete application " + appName;
  177.                                     showAlert(alertMsg, "alert alert-danger");
  178.                                 }
  179.                             },
  180.                             error: function (response) {
  181.                                 if (response.status === 405) {
  182.                                     window.location.href = "{{ path('logout') }}";
  183.                                 } else {
  184.                                     var alertMsg = "Failed to delete application " + appName;
  185.                                     showAlert(alertMsg, "alert alert-danger");
  186.                                 }
  187.                             },
  188.                             failure: function (errMsg) {
  189.                                 alert("error!");
  190.                             }
  191.                         });
  192.                     });
  193.                 })();
  194.                 // Spinner functionality
  195.                 var $body = $("body");
  196.                 $(document).ajaxStart(function (event, request, settings) {
  197.                     $body.addClass("loading");
  198.                 });
  199.                 $(document).ajaxComplete(function (event, request, settings) {
  200.                     $body.removeClass("loading");
  201.                 });
  202.             });
  203.         </script>
  204.     {% endblock %} 
  205.     {# script #}
  206.     <div id="mainSpinner" class="spinner"><!-- Place at bottom of page --></div>
  207. </body>
  208. </html>