Skip to content

Commit

Permalink
Merge commit 'd22c0f47f3ea99dbac5987a38bb5ab315b225a53' into feature/…
Browse files Browse the repository at this point in the history
…import-2023-06-06
  • Loading branch information
maatinito committed Aug 28, 2023
2 parents c3078a1 + d22c0f4 commit 188e987
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/assets/stylesheets/menu_component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "colors";

.menu-component-header {
color: $dark-grey;
font-size: 12px;

a {
text-decoration: underline;
}
}
2 changes: 2 additions & 0 deletions app/components/dossiers/export_component.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class Dossiers::ExportComponent < ApplicationComponent
include ApplicationHelper

def initialize(procedure:, exports:, statut: nil, count: nil, class_btn: nil, export_url: nil)
@procedure = procedure
@exports = exports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ en:
download:
one: Download a file
other: Download %{count} files
macros_doc:
title: "Macros documentation"
url: "https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/exports-et-macros"
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ fr:
download:
one: Télécharger un dossier
other: Télécharger %{count} dossiers
macros_doc:
title: "documentation sur les macros"
url: "https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/exports-et-macros"
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
= render Dropdown::MenuComponent.new(wrapper: :span, button_options: { class: ['fr-btn--sm', @class_btn.present? ? @class_btn : 'fr-btn--secondary']}, menu_options: { id: @count.nil? ? "download_menu" : "download_all_menu", class: ['dropdown-export'] }) do |menu|
- menu.with_menu_header_html do
%p.menu-component-header.fr-px-2w.fr-pt-2w.fr-mb-0
%span.fr-icon-info-line{ aria: { hidden: true } }
Des macros ? Lisez la
= link_to('doc', t('.macros_doc.url'),
title: t('.macros_doc.title'),
**external_link_attributes)

- menu.with_button_inner_html do
= @count.nil? ? t(".download_all") : t(".download", count: @count)
- exports.each do |item|
Expand Down
1 change: 1 addition & 0 deletions app/components/dropdown/menu_component.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Dropdown::MenuComponent < ApplicationComponent
renders_one :button_inner_html
renders_one :menu_header_html
# beware, items elements like button_to/link_to must include role: 'menuitem' for aria reason
renders_many :items, -> (options = {}, &block) do
tag.li(**options.merge(role: 'none'), &block)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
= button_inner_html
%div{ data: { menu_button_target: 'menu' }, id: menu_id, 'aria-labelledby': button_id, role: menu_role, 'tab-index': -1, class: menu_class_names }
= menu_header_html
-# the dropdown can be a menu with a list of item
- if items?
Expand Down

0 comments on commit 188e987

Please sign in to comment.