better button
This commit is contained in:
parent
f166077f5e
commit
af436500fd
2 changed files with 2 additions and 4 deletions
|
@ -37,7 +37,7 @@ module Manager
|
|||
administrateur = Administrateur.find(params[:id])
|
||||
|
||||
if !administrateur.can_be_deleted?
|
||||
fail "Cannot delete this administrateur because it has dossiers or procedures"
|
||||
fail "Impossible de supprimer cet administrateur car il a des dossiers ou des procédures"
|
||||
end
|
||||
administrateur.dossiers.each(&:delete_and_keep_track)
|
||||
administrateur.destroy
|
||||
|
|
|
@ -33,12 +33,10 @@ as well as a link to its edit page.
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<% if page.resource.can_be_deleted? %>
|
||||
<%= link_to "supprimer", delete_manager_administrateur_path(page.resource), method: :delete, class: "button", data: { confirm: "Confirmez-vous la suppression de l'administrateur ?" } %>
|
||||
<% end %>
|
||||
<% if page.resource.invitation_expired? %>
|
||||
<%= link_to "renvoyer l'invitation", reinvite_manager_administrateur_path(page.resource), method: :post, class: "button" %>
|
||||
<% end %>
|
||||
<%= button_to "supprimer", delete_manager_administrateur_path(page.resource), method: :delete, disabled: !page.resource.can_be_deleted?, class: "button", data: { confirm: "Confirmez-vous la suppression de l'administrateur ?" }, title: page.resource.can_be_deleted? ? "Supprimer" : "Cet administrateur a des dossiers ou des procédures et ne peut être supprimé" %>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
|
Loading…
Reference in a new issue