Last active
December 19, 2015 05:19
-
-
Save vanakenm/5903451 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for :header do %> | |
<%= javascript_include_tag "filters" %> | |
<% end %> | |
<h1>Show posts</h1> | |
<header> | |
<section id="statistics"> | |
<p>Currently <%= @posts.size %> in <%= @posts.map(&:category).uniq.size %> different categories.</p> | |
<p>Most recent category: <%= @posts.first.category %> | |
</section> | |
<section id="filters"> | |
<div class="btn-group sort"> | |
<a class="btn dropdown-toogle" data-toogle="dropdown" href="#">All categories <span class="caret"></span></a> | |
<ul class="dropdown-menu"> | |
<li><a data-filter-category="all_filter" href="#">All categories</a></li> | |
<li><a data-filter-category="opinion" href="#">Opinion</a></li> | |
<li><a data-filter-category="announcement" href="#">Announcement</a></li> | |
<li><a data-filter-category="debate" href="#">Debate</a></li> | |
</ul> | |
</div> | |
</section> | |
</header> | |
<% @posts.each do |post| %> | |
<article data-category="<%= post.category %>"> | |
<header> | |
<h1><%= post.title %></h1> | |
<h2>By <%= post.author %></h2> | |
</header> | |
<section class="contents"> | |
<%= post.contents %> | |
</section> | |
<footer> | |
Published on <%= post.publish_date %> | |
</footer> | |
</article> | |
<% end %> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment