templates/frontend/dataset/detail.html.twig line 1

Open in your IDE?
  1. {% extends 'frontend/base.html.twig' %}
  2. {% block body %}
  3.     <main>
  4.         <section class="dataset-inner section-padding bg-gray">
  5.             <div class="page-bar-hero is-detail" style="margin-top: -44px; background-image: url({{ asset('/assets/background/simpang_gumul.png') }})">
  6.                 <div class="container d-flex align-items-center">
  7.                     <div class="position-relative">
  8.                         <a href="{{ path('dataset') }}" class="btn btn-outline-light btn-sm fw-500 mb-3">
  9.                             <i class="bi bi-arrow-left-circle"></i>
  10.                             Daftar Dataset
  11.                         </a>
  12.                         <div class="position-relative">
  13.                             <h5 class="text-light fw-600">{{ publikasi.judul }}</h5>
  14.                             <p
  15.                                 class="text-light">{# {% if publikasi.div.div_icon %} 
  16.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         <img style="width:35px;" src="{{asset('uploads/') ~ publikasi.div.div_icon}}"> 
  17.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     {% else %} 
  18.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     <img style="width:35px;" src="{{asset('assets/logo/kota_kediri.png')}}"> 
  19.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     {% endif %} #}
  20.                             </p>
  21.                             <div class="row">
  22.                                 <div class="col-md-12">
  23.                                     <div class="text-light" style="margin-top: -7px;">
  24.                                         <i class="fa fa-building mr-2"></i>
  25.                                         {{ publikasi.div }}
  26.                                     </div>
  27.                                 </div>
  28.                             </div>
  29.                             <div class="row">
  30.                                 <div class="col-md-9">
  31.                                     <div class="text-light mt-2">
  32.                                         <i class="fa fa-file-text mr-1"></i>
  33.                                         {{ kategori }}
  34.                                     </div>
  35.                                 </div>
  36.                                 <div class="col-md-3">
  37.                                     <div class="text-light fw-700 pull-right">
  38.                                         <i class="fa fa-download mr-1"></i>
  39.                                         {% if publikasi.jumlahDownload %}
  40.                                             {{ publikasi.jumlahDownload }}
  41.                                         {% else %}
  42.                                             0
  43.                                         {% endif %}
  44.                                     </div>
  45.                                 </div>
  46.                             </div>
  47.                             <div class="row">
  48.                                 <div class="col-md-9">
  49.                                     <div class="text-light mt-2">
  50.                                         <i class="fa fa-calendar mr-1"></i>
  51.                                         {{ publikasi.createdAt|date('d F Y') }}
  52.                                     </div>
  53.                                 </div>
  54.                                 <div class="col-md-3">
  55.                                     <div class="text-light fw-700 pull-right">
  56.                                         <i class="fa fa-eye mr-1"></i>
  57.                                         {{ publikasi.view }}
  58.                                     </div>
  59.                                 </div>
  60.                             </div>
  61.                         </div>
  62.                     </div>
  63.                 </div>
  64.             </div>
  65.             <div class="container">
  66.                 <div class="mt-4"></div>
  67.                 <div class="app-box-card">
  68.                     <div class="app-box-card__head d-flex justify-content-between align-items-center">
  69.                         <h5 class="mb-0 fw-600">Meta Data</h6>
  70.                         <div class="sosmed">
  71.                             Bagikan :
  72.                             <a href="https://www.facebook.com/sharer/sharer.php?u={{app.request.getSchemeAndHttpHost()}}{{ path('dataset_detail', {id: publikasi.id}) }}" target="_blank">
  73.                                 <i class="fa fa-facebook-square mr-2"></i>
  74.                             </a>
  75.                             <a href="https://twitter.com/intent/tweet?text={{ publikasi.judul }}&url={{app.request.getSchemeAndHttpHost()}}{{ path('dataset_detail', {id: publikasi.id}) }}" target="_blank">
  76.                                 <i class="fa fa-twitter-square mr-2"></i>
  77.                             </a>
  78.                             {# <a href="whatsapp://send?text={{ publikasi.judul }} {{app.request.getSchemeAndHttpHost()}}{{ path('dataset_detail', {id: publikasi.id}) }}" target="_blank">
  79.                                                                                                                                                                                                                                     <i class="fa fa-whatsapp mr-2"></i>
  80.                                                                                                                                                                                                                                 </a> #}
  81.                             <a href="https://web.whatsapp.com/" target="_blank">
  82.                                 <i class="fa fa-whatsapp mr-2"></i>
  83.                             </a>
  84.                             {# <a href="{{ path('dataset_excel', {id:publikasi.id}) }}" class="btn btn-light bg-blue"><i class="fa fa-download mr-1" style="font-size: 13px;"></i>Unduh</a>  #}
  85.                             <div class="dropdown">
  86.                                 <button onclick="dropDown()" class="dropbtn bg-primary text-light">
  87.                                     <i class="fa fa-download mr-1" style="font-size: 13px;"></i>Unduh</button>
  88.                                 <div id="myDropdown" class="dropdown-content">
  89.                                     <a href="{{ path('dataset_excel', {id:publikasi.id, tipe:'xlsx'}) }}">
  90.                                         <i class="fas fa-file-excel mr-1" style="font-size: 13px;"></i>Spreadsheet</a>
  91.                                     <a href="{{ path('dataset_excel', {id:publikasi.id, tipe:'csv'}) }}">
  92.                                         <i class="fas fa-file-csv mr-1" style="font-size: 13px;"></i>CSV</a>
  93.                                     <a href="{{ path('api', {id: publikasi.id}) }}" target="_blank">
  94.                                         <i class="fas fa-gears mr-1" style="font-size: 13px;"></i>API</a>
  95.                                     <a href="{{ path('dataset_dcat', {id: publikasi.id}) }}" target="_blank">
  96.                                         <i class="fas fa-gears mr-1" style="font-size: 13px;"></i>CKAN DCAT</a>
  97.                                 </div>
  98.                             </div>
  99.                         </div>
  100.                     </div>
  101.                     <div class="app-box-card__body">
  102.                         <div class="table-responsive mt-20">
  103.                             <table class="table table-bordered table-addt">
  104.                                 <tbody>
  105.                                     <tr>
  106.                                         <td width="20%">Dataset Dibuat</td>
  107.                                         <th>{{ publikasi.createdAt|date('d F Y') }}</th>
  108.                                         <td>Satuan Dataset</td>
  109.                                         <th>{{ publikasi.satuan }}</th>
  110.                                     </tr>
  111.                                     <tr>
  112.                                         <td>Kode Dataset</td>
  113.                                         <th>{{ publikasi.kode }}</th>
  114.                                         <td>Periode Dataset</td>
  115.                                         <th>{{ publikasi.periode }}</th>
  116.                                     </tr>
  117.                                     <tr>
  118.                                         <td>Produsen</td>
  119.                                         <th>{{ publikasi.div }}</th>
  120.                                         <td>Sumber Dataset</td>
  121.                                         <th>{{ publikasi.sumber }}</th>
  122.                                     </tr>
  123.                                 </tbody>
  124.                             </table>
  125.                         </div>
  126.                     </div>
  127.                 </div>
  128.                 <div class="mb-5"></div>
  129.                 <div class="app-box-card" style="margin-top: -25px;">
  130.                     <div class="card-body">
  131.                         <div class="app-box-card with-tabs">
  132.                             <div class="app-box-card__head d-flex">
  133.                                 <ul class="nav nav-pills" id="myTab" role="tablist">
  134.                                     <li class="nav-item">
  135.                                         <a class="nav-link active" id="nasional-tab" data-toggle="tab" href="#tabel" role="tab" aria-controls="data" aria-selected="true">Tabel</a>
  136.                                     </li>
  137.                                     <li class="nav-item">
  138.                                         <a class="nav-link" id="lokal-tab" data-toggle="tab" href="#grafik" role="tab" aria-controls="datamedia" aria-selected="false">Grafik</a>
  139.                                     </li>
  140.                                     {# <li class="nav-item">
  141.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         <a class="nav-link" id="lokal-tab" data-toggle="tab" href="#peta" role="tab" aria-controls="datamedia" aria-selected="false">Peta</a>
  142.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     </li> #}
  143.                                 </ul>
  144.                             </div>
  145.                             <div class="app-box-card__body">
  146.                                 <div class="tab-content" id="myTabContent">
  147.                                     <div class="tab-pane fade show active" id="tabel" role="tabpanel" aria-labelledby="versi-tab">
  148.                                         <div class="content">
  149.                                             {% if publikasi.jenis != 1 %}
  150.                                                 <div class="table-responsive mt-30">
  151.                                                     <table class="table table-bordered table-addt" id="" width="100%">
  152.                                                         <thead>
  153.                                                             <tr>
  154.                                                                 <th>Deskripsi</th>
  155.                                                                 <th>Rumus</th>
  156.                                                                 <th>Satuan</th>
  157.                                                                 <th colspan="{{ jumlah_tahun }}" style="text-align: center;">Tahun</th>
  158.                                                             </tr>
  159.                                                             <tr>
  160.                                                                 {% set i = 0 %}
  161.                                                                 <th></th>
  162.                                                                 <th></th>
  163.                                                                 <th></th>
  164.                                                                 {% for thn in tahun %}
  165.                                                                     <th style="text-align: center;">
  166.                                                                         {{thn.isi}}
  167.                                                                     </th>
  168.                                                                     {% set i = i + 1 %}
  169.                                                                 {% endfor %}
  170.                                                             </tr>
  171.                                                         </thead>
  172.                                                         <tbody>
  173.                                                             <tr>
  174.                                                                 <td>{{ publikasi.judul }}</td>
  175.                                                                 <td>{{ publikasi.rumus }}</td>
  176.                                                                 <td>{{ publikasi.satuan }}</td>
  177.                                                                 {% set temp_target = '' %}
  178.                                                                 {% set temp_real   = '' %}
  179.                                                                 {% for res in result %}
  180.                                                                     <td style="text-align: center;">
  181.                                                                         {% set temp_target = res['target']['nilai'] %}
  182.                                                                         {% set temp_real = res['realisasi']['nilai'] %}
  183.                                                                         {{ temp_target }}<br>
  184.                                                                         {{ temp_real }}
  185.                                                                     </td>
  186.                                                                 {% endfor %}
  187.                                                             </tr>
  188.                                                         </tbody>
  189.                                                     </table>
  190.                                                 </div>
  191.                                             {% else %}
  192.                                                 {% if variabel %}
  193.                                                     <div class="table-responsive mt-30">
  194.                                                         <table class="table table-bordered table-addt" id="table_ajax" width="100%">
  195.                                                             <thead>
  196.                                                                 <tr>
  197.                                                                     {% for var in variabel %}
  198.                                                                         <th>{{ var.nama }}</th>
  199.                                                                     {% endfor %}
  200.                                                                 </tr>
  201.                                                                 <tr>
  202.                                                                     {% set i = 0 %}
  203.                                                                     {% for var in variabel %}
  204.                                                                         <th><input type="text" id="{{ var.nama }}" data-column="{{ i }}" class="search-input-text form-control"></th>
  205.                                                                         {% set i = i + 1 %}
  206.                                                                     {% endfor %}
  207.                                                                 </tr>
  208.                                                             </thead>
  209.                                                             <tbody></tbody>
  210.                                                         </table>
  211.                                                     </div>
  212.                                                 {% endif %}
  213.                                             {% endif %}
  214.                                         </div>
  215.                                     </div>
  216.                                     <div class="tab-pane fade" id="grafik" role="tabpanel" aria-labelledby="metode-tab">
  217.                                         <div class="content">
  218.                                             <br>
  219.                                             <div class="row">
  220.                                                 {% if grafik %}
  221.                                                     {% if grafik.isShow == true %}
  222.                                                         <div class="col-lg-1">Periode</div>
  223.                                                         <div class="col-lg-3">
  224.                                                             <div style="display:flex ;">
  225.                                                                 <div>
  226.                                                                     <select name="periode" id="periode">
  227.                                                                         {% for k, item in opt_periode %}
  228.                                                                             <option value="{{ item }}">{{ item }}</option>
  229.                                                                         {% endfor %}
  230.                                                                     </select>
  231.                                                                 </div>
  232.                                                                 <div style="margin-left:2px ;">
  233.                                                                     <select name="tahun" id="tahunx">
  234.                                                                         <option value="All">Semua</option>
  235.                                                                         {% for i in range( "now"|date("Y"), 2016 )  %}
  236.                                                                             <option value="{{i}}">{{i}}</option>
  237.                                                                         {% endfor %}
  238.                                                                     </select>
  239.                                                                 </div>
  240.                                                             </div>
  241.                                                         </div>
  242.                                                     {% endif %}
  243.                                                 {% endif %}
  244.                                             </div>
  245.                                             <hr>
  246.                                             <div style="overflow-x: auto;">
  247.                                                 {% if grafik %}
  248.                                                     {% if grafik.isShow == true %}
  249.                                                         {{ include('frontend/dataset/_chart.html.twig', {publikasi:publikasi, grafik:grafik}) }}
  250.                                                     {% endif %}
  251.                                                 {% endif %}
  252.                                             </div>
  253.                                         </div>
  254.                                     </div>
  255.                                 </div>
  256.                             </div>
  257.                         </div>
  258.                     </div>
  259.                 </div>
  260.                 <div class="card mt-50" style="background: whitesmoke;">
  261.                     <div class="card-body">
  262.                         <h5>Rekomendasi Dataset</h5>
  263.                         <div class="content-rekom">
  264.                             {% for dt in terkait %}
  265.                                 {% if dt.judul %}
  266.                                     <div class="d-block">
  267.                                         <i class="fa fa-angle-double-right"></i>
  268.                                         <a href="{{ path('dataset_detail', {id: dt.id}) }}">{{ dt.judul }}</a>
  269.                                     </div>
  270.                                 {% endif %}
  271.                             {% else %}
  272.                                 <div class="d-block">
  273.                                     Tidak Ada Rekomendasi Dataset
  274.                                 </div>
  275.                             {% endfor %}
  276.                         </div>
  277.                     </div>
  278.                 </div>
  279.             </div>
  280.         </section>
  281.     </main>
  282.     {% if variabel %}
  283.         {# <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.css"> #}
  284.         <link rel="stylesheet" href="https://cdn.datatables.net/1.10.24/css/dataTables.bootstrap4.min.css">
  285.         <script src="{{ asset('frontend/js/jquery.min.js') }}"></script>
  286.         <script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
  287.         <script src="https://cdn.datatables.net/1.10.24/js/dataTables.bootstrap4.min.js"></script>
  288.         <script src="//code.highcharts.com/4.1.8/highcharts.js"></script>
  289.         <script src="//code.highcharts.com/4.1.8/modules/exporting.js"></script>
  290.         <script type="text/javascript">
  291.             jQuery(document).ready(function ($) {
  292. var dataTable = $('#table_ajax').DataTable({
  293. "processing": true,
  294. "bSortCellsTop": true,
  295. "searching": false,
  296. "serverSide": true,
  297. "bLengthChange": false,
  298. "ordering": false,
  299. "scrollX": true,
  300. "ajax": {
  301. 'url': "{{ path('dataset_dataset_table', {id: publikasi.id}) }}",
  302. 'type': 'POST',
  303. 'data': function (data) {
  304. {% for val in variabel %}
  305. {{ "data."|raw }}{{ val.nama }}{{ " = $('#"|raw }}{{ val.nama }}{{ "').val();"|raw }}
  306. {% endfor %}
  307. }
  308. }
  309. });
  310. $('.search-input-text').on('keyup click', function () {
  311. dataTable.draw();
  312. });
  313. })
  314.         </script>
  315.     {% endif %}
  316.     <script>
  317.         $('#periode').change(function () {
  318. getDataChart();
  319. });
  320. $('#tahunx').change(function () {
  321. getDataChart();
  322. });
  323.     </script>
  324. {% endblock %}