Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 14 additions & 30 deletions app/views/posts/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,25 @@
<br>
</div>


<div class="container">
<button class="btn btn-default"><%= link_to 'New Post', new_post_path %></button>

<% @posts.each do |post| %>

<div class="media">

</div>

<div class="media"></div>
<div class="upv">


<div class="media-left media-top">
<%= button_to upvote_post_path(post), method: :post, class: "btn btn-primary btn-xs" do %>
<span class="glyphicon glyphicon-chevron-up"></span>
<% end %>

<p> <%= post.votes.count %> </p>

<%= button_to downvote_post_path(post), method: :delete, class: "btn btn-primary btn-xs" do %>
<span class="glyphicon glyphicon-chevron-down"></span>
<% end %>
</div>

<div class="media-left media-top">

<%= image_tag post.photo, class: "img-thumbnail" %>

</div>



<div class="media-left media-top">
<%= button_to upvote_post_path(post), method: :post, class: "btn btn-primary btn-xs" do %>
<span class="glyphicon glyphicon-chevron-up"></span>
<% end %>
<p> <%= post.votes.count %> </p>
<%= button_to downvote_post_path(post), method: :delete, class: "btn btn-primary btn-xs" do %>
<span class="glyphicon glyphicon-chevron-down"></span>
<% end %>
</div>
<div class="media-left media-top">
<%= image_tag post.photo, class: "img-thumbnail" %>
</div>
<div class="media-body">
<h4 class="media-heading"><%=link_to post.name, post.dirurl %></h4>
<h4 class="media-heading"><%= link_to post.name, post.dirurl %></h4>
<small>submitted <%= link_to post.created_at.to_s(:long), post %></small>
<p> <%= truncate post.description, length: 400 %> </p>
<small>1540 comments share</small>
Expand Down