app/views/chive/articles/show.html.erb in chive-0.0.3 vs app/views/chive/articles/show.html.erb in chive-0.1.0
- old
+ new
@@ -1,7 +1,30 @@
<section>
<article>
- <h1><%= @article.title %></h1>
- <address>by <%= @article.byline %> on <%= @article.published_at %></address>
- <%= raw @article.body %>
+ <div class="row">
+ <div class="float-left">
+ <%= image_tag @article.image.variant(resize: '250x250') if @article.image.attached? %>
+ </div>
+ <div class="col">
+ <h1><%= @article.title %></h1>
+ <address>by <%= @article.byline %> on <%= @article.published_at %></address>
+ <p>
+ <small><%= @article.tag_list.to_s %></small>
+ </p>
+ </div>
+ <nav class="col header-nav">
+ <% if user_can_chive? %>
+ <%= link_to "Edit", edit_article_path(@article), class: 'btn btn-outline-primary' %>
+ <%= link_to "Delete", '#', class: 'btn btn-outline-danger', data: { toggle: 'modal', target: '#delete-modal' } %>
+ <%= render partial: 'delete_modal' %>
+ <% end %>
+ </nav>
+ </div>
+ <div class="row">
+ <%= raw @article.body %>
+ </div>
</article>
</section>
+
+<nav>
+ <%= link_to 'More Articles', articles_path %>
+</nav>