File tree Expand file tree Collapse file tree 3 files changed +68
-6
lines changed
javascript/css/components Expand file tree Collapse file tree 3 files changed +68
-6
lines changed Original file line number Diff line number Diff line change 131
131
padding-inline-start : var (--space-s );
132
132
}
133
133
}
134
+
135
+ .column-content {
136
+ & li : has (+ li ) {
137
+ margin-bottom : var (--space-xs );
138
+ }
139
+ }
Original file line number Diff line number Diff line change 1
- <%= turbo_frame_tag :topic_articles, class: "row-gap-none", data: {turbo_action: "advance"} do %>
2
- <%= render "topic", topics: @topics %>
3
- <% end %>
1
+ <% topics = @topics %>
2
+
3
+ <%= render Pages::Header.new(title: "Topics") %>
4
+
5
+ <div class ="column-content container py-gap mb-3xl ">
6
+ < nav class ="sidebar " data-turbo-permanent >
7
+ <%= turbo_frame_tag :topics_sidebar do %>
8
+ <% topics . each do |topic | %>
9
+ <%= tag . div id : dom_id ( topic ) , class : "text-small mb-2" do %>
10
+ <%= link_to topic . name , topic_path ( topic ) , data : { turbo_frame : :topics_mainbar } %>
11
+ < span class ="text-faint "> (<%= topic . pages_count %> )</ span >
12
+ <% end %>
13
+ <% end %>
14
+ <% end %>
15
+ </ nav >
16
+ < div class ="mainbar w-full ">
17
+ <%= turbo_frame_tag :topics_mainbar , data : { turbo_action : "advance" } do %>
18
+ < div >
19
+ < h2 > Welcome!</ h2 >
20
+ < div >
21
+ < p > Here you‘ll find topics currently covered at Joy of Rails.</ p >
22
+ < p > Choose a topic from the sidebar to view articles.</ p >
23
+ </ div >
24
+ </ div >
25
+ <% end %>
26
+ </ div >
27
+ </ div >
Original file line number Diff line number Diff line change 1
- <%= turbo_frame_tag :topic_articles, class: "row-gap-none", data: {turbo_action: "advance"} do %>
2
- <%= render @topic, topics: @topics %>
3
- <% end %>
1
+ <% topic = @topic
2
+ topics = @topics %>
3
+
4
+ <%= render Pages::Header.new(title: "Topics") %>
5
+
6
+ <div class ="column-content container py-gap mb-3xl ">
7
+ < nav class ="sidebar " data-turbo-permanent >
8
+ <%= turbo_frame_tag :topics_sidebar , src : topics_path %>
9
+ </ nav >
10
+ < div class ="mainbar w-full ">
11
+ <%= turbo_frame_tag :topics_mainbar , data : { turbo_action : "advance" } do %>
12
+ <% if topic . pages . blank? %>
13
+ < div >
14
+ < h2 > No articles have been added for this topic yet!</ h2 >
15
+ < div >
16
+ < p > Coming soon. Maybe ;)</ p >
17
+ </ div >
18
+ </ div >
19
+ <% else %>
20
+ < ul >
21
+ <% topic . pages . as_published_articles . each do |page | %>
22
+ <%= tag . li id : dom_id ( page ) do %>
23
+ <%= render Pages ::Info . new (
24
+ title : page . title ,
25
+ request_path : page . request_path ,
26
+ description : page . description ,
27
+ image : page . image
28
+ ) %>
29
+ <% end %>
30
+ <% end %>
31
+ </ ul >
32
+ <% end %>
33
+ <% end %>
34
+ </ div >
35
+ </ div >
You can’t perform that action at this time.
0 commit comments