|
| 1 | +{% extends "account/layout/layout.html" %} |
| 2 | +{% block layout_content %} |
| 3 | + <div> |
| 4 | + <p class="fr-mb-4w"> |
| 5 | + Vous avez été invité·e par {{ invite.inviter.get_full_name }} à rejoindre un dossier sur {{ request.site.name }} <strong>en tant que {{ invite.get_role_display }}</strong> : |
| 6 | + </p> |
| 7 | + <div class="project-card project-card__border--highlight fr-mb-4w"> |
| 8 | + <div class="project-card__content"> |
| 9 | + <div class="project__title"> |
| 10 | + <span class="project-card__project-name">{{ invite.project.name }}</span> |
| 11 | + <span class="project-card__project-org-name">{{ invite.project.org_name }}</span> |
| 12 | + </div> |
| 13 | + <div class="project__info"> |
| 14 | + {% if invite.project.project_sites.origin.site.configuration.logo_small %} |
| 15 | + <img src="{{ invite.project.project_sites.origin.site.configuration.logo_small.url }}" |
| 16 | + width="16px" |
| 17 | + height="auto" |
| 18 | + alt="Logo {{ invite.project.project_sites.origin.site.configuration.name }}" /> |
| 19 | + {% else %} |
| 20 | + <span class="fr-icon--sm fr-icon-window-line" aria-hidden="true"></span> |
| 21 | + {% endif %} |
| 22 | + <span class="project-card__project-site fr-mr-1w">provient de {{ invite.project.project_sites.origin.site.name }}</span> |
| 23 | + <span class="project-card__project-insee fr-icon--sm fr-icon-map-pin-2-line fr-mr-1w">{{ invite.project.commune.name }} ({{ invite.project.commune.insee }})</span> |
| 24 | + {% if invite.project.owner %} |
| 25 | + <span class="project-card__project-org fr-icon--sm fr-icon-parent-line fr-mr-1w">{{ invite.project.owner.profile.organization.name }}</span> |
| 26 | + {% endif %} |
| 27 | + <span class="project-card__project-date fr-icon--sm fr-icon-calendar-event-line fr-mr-1w">déposé depuis {{ invite.project.created_on|timesince }}</span> |
| 28 | + </div> |
| 29 | + <div class="project__info"> |
| 30 | + <div class="project-card__project-tags"> |
| 31 | + <span class="icon fr-icon-tag-line fr-icon--sm" aria-hidden="true"></span> |
| 32 | + {% for tag in invite.project.tags.all %}<span class="project-card__project-tag">#{{ tag }}</span>{% endfor %} |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + <p class="fr-mb-3v">Message d'invitation :</p> |
| 38 | + {% if invite.message %} |
| 39 | + <div class="bg-light fr-p-2w fr-mb-4w"> |
| 40 | + <p>{{ invite.message }}</p> |
| 41 | + {% include "user/user_card.html" with user=invite.inviter %} |
| 42 | + </div> |
| 43 | + {% endif %} |
| 44 | + <form class="form fr-mt-3w" |
| 45 | + action="{% url 'invites-invite-accept' invite.pk %}" |
| 46 | + method="post"> |
| 47 | + {% csrf_token %} |
| 48 | + {% if not existing_account %} |
| 49 | + <hr class="fr-hr"> |
| 50 | + <h3>Créez votre compte {{ request.site.name }}</h3> |
| 51 | + <div class="fr-input-group fr-my-1w"> |
| 52 | + <label class="fr-label" for="email">Adresse courriel</label> |
| 53 | + <input type="text" |
| 54 | + class="fr-input" |
| 55 | + id="email" |
| 56 | + value="{{ invite.email }}" |
| 57 | + disabled> |
| 58 | + </div> |
| 59 | + <div class="fr-grid-row fr-grid-row--gutters fr-mt-1w"> |
| 60 | + <div class="fr-col-6"> |
| 61 | + <div class="fr-input-group"> |
| 62 | + <label class="fr-label" for="input-first-name">Prénom</label> |
| 63 | + <input type="text" |
| 64 | + class="fr-input {% if form.first_name.errors %}is-invalid{% endif %}" |
| 65 | + id="input-first-name" |
| 66 | + name="{{ form.first_name.name }}" |
| 67 | + placeholder="Camille" |
| 68 | + value="{{ form.first_name.value|default:'' }}" |
| 69 | + required> |
| 70 | + {% for error in form.first_name.errors %}<div class="text-danger text-end">{{ error }}</div>{% endfor %} |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + <div class="fr-col-6"> |
| 74 | + <div class="fr-input-group"> |
| 75 | + <label class="fr-label" for="input-last-name">Nom</label> |
| 76 | + <input type="text" |
| 77 | + class="fr-input {% if form.last_name.errors %}is-invalid{% endif %}" |
| 78 | + id="input-last-name" |
| 79 | + name="{{ form.last_name.name }}" |
| 80 | + placeholder="Dupont" |
| 81 | + value="{{ form.last_name.value|default:'' }}" |
| 82 | + required> |
| 83 | + {% for error in form.last_name.errors %}<div class="text-danger text-end">{{ error }}</div>{% endfor %} |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + <div class="fr-grid-row fr-grid-row--gutters fr-mt-1w"> |
| 88 | + <div class="fr-col-6"> |
| 89 | + <div class="fr-input-group"> |
| 90 | + <label class="fr-label" for="input-organization">Organisation</label> |
| 91 | + <input type="text" |
| 92 | + class="fr-input {% if form.organization.errors %}is-invalid{% endif %}" |
| 93 | + id="input-organization" |
| 94 | + name="{{ form.organization.name }}" |
| 95 | + placeholder="DEFR59" |
| 96 | + value="{{ form.organization.value|default:'' }}" |
| 97 | + required> |
| 98 | + {% for error in form.organization.errors %}<div class="text-danger text-end">{{ error }}</div>{% endfor %} |
| 99 | + </div> |
| 100 | + </div> |
| 101 | + <div class="fr-col-6"> |
| 102 | + <div class="fr-input-group"> |
| 103 | + <label class="fr-label" for="input-position">Fonction</label> |
| 104 | + <input type="text" |
| 105 | + class="fr-input {% if form.position.errors %}is-invalid{% endif %}" |
| 106 | + id="input-position" |
| 107 | + name="{{ form.position.name }}" |
| 108 | + placeholder="Chargée de mission" |
| 109 | + value="{{ form.position.value|default:'' }}" |
| 110 | + required> |
| 111 | + {% for error in form.position.errors %}<div class="text-danger text-end">{{ error }}</div>{% endfor %} |
| 112 | + </div> |
| 113 | + </div> |
| 114 | + </div> |
| 115 | + <ul class="fr-btns-group fr-btns-group--inline-sm fr-mt-4w"> |
| 116 | + <li class="w-50"> |
| 117 | + {% comment %} TODO: add url/action from backend {% endcomment %} |
| 118 | + <button class="fr-btn fr-btn--tertiary-no-outline w-100 align-self-center" |
| 119 | + type="submit" |
| 120 | + form="refuse-form">Refuser</button> |
| 121 | + </li> |
| 122 | + <li class="w-50"> |
| 123 | + <button class="fr-btn fr-btn--primary w-100 align-self-center" type="submit">Rejoindre le dossier</button> |
| 124 | + </li> |
| 125 | + </ul> |
| 126 | + {% endif %} |
| 127 | + </form> |
| 128 | + <form action="{% url 'invites-invite-refuse' invite.pk %}" |
| 129 | + method="post" |
| 130 | + id="refuse-form"> |
| 131 | + {% csrf_token %} |
| 132 | + </form> |
| 133 | + </div> |
| 134 | +{% endblock layout_content %} |
| 135 | +{% block layout_secondary_content %} |
| 136 | + <h3 class="fw-bolder">Qu'est ce que {{ request.site.name }} ?</h3> |
| 137 | + {% include "invites/invite_site_message.html" %} |
| 138 | + <p> |
| 139 | + <a class="fr-link" href="{% url 'home' %}">En savoir plus</a> |
| 140 | + </p> |
| 141 | +{% endblock layout_secondary_content %} |
0 commit comments