Skip to content

Commit

Permalink
Update index slim file
Browse files Browse the repository at this point in the history
  • Loading branch information
martikat committed Apr 18, 2024
1 parent dfb0e72 commit 73d5e64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/helpers/content_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def m(markdown, headings_start_with: 'l')
end

def nav_list(page)
if page.children.any?
if page.children?
[page] + page.children
else
[page.parent] + page.parent.children
Expand Down
12 changes: 7 additions & 5 deletions app/views/pages/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
- content_for(:hero) do
= render partial: 'hero', locals: { hero: page.hero }

- page.pages.each_slice(3).with_index do |row, index|
.govuk-grid-row class=('govuk-!-margin-bottom-6' unless index == (page.pages.count / 3.0 - 1).ceil)
= render partial: 'shared/card', collection: row

= render 'debug'
= m(page.body)

- if page.pages.any?
- page.pages.each_slice(3).with_index do |row, index|
.govuk-grid-row class=('govuk-!-margin-bottom-6' unless index == (page.pages.count / 3.0 - 1).ceil)
= render partial: 'shared/card', collection: row
- else
= m(page.body)

= render 'shared/ctas'

Expand Down

0 comments on commit 73d5e64

Please sign in to comment.