Skip to content

Commit

Permalink
[Fiche structure] Intégrer la carte et les informations géo (#915)
Browse files Browse the repository at this point in the history
* Siae detail: move info into new card template

* Move map to detail info card

* Homogenize font size and alignement
  • Loading branch information
raphodn authored Sep 20, 2023
1 parent a2d0cbd commit 78bb1d9
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 128 deletions.
80 changes: 80 additions & 0 deletions lemarche/templates/siaes/_card_detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{% load static %}

<div id="user_profile" class="card c-card c-card--hovershadow siae-card">
<div class="card-header">
<div class="row">
<div class="col-auto">
{% if siae.logo_url %}
<img src="{{ siae.logo_url }}" width="100" alt="Logo de la structure {{ siae.name }}" loading="lazy" />
{% else %}
<img src="{% static 'img/default-listing.png' %}" width="100" alt="{{ siae.name }}" loading="lazy" />
{% endif %}
</div>
<div class="col">
<div class="row">
<div class="col-sm-12">
<h1 class="h2 mb-2">
{{ siae.name_display }}
<br />
<small>(profil mis à jour il y a {{ siae.updated_at|timesince }})</small>
</h1>
{% if user.is_authenticated %}
{% if siae.in_user_favorite_list_count %}
<a href="#" id="favorite-remove-modal-btn" class="btn btn-favorite p-0" data-toggle="modal" data-target="#favorite_item_remove_modal" title="Dans votre liste d'achat">
<i class="ri-star-fill ri-xl"></i>
</a>
{% else %}
<a href="#" id="favorite-add-modal-btn" class="btn btn-favorite p-0" data-toggle="modal" data-target="#favorite_item_add_modal" title="Ajouter à votre liste d'achat" >
<i class="ri-star-line ri-xl"></i>
</a>
{% endif %}
{% else %}
<a href="#" id="favorite-modal-btn" class="btn btn-favorite p-0" data-toggle="modal" data-target="#login_or_signup_modal" data-next-params="{% url 'siae:detail' siae.slug %}" title="Ajouter à votre liste d'achat">
<i class="ri-star-line ri-xl"></i>
</a>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-md-6">
<ul class="list-unstyled mb-0">
<li class="mb-2">
<i class="ri-building-4-line"></i>
<span>{{ siae.get_kind_display }}</span>
</li>
{% if siae.legal_form %}
<li class="mb-2">
<i class="ri-building-4-fill"></i>
<span>{{ siae.get_legal_form_display }}</span>
</li>
{% endif %}
</ul>
</div>
<div class="col-md-6">
<div class="badge-group">
{% if siae.is_qpv %}
<span class="badge badge-pill badge-emploi-lightest" title="Quartier prioritaire de la politique de la ville">QPV</span>
{% endif %}
{% if siae.is_zrr %}
<span class="badge badge-pill badge-emploi-lightest" title="Zone de revitalisation rurale">ZRR</span>
{% endif %}
{% for group in siae.groups.all %}
<span class="badge badge-pill badge-emploi-light">{{ group.name }}</span>
{% endfor %}
{% if siae.is_cocontracting %}
<span class="badge badge-pill badge-success-light">Ouvert à la co-traitance</span>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-body" style="border-top:1px solid #e6e6eb">
{% if inbound_email_is_activated %}
{% include "siaes/_useful_infos_siae_v2.html" with siae=siae %}
{% else %}
{% include "siaes/_useful_infos_siae.html" with siae=siae %}
{% endif %}
</div>
</div>
89 changes: 56 additions & 33 deletions lemarche/templates/siaes/_useful_infos_siae_v2.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% load array_choices_display %}

