{#
  Variables
    - isEmbeded
    - activeMonitoring
#}
{% extends isEmbedded ? '@MauticCore/Default/raw_output.html.twig' : '@MauticCore/Default/content.html.twig' %}

{% block mauticContent 'monitoring' %}

{% block headerTitle activeMonitoring.title %}

{% block preHeader %}
{{- include('@MauticCore/Helper/page_actions.html.twig',
    {
        'item'            : activeMonitoring,
        'templateButtons' : {
            'close' : securityIsGranted('mauticSocial:monitoring:view'),
        },
        'routeBase'       : 'social',
        'langVar'         : 'monitoring',
        'targetLabel'     : 'mautic.social.monitoring'|trans
    }
) -}}
{% endblock %}

{% block actions %}
    {{- include('@MauticCore/Helper/page_actions.html.twig', {
        'item': activeMonitoring,
        'templateButtons': {
            'edit': securityIsGranted('mauticSocial:monitoring:edit'),
            'delete': securityIsGranted('mauticSocial:monitoring:delete'),
        },
        'routeBase': 'social',
        'langVar': 'monitoring',
        'nameGetter': 'getTitle',
    }) -}}
{% endblock %}

{% block publishStatus %}
{{ include('@MauticCore/Helper/publishstatus_badge.html.twig', {'entity': activeMonitoring}) }}
{% endblock %}

{% block content %}
  {{ includeScript('plugins/MauticSocialBundle/Assets/js/social.js') }}
  <!-- start: box layout -->
  <div class="box-layout">
      <!-- left section -->
      <div class="col-md-9 height-auto">
          <div>
              <!-- monitoring detail header -->
              {% include '@MauticCore/Helper/description--expanded.html.twig' with {'description': activeMonitoring.description} %}
              <!--/ monitoring detail header -->
              <!-- monitoring detail collapseable -->
              <div class="collapse pr-md pl-md" id="asset-details">
                  <div class="pr-md pl-md pb-md">
                      <div class="panel shd-none mb-0">
                          <table class="table table-hover mb-0">
                              <tbody>
                                  {{ include('@MauticCore/Helper/details.html.twig', {'entity': activeMonitoring}) }}
                              </tbody>
                          </table>
                      </div>
                  </div>
              </div>
              <!--/  monitoring collapseable -->
          </div>

          <div>
              <!-- stats -->
              <div class="pa-md">
                  <div class="row">
                      <div class="col-sm-12">
                          <div class="panel">
                              <div class="panel-body box-layout">
                                  <div class="col-md-3 va-m">
                                      <h5 class="text-white dark-md fw-sb mb-xs">
                                          <span class="ri-twitter-x-line"></span>
                                          {{ ('mautic.social.monitoring.' ~ activeMonitoring.networkType ~ '.popularity')|trans }}
                                      </h5>
                                  </div>
                                  <div class="col-md-9 va-m">
                                      {{ include('@MauticCore/Helper/graph_dateselect.html.twig', {'dateRangeForm': dateRangeForm, 'class': 'pull-right'}) }}
                                  </div>
                              </div>
                              <div class="d-flex fd-column pt-0 pl-15 pb-15 pr-15 min-h-256">
                                  {{ include('@MauticCore/Helper/chart.html.twig', {'chartData': leadStats, 'chartType': 'line', 'chartHeight': 300}) }}
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
              <!--/ stats -->

              {{ customContent('details.stats.graph.below', _context) }}

              <!-- tabs controls -->
              <ul class="nav nav-tabs nav-tabs-contained">
                  <li class="active">
                      <a href="#leads-container" role="tab" data-toggle="tab">
                          {{ 'mautic.lead.leads'|trans }}
                      </a>
                  </li>
              </ul>
              <!--/ tabs controls -->
          </div>

          <!-- start: tab-content -->
          <div class="tab-content pa-md">
              <!-- #events-container -->
              <div class="tab-pane active fade in bdr-w-0 page-list" id="leads-container">
                  {{ monitorLeads|raw }}
              </div>
          </div>

      </div>
      <!--/ left section -->

      <!-- right section -->
      <div class="col-md-3 bdr-l height-auto">
          <!-- recent activity -->
          {{ include('@MauticCore/Helper/recentactivity.html.twig', {'logs': logs}) }}
      </div>
      <!--/ right section -->

      <input id="itemId" type="hidden" value="{{ activeMonitoring.id }}" />
  </div>
  <!--/ end: box layout -->
{% endblock %}
