Hash :
04b5f55d
Author :
Thomas de Grivel
Date :
2021-11-28T14:21:53
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
<%= form_for @changeset, @action, fn f -> %>
<%= inputs_for f, :slug, fn ff -> %>
<div class="mb-3">
<%= label ff, :slug, class: "form-label" %>
<%= text_input ff, :slug, class: "form-control" %>
<%= error_tag ff, :slug %>
</div>
<% end %>
<div class="mb-3">
<%= label f, :name, class: "form-label" %>
<%= text_input f, :name, class: "form-control" %>
<%= error_tag f, :name %>
</div>
<div class="mb-3">
<%= label f, :description, class: "form-label" %>
<%= textarea f, :description, class: "form-control" %>
<%= error_tag f, :description %>
</div>
<div class="mb-3">
<%= if @conn.assigns[:current_organisation] do %>
<%= link gettext("Cancel"),
to: Routes.slug_path(@conn, :show, @current_organisation.slug.slug),
class: "btn btn-secondary" %>
<%= link gettext("Delete organisation"),
to: Routes.organisation_path(@conn, :delete, @current_organisation.slug.slug),
method: :delete,
class: "btn btn-danger",
data: [confirm: gettext("Are you sure you want to delete the organisation %{org} ?", org: @current_organisation.name || @current_organisation.slug.slug)] %>
<% else %>
<%= link gettext("Cancel"),
to: Routes.slug_path(@conn, :show, @current_user.slug.slug),
class: "btn btn-secondary" %>
<% end %>
<%= submit gettext("Submit"), class: "btn btn-primary" %>
</div>
<% end %>