feat(association): permets de rejoindre depuis les détails
Parent
361e419268
révision
1e7db19fba
|
@ -269,6 +269,11 @@ class AssociationDetail(PageMixin, DetailView):
|
|||
]
|
||||
return []
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['can_engage'] = self.object.can_self_engage(self.request.user)
|
||||
return context
|
||||
|
||||
|
||||
class AssociationUpdate(CruditorPageMixin, CruditorChangeView):
|
||||
model = models.Association
|
||||
|
|
|
@ -36,4 +36,22 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if can_engage %}
|
||||
<div class="row justify-content-end mt-2">
|
||||
<div class="col-sm-auto">
|
||||
<form action="{% url "base:association:engage" object.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-primary btn-block">
|
||||
<i class="fa fa-sign-in mr-2" aria-hidden="true"></i>Rejoindre
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% elif user.is_anonymous %}
|
||||
<hr class="mt-4">
|
||||
<p class="text-center text-muted">
|
||||
<a href="{% url "accounts:login" %}">Connectez-vous</a> pour rejoindre cette association et saisir vos actions de bénévolat.
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket