5
lib/eventos_web/templates/event/edit.html.eex
Normal file
5
lib/eventos_web/templates/event/edit.html.eex
Normal file
@@ -0,0 +1,5 @@
|
||||
<h2>Edit Event</h2>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, event_path(@conn, :update, @event)) %>
|
||||
|
||||
<span><%= link "Back", to: event_path(@conn, :index) %></span>
|
||||
35
lib/eventos_web/templates/event/form.html.eex
Normal file
35
lib/eventos_web/templates/event/form.html.eex
Normal file
@@ -0,0 +1,35 @@
|
||||
<%= 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, :description, class: "control-label" %>
|
||||
<%= text_input f, :description, class: "form-control" %>
|
||||
<%= error_tag f, :description %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= label f, :begin_on, class: "control-label" %>
|
||||
<%= datetime_select f, :begin_on, class: "form-control" %>
|
||||
<%= error_tag f, :begin_on %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= label f, :ends_on, class: "control-label" %>
|
||||
<%= datetime_select f, :ends_on, class: "form-control" %>
|
||||
<%= error_tag f, :ends_on %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= submit "Submit", class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
32
lib/eventos_web/templates/event/index.html.eex
Normal file
32
lib/eventos_web/templates/event/index.html.eex
Normal file
@@ -0,0 +1,32 @@
|
||||
<h2>Listing Events</h2>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Description</th>
|
||||
<th>Begin on</th>
|
||||
<th>Ends on</th>
|
||||
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= for event <- @events do %>
|
||||
<tr>
|
||||
<td><%= event.title %></td>
|
||||
<td><%= event.description %></td>
|
||||
<td><%= event.begin_on %></td>
|
||||
<td><%= event.ends_on %></td>
|
||||
|
||||
<td class="text-right">
|
||||
<span><%= link "Show", to: event_path(@conn, :show, event), class: "btn btn-default btn-xs" %></span>
|
||||
<span><%= link "Edit", to: event_path(@conn, :edit, event), class: "btn btn-default btn-xs" %></span>
|
||||
<span><%= link "Delete", to: event_path(@conn, :delete, event), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %></span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<span><%= link "New Event", to: event_path(@conn, :new) %></span>
|
||||
5
lib/eventos_web/templates/event/new.html.eex
Normal file
5
lib/eventos_web/templates/event/new.html.eex
Normal file
@@ -0,0 +1,5 @@
|
||||
<h2>New Event</h2>
|
||||
|
||||
<%= render "form.html", Map.put(assigns, :action, event_path(@conn, :create)) %>
|
||||
|
||||
<span><%= link "Back", to: event_path(@conn, :index) %></span>
|
||||
28
lib/eventos_web/templates/event/show.html.eex
Normal file
28
lib/eventos_web/templates/event/show.html.eex
Normal file
@@ -0,0 +1,28 @@
|
||||
<h2>Show Event</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<strong>Title:</strong>
|
||||
<%= @event.title %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Description:</strong>
|
||||
<%= @event.description %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Begin on:</strong>
|
||||
<%= @event.begin_on %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Ends on:</strong>
|
||||
<%= @event.ends_on %>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<span><%= link "Edit", to: event_path(@conn, :edit, @event) %></span>
|
||||
<span><%= link "Back", to: event_path(@conn, :index) %></span>
|
||||
Reference in New Issue
Block a user