<div class="row">
<!-- First column -->
<div class="col-12 col-md-6">
<ul class="list-unstyled mb-0">
<li class="mb-2">
Expand Down Expand Up @@ -34,55 +35,77 @@
<strong>{{ siae.etp_count_label_display }} :</strong>
<span>{{ siae.etp_count_display|floatformat:0|default:"non disponible" }}</span>
</li>
{% if siae.contact_website %}
<li class="mb-2">
<i class="ri-window-2-line"></i>
<a href="{{ siae.contact_website }}" id="company_website" target="_blank" rel="noopener">Site internet</a>
</li>
{% endif %}
{% if siae.contact_social_website %}
<li class="mb-2">
<i class="ri-earth-line"></i>
<a href="{{ siae.contact_social_website }}" id="company_social_website" target="_blank" rel="noopener">Réseau social</a>
</li>
{% endif %}
{% if siae.is_missing_contact %}
<li class="mb-2">
<i class="ri-search-line"></i>
<a href="https://www.google.fr/search?q={{ siae.name_display }}" id="company_google" target="_blank" rel="noopener">Google</a>
</li>
{% endif %}
<li class="mb-2">
{% include "siaes/_annuaire_entreprises_button.html" with siret=siae.siret %}
</li>
</ul>
</div>

<!-- Second column -->
<div class="col-12 col-md-6">
<ul class="list-unstyled mb-0">
{% if siae.is_missing_contact %}
<li class="mb-2">
<i class="ri-search-line"></i>
<a href="https://www.google.fr/search?q={{ siae.name_display }}" id="company_google" target="_blank" rel="noopener">Google</a>
</li>
{% endif %}
{% if siae.user_count %}
{% if siae.contact_short_name %}
{% if is_admin %}
{% if siae.user_count %}
{% if siae.contact_short_name %}
<li class="mb-2">
<i class="ri-user-line"></i>
<span>{{ siae.contact_short_name }}</span>
</li>
{% endif %}
{% endif %}
{% if siae.contact_email %}
<li class="mb-2">
<i class="ri-user-line"></i>
<span>{{ siae.contact_short_name }}</span>
<i class="ri-at-line"></i>
<a href="mailto:{{ siae.contact_email }}" id="company_email">{{ siae.contact_email }}</a>
</li>
{% endif %}
{% if siae.contact_phone %}
<li class="mb-2">
<i class="ri-phone-line"></i>
<a href="tel:{{ siae.contact_phone }}" id="company_phone">{{ siae.contact_phone }}</a>
</li>
{% endif %}
{% endif %}
{% comment %} {% if siae.contact_email %}
</ul>
<div class="map-holder mb-3">
<div id="map-siae" class="map-canvas"></div>
</div>
<div class="map_details">
<ul class="list-unstyled m-0">
<li class="mb-2">
<i class="ri-at-line"></i>
<a href="mailto:{{ siae.contact_email }}" id="company_email">{{ siae.contact_email }}</a>
<i class="ri-map-2-line"></i>
<strong>Situé à :</strong>
<span>{{ siae.city }}</span>
</li>
{% endif %} {% endcomment %}
{% if is_admin and siae.contact_phone %}
<li class="mb-2">
<i class="ri-phone-line"></i>
<a href="tel:{{ siae.contact_phone }}" id="company_phone">{{ siae.contact_phone }}</a>
<i class="ri-map-pin-line"></i>
<strong>Adresse :</strong>
<span>{{ siae.address }} {{ siae.post_code }} {{ siae.city }}</span>
</li>
{% endif %}
{% if siae.contact_website %}
<li class="mb-2">
<i class="ri-window-2-line"></i>
<a href="{{ siae.contact_website }}" id="company_website" target="_blank" rel="noopener">Site internet</a>
</li>
{% endif %}
{% if siae.contact_social_website %}
<li class="mb-2">
<i class="ri-earth-line"></i>
<a href="{{ siae.contact_social_website }}" id="company_social_website" target="_blank" rel="noopener">Réseau social</a>
<i class="ri-focus-2-line"></i>
<strong>Intervient sur :</strong>
<span>{{ siae.geo_range_pretty_display }}</span>
</li>
{% endif %}
<li>
<i class="ri-map-pin-line"></i>
<span>{{ siae.address }} {{ siae.post_code }} {{ siae.city }}</span>
</li>
</ul>
</ul>
</div>
</div>
</div>
97 changes: 2 additions & 95 deletions lemarche/templates/siaes/detail.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "layouts/base.html" %}
{% load static array_choices_display siae_sectors_display %}
{% load static siae_sectors_display %}
{% load theme_inclusion %}

