Commit 05227b4d authored by Mat's avatar Mat
Browse files

association, différencier le bouton effacer si elle contient des membres

parent 389694a7
......@@ -98,6 +98,7 @@ class Association
*/
private $membres;
/**
* @return string
*/
......@@ -106,6 +107,13 @@ class Association
return $this->nom . " [" . $this->email . "]";
}
/**
* @return string
*/
public function getMembres()
{
return $this->membres;
}
......
......@@ -14,6 +14,7 @@
<th scope="col">Objet Social</th>
<th scope="col">Email</th>
<th scope="col">n° TVA</th>
<th scope="col">Membres</th>
<th scope="col">Action</th>
</tr>
</thead>
......@@ -25,11 +26,17 @@
<td>{{ asso.objetSocial }}</td>
<td>{{ asso.email }}</td>
<td>{{ asso.tva }}</td>
<td>{{ asso.getMembres()|length }}</td>
<td>
<a class="btn btn-primary btn-sm" role="button"
href="{{ path('asso_association_update', {'id': asso.id }) }}">Editer</a>
<a class="btn btn-danger btn-sm" role="button"
href="{{ path('asso_association_delete', {'id': asso.id }) }}">Effacer</a>
<a class="btn btn-primary btn-sm" role="button"
href="{{ path('asso_association_update', {'id': asso.id }) }}">Editer</a>
{% if asso.getMembres()|length == 0 %}
<a class="btn btn-danger btn-sm" role="button"
href="{{ path('asso_association_delete', {'id': asso.id }) }}">Effacer</a>
{% else %}
<a class="btn btn-danger btn-sm disabled" tabindex="-1" role="button"
aria-disabled="true">Effacer</a>
{% endif %}
</td>
</tr>
{% endfor %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment