2014-04-26 01:24:47 +00:00
|
|
|
<div id="articles">
|
|
|
|
<h1>Articles</h1>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-26 01:24:47 +00:00
|
|
|
<% @categories.each do |category| %>
|
|
|
|
<h3 class="title"><%= category.name %></h3>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-26 01:24:47 +00:00
|
|
|
<div class="category">
|
|
|
|
<% category.articles.nodrafts.ordered.each do |article| %>
|
|
|
|
<div class="article-list">
|
|
|
|
<div class="title">
|
2020-03-15 20:59:08 +00:00
|
|
|
<% if cuser and !cuser.have_read?(article) %>
|
2014-04-26 01:24:47 +00:00
|
|
|
<span class="new">NEW</span>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= namelink article %>
|
|
|
|
</div>
|
|
|
|
<div class="meta">
|
|
|
|
<span class="author">
|
|
|
|
<%= namelink article.user %>
|
|
|
|
</span>
|
|
|
|
<span class="date">
|
|
|
|
on <%= longdate article.created_at %>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2014-04-20 01:29:52 +00:00
|
|
|
</div>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
|
2014-04-26 01:24:47 +00:00
|
|
|
<% if Article.new.can_create? cuser %>
|
|
|
|
<%= link_to 'New Article', new_article_path, class: 'button new' %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|