Guest User

Untitled

a guest
Jul 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. ---
  2. title: "::cga.cx::Home"
  3. permalink: /
  4. ---
  5.  
  6. <% 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 %>
  7.  
  8. <div class="pagination">
  9. <% if human_page_id != 1 %>
  10. <span class="step"><a href="<%= @root %>/<%= human_page_id-1 %>/">Newer Articles</a></span>
  11. <% end %>
  12.  
  13. <% if human_page_id != page_count %>
  14. <span class="step"><a href="<%= @root %>/<%= human_page_id+1 %>/">Older Articles</a></span>
  15. <% end %>
  16. </div>
  17.  
  18. <%= render 'pagination', :articles_per_item => @articles_per_item, :item_id => @item_id, :root => '/news' %>
  19.  
  20. <% sorted_articles.slice(@item_id*@articles_per_item, @articles_per_item).each do |article| %>
  21. <h4><%= link_to article[:title], article.reps[0].path %></h4>
  22. <%= article[:excerpt] %>
  23. <%= link_to 'read more', article.reps[0].path %>
  24. <% end %>
  25.  
  26. <%= render 'pagination', :articles_per_item => @articles_per_item, :item_id => @item_id, :root => '/news' %>
Add Comment
Please, Sign In to add comment