initial commit

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2017-12-08 09:58:14 +01:00
commit 90ceb4f6fe
181 changed files with 8219 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<h2>Edit Category</h2>
<%= render "form.html", Map.put(assigns, :action, category_path(@conn, :update, @category)) %>
<span><%= link "Back", to: category_path(@conn, :index) %></span>

View File

@@ -0,0 +1,23 @@
<%= 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 %>
<div class="form-group">
<%= label f, :title, class: "control-label" %>
<%= text_input f, :title, class: "form-control" %>
<%= error_tag f, :title %>
</div>
<div class="form-group">
<%= label f, :picture, class: "control-label" %>
<%= text_input f, :picture, class: "form-control" %>
<%= error_tag f, :picture %>
</div>
<div class="form-group">
<%= submit "Submit", class: "btn btn-primary" %>
</div>
<% end %>

View File

@@ -0,0 +1,28 @@
<h2>Listing Categories</h2>
<table class="table">
<thead>
<tr>
<th>Title</th>
<th>Picture</th>
<th></th>
</tr>
</thead>
<tbody>
<%= for category <- @categories do %>
<tr>
<td><%= category.title %></td>
<td><%= category.picture %></td>
<td class="text-right">
<span><%= link "Show", to: category_path(@conn, :show, category), class: "btn btn-default btn-xs" %></span>
<span><%= link "Edit", to: category_path(@conn, :edit, category), class: "btn btn-default btn-xs" %></span>
<span><%= link "Delete", to: category_path(@conn, :delete, category), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %></span>
</td>
</tr>
<% end %>
</tbody>
</table>
<span><%= link "New Category", to: category_path(@conn, :new) %></span>

View File

@@ -0,0 +1,5 @@
<h2>New Category</h2>
<%= render "form.html", Map.put(assigns, :action, category_path(@conn, :create)) %>
<span><%= link "Back", to: category_path(@conn, :index) %></span>

View File

@@ -0,0 +1,18 @@
<h2>Show Category</h2>
<ul>
<li>
<strong>Title:</strong>
<%= @category.title %>
</li>
<li>
<strong>Picture:</strong>
<%= @category.picture %>
</li>
</ul>
<span><%= link "Edit", to: category_path(@conn, :edit, @category) %></span>
<span><%= link "Back", to: category_path(@conn, :index) %></span>