feat(faq): breadcrumb
This commit is contained in:
parent
7a5cb7dbd2
commit
d855c94fbf
6 changed files with 23 additions and 1 deletions
13
app/views/faq/_breadcrumb.html.haml
Normal file
13
app/views/faq/_breadcrumb.html.haml
Normal file
|
@ -0,0 +1,13 @@
|
|||
%nav.fr-breadcrumb{ role: "navigation", 'aria-label': t('you_are_here', scope: [:layouts, :breadcrumb]) }
|
||||
%button.fr-breadcrumb__button{ 'aria-expanded' => "false", 'aria-controls' => "breadcrumb-1" }
|
||||
= t('show', scope: [:layouts, :breadcrumb])
|
||||
.fr-collapse#breadcrumb-1
|
||||
%ol.fr-breadcrumb__list
|
||||
%li= link_to t('root', scope: [:layouts, :breadcrumb]), root_path, class: 'fr-breadcrumb__link'
|
||||
|
||||
%li
|
||||
%a.fr-breadcrumb__link{ **(defined?(faq_title) ? { href: faq_index_path } : { "aria-current": "page" }) }= t('faq', scope: [:layouts, :breadcrumb])
|
||||
|
||||
- if defined?(faq_title)
|
||||
%li
|
||||
%a.fr-breadcrumb__link{ 'aria-current' => "page" }= faq_title
|
|
@ -1,6 +1,7 @@
|
|||
- content_for(:title, t('.meta_title'))
|
||||
|
||||
.fr-container.fr-my-4w
|
||||
= render partial: "breadcrumb"
|
||||
.fr-grid-row
|
||||
.fr-col-12.fr-col-md-10
|
||||
%h1= t('.title', app_name: Current.application_name)
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
- content_for(:title, @metadata[:title])
|
||||
|
||||
.fr-container.fr-my-4w
|
||||
|
||||
.fr-grid-row
|
||||
.fr-col-12.fr-col-md-4
|
||||
= render partial: "sidebar", locals: { faqs: @siblings, current: @metadata }
|
||||
.fr-col-12.fr-col-md-8.fr-py-12v
|
||||
.fr-col-12.fr-col-md-8
|
||||
= render partial: "breadcrumb", locals: { faq_title: "#{t(:short_name, scope: [:faq, :categories, @metadata[:category]])} : #{@metadata[:title]}" }
|
||||
|
||||
.markdown-content
|
||||
= @renderer.render(@content).html_safe
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue