Skip to content

Commit

Permalink
Make screenings#index better on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
lortza committed Feb 4, 2020
1 parent 04eab95 commit af0e178
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/views/screenings/_form.html.erb
Expand Up @@ -18,7 +18,7 @@
<%= f.date_field :date_watched %>
</div>
<div class="field">
<%= f.label :location_watched %><br>
<%= f.label :location_watched, "Location Watched"" %><br>
<%= f.text_field :location_watched %>
</div>
<div class="field">
Expand Down
10 changes: 7 additions & 3 deletions app/views/screenings/edit.html.erb
@@ -1,11 +1,15 @@
<% content_for(:title, "Editing") %>

<h1>Edit Your Screening</h1>
<p class="button-main pull-right">
<%= link_to 'Back', movie_screenings_path(@movie) %>
</p>

<h1>Edit</h1>
<h2>Your <%= @screening.date_watched.stamp("12-31-2016") %> Screening of <%= @movie.title %></h2>

<%= render 'form' %>

<hr>
<p class="button-main">
<%= link_to 'Back To Screenings', movie_screenings_path(@movie) %>
<%= link_to 'Back To ' + @movie.title, movie_path(@movie) %>
<%= link_to 'Delete', movie_screening_path(@movie, @screening), method: :delete, data: { confirm: 'Are you sure you want to delete this screening? This action cannot be undone.' } %>
</p>
22 changes: 9 additions & 13 deletions app/views/screenings/index.html.erb
Expand Up @@ -3,23 +3,19 @@
<h1>Screenings for <%= link_to "#{@movie.title}", movie_path(@movie) %></h1>

<table class="table">
<thead>
<tr>
<th>Date Watched</th>
<th>Location Watched</th>
<th>Notes</th>
<th colspan="3">Manage Screenings</th>
</tr>
</thead>

<tbody>
<% @screenings.order("date_watched DESC").each do |screening| %>
<tr>
<td><%= screening.date_watched.stamp("1/2/2001") %></td>
<td><%= screening.location_watched %></td>
<td><%= screening.notes %></td>
<td><%= link_to 'Edit', edit_movie_screening_path(@movie, screening) %></td>
<td><%= link_to 'Delete', movie_screening_path(@movie, screening), method: :delete, data: { confirm: 'Are you sure you want to delete this screening? This action cannot be undone.' } %></td>
<td>
<p>
<strong><%= screening.location_watched %></strong><br />
<%= screening.notes %>
</p>
</td>
<td>
<%= link_to 'Edit', edit_movie_screening_path(@movie, screening) %>
</td>
</tr>
<% end %>
</tbody>
Expand Down

0 comments on commit af0e178

Please sign in to comment.