{% block title %}{{ siae.name_display }} est sur le marché de l'inclusion{% endblock %}
Expand Down Expand Up @@ -35,84 +35,7 @@
<div id="dir-profile" class="dir-profile-row row">
<div id="content" class="col-12 listing-area">
<!-- profile-detail basic info -->
<div id="user_profile" class="row align-items-start">
<div class="col-12">
<div class="row mb-2">
<div class="col-auto">
{% if siae.logo_url %}
<img src="{{ siae.logo_url }}" width="100" alt="Logo de {{ siae.name }}" />
{% else %}
<img src="{% static 'img/default-listing.png' %}" width="100" alt="{{ siae.name }}" />
{% endif %}
</div>
<div class="col">
<div class="row">
<div class="col-sm-12">
<h1 class="h2">
{{ siae.name_display }}
<br />
<small>(profil mis à jour il y a {{ siae.updated_at|timesince }})</small>
</h1>
{% if user.is_authenticated %}
{% if siae.in_user_favorite_list_count %}
<a href="#" id="favorite-remove-modal-btn" class="btn btn-favorite p-0" data-toggle="modal" data-target="#favorite_item_remove_modal" title="Dans votre liste d'achat">
<i class="ri-star-fill ri-xl"></i>
</a>
{% else %}
<a href="#" id="favorite-add-modal-btn" class="btn btn-favorite p-0" data-toggle="modal" data-target="#favorite_item_add_modal" title="Ajouter à votre liste d'achat" >
<i class="ri-star-line ri-xl"></i>
</a>
{% endif %}
{% else %}
<a href="#" id="favorite-modal-btn" class="btn btn-favorite p-0" data-toggle="modal" data-target="#login_or_signup_modal" data-next-params="{% url 'siae:detail' siae.slug %}" title="Ajouter à votre liste d'achat">
<i class="ri-star-line ri-xl"></i>
</a>
{% endif %}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<ul class="list-unstyled mb-0">
<li class="mb-2">
<i class="ri-building-4-line"></i>
<span>{{ siae.get_kind_display }}</span>
</li>
{% if siae.legal_form %}
<li class="mb-2">
<i class="ri-building-4-fill"></i>
<span>{{ siae.get_legal_form_display }}</span>
</li>
{% endif %}
</ul>
</div>
<div class="col-md-6">
<div class="badge-group">
{% if siae.is_qpv %}
<span class="badge badge-pill badge-emploi-lightest" title="Quartier prioritaire de la politique de la ville">QPV</span>
{% endif %}
{% if siae.is_zrr %}
<span class="badge badge-pill badge-emploi-lightest" title="Zone de revitalisation rurale">ZRR</span>
{% endif %}
{% for group in siae.groups.all %}
<span class="badge badge-pill badge-emploi-light">{{ group.name }}</span>
{% endfor %}
{% if siae.is_cocontracting %}
<span class="badge badge-pill badge-success-light">Ouvert à la co-traitance</span>
{% endif %}
</div>
</div>
</div>

<hr />
{% if inbound_email_is_activated %}
{% include "siaes/_useful_infos_siae_v2.html" with siae=siae %}
{% else %}
{% include "siaes/_useful_infos_siae.html" with siae=siae %}
{% endif %}
</div>
</div>
{% include "siaes/_card_detail.html" with siae=siae %}

<!-- profile-detail sidebar -->
<aside id="sidebar">
Expand All @@ -123,22 +46,6 @@ <h1 class="h2">
{% else %}
{% include "siaes/_detail_cta.html" with siae=siae %}
{% endif %}
<br />
<div class="map-holder mb-3">
<div id="map-siae" class="map-canvas"></div>
</div>
<div class="map_details">
<ul class="list-unstyled m-0 fs-sm">
<li class="mb-1">
<i class="ri-map-pin-line"></i>
<span>Situé à {{ siae.city }}</span>
</li>
<li>
<i class="ri-map-2-line"></i>
<span>Intervient sur : {{ siae.geo_range_pretty_display }}</span>
</li>
</ul>
</div>
</div>
<hr class="mt-5 d-block d-lg-none">
</div>
Expand Down

0 comments on commit 78bb1d9

Please sign in to comment.