Skip to content

Commit 3c8d013

Browse files
Extract articles/list partial
1 parent ef241f2 commit 3c8d013

File tree

2 files changed

+52
-44
lines changed

2 files changed

+52
-44
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<%# locals: (articles:, title:, subtitle:, feed_url:, json_feed_url:) %>
2+
3+
<% content_for :head do %>
4+
<%= rel_next_prev_link_tags articles %>
5+
<% end %>
6+
7+
<% content_for :auto_discovery do %>
8+
<%= auto_discovery_link_tag :atom, feed_url, title: page_title %>
9+
<%= auto_discovery_link_tag nil, json_feed_url, { type: "application/json", title: page_title } %>
10+
<% end %>
11+
12+
<div class='container'>
13+
<div class='row'>
14+
<div class='col-md-6 col-lg-8'>
15+
<header class='titles pb-3 mb-4 border-bottom'>
16+
<h1><%= title %></h1>
17+
<h2 class='fw-light'><%= subtitle %></h2>
18+
</header>
19+
20+
<div class='h-feed'>
21+
<% articles.each do |article| %>
22+
<%= render_themed 'articles/article', article: article %>
23+
<% end %>
24+
</div>
25+
26+
<%= paginate articles, theme: 'twitter-bootstrap-4' %>
27+
</div>
28+
29+
<div class='col-md-6 col-lg-4'>
30+
<header class='titles pb-3 mb-2 border-bottom fw-normal'>
31+
<h1 class='fw-normal'>See also…</h1>
32+
<h2 class='fw-normal'>Explore The Archives</h2>
33+
</header>
34+
35+
<div id='categories' class='mb-5 pt-3'>
36+
<h2 class='h4 fw-bold'><%= link_to tt(:categories_heading), '#categories' %></h2>
37+
<%= render_themed 'categories/list', categories: @categories %>
38+
</div>
39+
40+
<div id='years' class='mb-5 pt-3'>
41+
<h2 class='h4 fw-bold'><%= link_to tt(:chronological_heading), '#years' %></h2>
42+
<%= render_themed 'years/list', years: @years %>
43+
</div>
44+
</div>
45+
</div><!-- .row -->
46+
</div><!-- .container -->
+6-44
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,6 @@
1-
<% content_for :head do %>
2-
<%= rel_next_prev_link_tags @articles %>
3-
<% end %>
4-
5-
<% content_for :auto_discovery do %>
6-
<%= auto_discovery_link_tag :atom, category_feed_path(@category.slug), title: page_title %>
7-
<%= auto_discovery_link_tag nil, category_feed_path(@category.slug, format: :json), { type: "application/json", title: page_title } %>
8-
<% end %>
9-
10-
<div class='container'>
11-
<div class='row'>
12-
<div class='col-md-6 col-lg-8'>
13-
<header class='titles pb-3 mb-4 border-bottom'>
14-
<h1><%= link_to tt(:categories), :categories %></h1>
15-
<h2 class='fw-light'><%= @category.name %></h2>
16-
</header>
17-
18-
<div class='h-feed'>
19-
<% @articles.each do |article| %>
20-
<%= render_themed 'articles/article', article: article %>
21-
<% end %>
22-
</div>
23-
24-
<%= paginate @articles, theme: 'twitter-bootstrap-4' %>
25-
</div>
26-
27-
<div class='col-md-6 col-lg-4'>
28-
<header class='titles pb-3 mb-2 border-bottom fw-normal'>
29-
<h1 class='fw-normal'>See also…</h1>
30-
<h2 class='fw-normal'>Explore The Archives</h2>
31-
</header>
32-
33-
<div id='categories' class='mb-5 pt-3'>
34-
<h2 class='h4 fw-bold'><%= link_to tt(:categories_heading), '#categories' %></h2>
35-
<%= render_themed 'categories/list', categories: @categories %>
36-
</div>
37-
38-
<div id='years' class='mb-5 pt-3'>
39-
<h2 class='h4 fw-bold'><%= link_to tt(:chronological_heading), '#years' %></h2>
40-
<%= render_themed 'years/list', years: @years %>
41-
</div>
42-
</div>
43-
</div><!-- .row -->
44-
</div><!-- .container -->
1+
<%= render_themed 'articles/list',
2+
articles: @articles,
3+
title: link_to(tt(:categories), :categories),
4+
subtitle: @category.name,
5+
feed_url: category_feed_path(@category.slug),
6+
json_feed_url: category_feed_path(@category.slug, format: :json) %>

0 commit comments

Comments
 (0)