5
lib/eventos_web/templates/category/edit.html.eex
Normal file
5
lib/eventos_web/templates/category/edit.html.eex
Normal 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>
|
||||
23
lib/eventos_web/templates/category/form.html.eex
Normal file
23
lib/eventos_web/templates/category/form.html.eex
Normal 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 %>
|
||||
28
lib/eventos_web/templates/category/index.html.eex
Normal file
28
lib/eventos_web/templates/category/index.html.eex
Normal 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>
|
||||
5
lib/eventos_web/templates/category/new.html.eex
Normal file
5
lib/eventos_web/templates/category/new.html.eex
Normal 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>
|
||||
18
lib/eventos_web/templates/category/show.html.eex
Normal file
18
lib/eventos_web/templates/category/show.html.eex
Normal 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>
|
||||
Reference in New Issue
Block a user