Make the footer links dynamic (#10921)
* fix: end tag not in the correct place :( * feat: update the footer links to be dynamic * feat: make the layout dynamic as well * spec: update * fix: column flow rather than row
This commit is contained in:
parent
c55bd0948f
commit
3ccecfbbb7
4 changed files with 16 additions and 31 deletions
|
|
@ -30,16 +30,18 @@
|
|||
|
||||
&__nav {
|
||||
display: grid;
|
||||
gap: var(--su-4);
|
||||
flex: 1 auto;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
column-gap: var(--su-4);
|
||||
grid-template-rows: repeat(9, 1fr);
|
||||
grid-auto-flow: column;
|
||||
|
||||
@media (min-width: $breakpoint-s) {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: repeat(6, 1fr);
|
||||
column-gap: var(--su-8);
|
||||
}
|
||||
|
||||
@media (min-width: $breakpoint-l) {
|
||||
grid-template-columns: repeat(3, 200px);
|
||||
grid-template-rows: repeat(6, 1fr);
|
||||
column-gap: var(--su-10);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@
|
|||
<%= render "articles/sidebar_nav_link", link: link %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</nav>
|
||||
|
||||
<nav class="sidebar-tags-browser mb-6 overflow-y-auto scrolling-touch" aria-label="Secondary sidebar nav">
|
||||
|
|
|
|||
|
|
@ -11,15 +11,14 @@
|
|||
</div>
|
||||
|
||||
<nav class="crayons-footer__nav">
|
||||
<div>
|
||||
<a href="/" class="crayons-link crayons-link--block">Home</a>
|
||||
<% if user_signed_in? %>
|
||||
<a href="<%= readinglist_path %>" class="crayons-link crayons-link--block">Reading list</a>
|
||||
<% NavigationLink.ordered.each do |link| %>
|
||||
<% if !link.display_only_when_signed_in || (link.display_only_when_signed_in && user_signed_in?) %>
|
||||
<a href="<%= link.url %>" class="crayons-link crayons-link--block">
|
||||
<%= link.name %>
|
||||
</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<a href="<%= listings_path %>" class="crayons-link crayons-link--block">Listings</a>
|
||||
<a href="<%= pod_path %>" class="crayons-link crayons-link--block">Podcasts</a>
|
||||
<a href="<%= videos_path %>" class="crayons-link crayons-link--block">Videos</a>
|
||||
<a href="<%= tags_path %>" class="crayons-link crayons-link--block">Tags</a>
|
||||
<% unless user_signed_in? %>
|
||||
<a href="<%= sign_up_path %>" class="crayons-link crayons-link--block fw-bold">
|
||||
Sign In/Up
|
||||
|
|
@ -27,23 +26,6 @@
|
|||
<% else %>
|
||||
<a href="/new" class="crayons-link crayons-link--block fw-bold">Write a post</a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a href="/code-of-conduct" class="crayons-link crayons-link--block">Code of Conduct</a>
|
||||
<a href="/faq" class="crayons-link crayons-link--block">FAQ</a>
|
||||
<a href="/about" class="crayons-link crayons-link--block">About</a>
|
||||
<a href="/privacy" class="crayons-link crayons-link--block">Privacy policy</a>
|
||||
<a href="/terms" class="crayons-link crayons-link--block">Terms of use</a>
|
||||
<a href="/contact" class="crayons-link crayons-link--block">Contact</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a href="/sponsors" class="crayons-link crayons-link--block">Sponsors</a>
|
||||
<% if SiteConfig.shop_url.present? %>
|
||||
<a href="<%= SiteConfig.shop_url %>" class="crayons-link crayons-link--block"><%= community_name %> Shop</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<% if SiteConfig.mascot_footer_image_url.present? %>
|
||||
|
|
|
|||
|
|
@ -44,8 +44,9 @@ RSpec.describe "StoriesIndex", type: :request do
|
|||
end
|
||||
|
||||
it "renders page with proper sidebar" do
|
||||
navigation_link = create(:navigation_link)
|
||||
get "/"
|
||||
expect(response.body).to include("Podcasts")
|
||||
expect(response.body).to include(navigation_link.name)
|
||||
end
|
||||
|
||||
it "renders left display_ads when published and approved" do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue