show.html.twig 6.25 KB
Newer Older
Julien Jorry committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
{% extends '@kohinos/common/layout.html.twig' %}

{% block content %}
<div class='container groupeshow mt-2'>
  {% include '@kohinos/block/breadcrumb.html.twig' with {'label': presta.raison, 'label2': 'Prestataires', 'url2': path('liste_prestataire') } %}
  <div class="my-2 p-3 bg-white rounded box-shadow">
    <div class="contentpresta p-4 mt-2">
      <div class="card mb-2">
        <div class="card-header">
          <h1>{{ presta.raison }}</h1>
          {% if presta.acceptemlc %}
            <span class='fa-stack fa-lg' data-toggle='tooltip' data-placement='bottom' title="Accepte la monnaie électronique">
              <i class='fa fa-at fa-stack-1x'></i>
              <i class='fa fa-fw fa-stack-2x'></i>
            </span>
          {% else %}
            <span class='fa-stack fa-lg' data-toggle='tooltip' data-placement='bottom' title="N'accepte pas la monnaie électronique">
              <i class='fa fa-at fa-stack-1x'></i>
              <i class='fa fa-ban fa-stack-2x text-danger'></i>
            </span>
          {% endif %}
          {% if presta.rubriques|length > 0%}
          {% for rubrique in presta.rubriques %}
              <a class='rubrique ml-2' href='{{ path('show_rubrique', {'slug': rubrique.slug}) }}'>{{ rubrique.name }}</a>
          {% endfor %}
          {% endif %}
          {# @TODO : ajouter le lien d'édition uniquement quand l'utilisateur peut l'éditer (Voter?) #}
          {% if app.user and (is_granted('ROLE_SUPER_ADMIN') or is_granted('ROLE_ADMIN_PRESTATAIRE_GERER_EDIT')) %}
              <a class='btn btn-primary float-right' href="{{ path('prestataire_edit', {'id': presta.id}) }}">Edit</a>
          {% endif %}
        </div>
        <div class="card-body">
          {% if presta.media != null %}
            <div class='w-25 float-right'>
35
              <img class="w-100" src="{% path presta.media, 'big' %}" alt="{{ presta.raison }}">
Julien Jorry committed
36 37 38 39 40 41 42 43 44 45 46
            </div>
          {% endif %}
          {% if presta.statut != null %}
            <h6 class="card-title text-muted mb-3">{{ presta.statut }}</h6>
          {% endif %}
          {% if presta.groupe != null %}
            <h4 class="card-subtitle mb-3">{{'Groupe local'|trans}} : <a href='{{ path('show_groupe', {'slug': presta.groupe.slug}) }}'>{{ presta.groupe.__toString() }}</a></h4>
          {% endif %}
          {% if presta.siret != null %}
            <h5 class="card-subtitle mb-3">{{'SIRET'|trans}} : {{ presta.siret }}</h5>
          {% endif %}
47 48 49
          {% if app.user and presta_extra_data and presta.conventionnement != null and presta.conventionnement > 0 %}
            <h5 class="card-subtitle mb-3">{{'Pourcentage de conventionnement'|trans}} : {{ presta.conventionnement * 100 }}%</h5>
          {% endif %}
Julien Jorry committed
50 51 52 53
          {% if presta.horaires != null %}
            <h6 class="card-subtitle text-muted mb-3">{{'Horaires'|trans}} : {{ presta.horaires|raw }}</h6>
          {% endif %}
          {% if presta.web != null %}
54
            <h6 class="card-subtitle mb-3">{{'Site web'|trans}} : <a href='{{ presta.web }}' target='_blank' rel='noopener noreferrer'>{{ presta.web }}</a></h6>
Julien Jorry committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
          {% endif %}
          {# {% if presta.responsable != null and presta.metier != null %}
            <h6 class="card-title my-3">Responsable : {{ presta.responsable }} ({{ presta.metier }})</h6>
          {% endif %} #}
          <div class="card-text">
            {{ presta.description|raw }}
          </div>
        </div>
        {% if presta.geolocs|length > 0%}
          <div class="card-header"><h2>{{ 'Adresse(s)'|trans }} :</h2></div>
          <ul class="list-group list-group-flush">
            {% for geoloc in presta.geolocs %}
              <li class="list-group-item">
                {{ geoloc.geoloc }}
              </li>
            {% endfor %}
          </ul>
        {% endif %}
        {% if presta.contacts|length > 0%}
          <div class="card-header"><h2>{{ 'Contact'|trans }}{{ (presta.contacts|filter(v => v.enabled)|length > 1) ? 's' : '' }} :</h2></div>
          <ul class="list-group list-group-flush">
            {% for contact in presta.contacts|filter(v => v.enabled) %}
              <li class="list-group-item">
                {{ contact.name }} : {% if contact.tel != null %}{{ contact.tel }}{% endif %} / {% if contact.email != null %}{{ contact.email }}{% endif %}
              </li>
            {% endfor %}
          </ul>
        {% endif %}
83 84 85 86 87 88 89 90 91 92 93 94
        {% if presta_extra_data and presta.prestataireProductFamilies|length > 0%}
          <div class="card-header"><h2>{{ 'Produits vendus'|trans }}</h2></div>
          <ul class="list-group list-group-flush">
            {% for prestataireProductFamily in presta.prestataireProductFamilies %}
              {% if prestataireProductFamily.products|length > 0%}
                <li class="list-group-item">
                  {{ prestataireProductFamily.productFamily.name }}
                </li>
              {% endif %}
            {% endfor %}
          </ul>
        {% endif %}
95
        {% if app.user and presta_self_init_and_eval and presta.selfEvalPrestaQuiz and presta.selfEvalPrestaQuiz.isSubmitted %}
96
          {% set prestataire = presta %}
97
          <div class="card-header">
98
              <h2>{{ 'Questionnaire'|trans }}</h2>
99 100 101 102
              {% if app.user in prestataire.users and is_granted("ROLE_PRESTATAIRE") %}
                  <a class='btn btn-primary float-right' href="{{ path('quiz-presta-edit') }}">Corriger</a>
              {% endif %}
          </div>
103 104
          <div class="card-body">
              {% if presta.marketChannelFunction == 'distributor' %}
105
                  {% include '@kohinos/tav/prestaquiz/distributor_core.html.twig' %}
106
              {% else %}
107
                  {% include '@kohinos/tav/prestaquiz/producer_core.html.twig' %}
108 109 110
              {% endif %}
          </div>
        {% endif %}
Julien Jorry committed
111 112 113 114 115
      </div>
    </div>
  </div>
</div>

116
{% endblock %}
Julien Jorry committed
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132

{% block contenat %}
<div class='container newslist mt-5'>
  <h1>{{ presta.raison }}</h1>
  <div class="my-3 p-3 bg-white rounded box-shadow">
    <div class="contentnews p-4 mt-5">
        <h2>{{ presta.statut }}</h2>
        <h3>Responsable : {{ presta.responsable }} ({{ presta.metier }})</h3>
    <h4>SIRET : {{ presta.siret }}</h4>
    {% if presta.web is not empty %}
      <h4><a href='{{ presta.web }}'>Site web</a></h4>
    {% endif %}
    </div>
  </div>
</div>
{% endblock %}