Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- title: "::cga.cx::Home"
- permalink: /
- ---
- <% article_count = sorted_articles.size, page_count = article_count / @articles_per_item + (article_count % @articles_per_item == 0 ? 0 : 1), human_page_id = @item_id+1 %>
- <div class="pagination">
- <% if human_page_id != 1 %>
- <span class="step"><a href="<%= @root %>/<%= human_page_id-1 %>/">Newer Articles</a></span>
- <% end %>
- <% if human_page_id != page_count %>
- <span class="step"><a href="<%= @root %>/<%= human_page_id+1 %>/">Older Articles</a></span>
- <% end %>
- </div>
- <%= render 'pagination', :articles_per_item => @articles_per_item, :item_id => @item_id, :root => '/news' %>
- <% sorted_articles.slice(@item_id*@articles_per_item, @articles_per_item).each do |article| %>
- <h4><%= link_to article[:title], article.reps[0].path %></h4>
- <%= article[:excerpt] %>
- <%= link_to 'read more', article.reps[0].path %>
- <% end %>
- <%= render 'pagination', :articles_per_item => @articles_per_item, :item_id => @item_id, :root => '/news' %>
Add Comment
Please, Sign In to add comment