Packages

This is a CMS written in Elixir. Aims to be the great open-source ecommerce and/or startup solution for those who are searching for a performance and stability on top of modern technologies like React and Elixir.

Current section

Files

Jump to
lyn web templates admin form.html.eex
Raw

web/templates/admin/form.html.eex

<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<%= for {id, column} <- @columns do %>
<%= unless id == :id || id == :sort_order ||
id == :inserted_at || id == :updated_at do %>
<div class="form-group">
<%= label f, id, class: "control-label" %>
<%= case column.type do
:boolean -> checkbox f, id, class: "form-control"
:integer -> number_input f, id, class: "form-control"
:datetime -> datetime_select f, id, class: "form-control"
_ -> text_input f, id, class: "form-control"
end
%>
<%= error_tag f, id %>
</div>
<% end %>
<% end %>
<div class="form-group">
<%= submit "Submit", class: "btn btn-primary" %>
</div>
<% end %>