dsfr-view-components 4.1.1 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/app/components/dsfr_component/header_component/operator_image_component.rb +17 -7
- data/app/components/dsfr_component/header_component.html.erb +6 -2
- data/app/components/dsfr_component/header_component.rb +5 -3
- data/app/components/dsfr_component/tile_component.html.erb +12 -10
- data/lib/dsfr/components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 873667314f4b7d169a2d6cd0760fe744fea427da377b58d201aacf3da2aa9d8e
|
|
4
|
+
data.tar.gz: a9ee0eaae9221889fd7a6f2bb0ccf3cf26f9020992a077ce406374058151b08a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5470fa0cf66b1f852849410a34a2759e7fa3f4fe5e07d76e21bd46875f5832a11bd9a163ce34a36b6c91035d6416608dda1f62565753026df6dbf60bbf2cae87
|
|
7
|
+
data.tar.gz: 760dab08a5106766c2a892028841237e47fa21f8fa5cb43cc7a8aa0e4327f5d2a1c252cca54c18caa5a432b44b26bcd939c948bbea35c4cb6fd94ca511d2af0b
|
data/README.md
CHANGED
|
@@ -87,10 +87,16 @@ bundle exec rails server
|
|
|
87
87
|
|
|
88
88
|
Déployer une nouvelle version de la gem :
|
|
89
89
|
|
|
90
|
+
1. Mettre à jour la version dans `lib/dsfr/components/version.rb`
|
|
91
|
+
2. Commiter ce changement
|
|
92
|
+
3. Lancer la commande :
|
|
93
|
+
|
|
90
94
|
```sh
|
|
91
|
-
|
|
95
|
+
bundle exec rake release
|
|
92
96
|
```
|
|
93
97
|
|
|
98
|
+
puis allez sur https://github.com/betagouv/dsfr-view-components/releases pour créer une release manuellement basée sur le tag tout juste créé.
|
|
99
|
+
|
|
94
100
|
## Licence
|
|
95
101
|
|
|
96
102
|
Le code source et la gem sont ouverts sous la licence [MIT](https://opensource.org/licenses/MIT).
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
class DsfrComponent::HeaderComponent::OperatorImageComponent < DsfrComponent::Base
|
|
2
|
-
# @param title [String] Le title du lien vers la page d'accueil du site
|
|
3
2
|
# @param src [String] L'attribut src qui sera passé au tag img
|
|
4
|
-
# @param alt [String] Le texte alternatif qui sera passé au tag img. Il doit impérativement contenir le texte présent dans l
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
# @param alt [String] Le texte alternatif qui sera passé au tag img. Il doit impérativement contenir le texte présent dans l'image.
|
|
4
|
+
# @param href [String, nil] L'URL du lien vers la page d'accueil du site. Passer nil pour ne pas rendre de lien.
|
|
5
|
+
# @param title [String] Le title du lien vers la page d'accueil du site. Ignoré si href est nil.
|
|
6
|
+
def initialize(src:, alt:, href: "/", title: nil, html_attributes: {})
|
|
7
7
|
@src = src
|
|
8
8
|
@alt = alt
|
|
9
|
+
@href = href
|
|
10
|
+
@title = title
|
|
9
11
|
|
|
10
12
|
super(html_attributes: html_attributes)
|
|
11
13
|
end
|
|
12
14
|
|
|
13
15
|
def call
|
|
14
16
|
tag.div(class: "fr-header__operator") do
|
|
15
|
-
|
|
16
|
-
tag.
|
|
17
|
+
if href
|
|
18
|
+
tag.a(href: href, title: title) do
|
|
19
|
+
image_tag
|
|
20
|
+
end
|
|
21
|
+
else
|
|
22
|
+
image_tag
|
|
17
23
|
end
|
|
18
24
|
end
|
|
19
25
|
end
|
|
@@ -24,5 +30,9 @@ class DsfrComponent::HeaderComponent::OperatorImageComponent < DsfrComponent::Ba
|
|
|
24
30
|
|
|
25
31
|
private
|
|
26
32
|
|
|
27
|
-
attr_reader :
|
|
33
|
+
attr_reader :src, :alt, :href, :title
|
|
34
|
+
|
|
35
|
+
def image_tag
|
|
36
|
+
tag.img(class: "fr-responsive-img", src: src, alt: alt, style: "max-width:9.0625rem;")
|
|
37
|
+
end
|
|
28
38
|
end
|
|
@@ -31,9 +31,13 @@
|
|
|
31
31
|
|
|
32
32
|
<% if title %>
|
|
33
33
|
<div class="fr-header__service">
|
|
34
|
-
|
|
34
|
+
<% if href %>
|
|
35
|
+
<a href="<%= href %>" title="Accueil - <%= title %>">
|
|
36
|
+
<p class="fr-header__service-title"><%= title %></p>
|
|
37
|
+
</a>
|
|
38
|
+
<% else %>
|
|
35
39
|
<p class="fr-header__service-title"><%= title %></p>
|
|
36
|
-
|
|
40
|
+
<% end %>
|
|
37
41
|
<% if tagline %>
|
|
38
42
|
<p class="fr-header__service-tagline"><%= tagline %></p>
|
|
39
43
|
<% end %>
|
|
@@ -9,11 +9,13 @@ class DsfrComponent::HeaderComponent < DsfrComponent::Base
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
# @param logo_text [String] Ce texte obligatoire sera affiché en dessous de la Marianne et au dessus de la devise française. C’est généralement un nom de ministère ou d’administration.
|
|
12
|
-
# @param title [String] Le nom du service numérique, titre principal du site.
|
|
12
|
+
# @param title [String] Le nom du service numérique, titre principal du site (optionnel).
|
|
13
|
+
# @param href [String] L'URL de la page d'accueil du site. Par défaut "/". Passer nil pour ne pas rendre de lien.
|
|
13
14
|
# @param tagline [String] La description du service numérique, sous-titre du site (optionnelle).
|
|
14
|
-
def initialize(logo_text:, title: nil, tagline: nil, html_attributes: {})
|
|
15
|
+
def initialize(logo_text:, title: nil, href: "/", tagline: nil, html_attributes: {})
|
|
15
16
|
@logo_text = logo_text
|
|
16
17
|
@title = title
|
|
18
|
+
@href = href
|
|
17
19
|
@tagline = tagline
|
|
18
20
|
|
|
19
21
|
super(html_attributes: html_attributes)
|
|
@@ -21,7 +23,7 @@ class DsfrComponent::HeaderComponent < DsfrComponent::Base
|
|
|
21
23
|
|
|
22
24
|
private
|
|
23
25
|
|
|
24
|
-
attr_reader :logo_text, :title, :tagline
|
|
26
|
+
attr_reader :logo_text, :title, :href, :tagline
|
|
25
27
|
|
|
26
28
|
def default_attributes
|
|
27
29
|
{ class: 'fr-header', role: 'banner' }
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
<%= tag.div(**html_attributes) do %>
|
|
2
2
|
<div class="fr-tile__body">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
<div class="fr-tile__content">
|
|
4
|
+
<%= title_tag(class: "fr-tile__title") do %>
|
|
5
|
+
<a class="fr-tile__link" href="<%= url %>">
|
|
6
|
+
<%= title %>
|
|
7
|
+
</a>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% if description.present? %>
|
|
10
|
+
<p class="fr-tile__desc">
|
|
11
|
+
<%= description %>
|
|
12
|
+
</p>
|
|
13
|
+
<% end %>
|
|
14
|
+
</div>
|
|
13
15
|
</div>
|
|
14
16
|
<% if image_src.present? %>
|
|
15
17
|
<div class="fr-tile__img">
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dsfr-view-components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.1.
|
|
4
|
+
version: 4.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- BetaGouv developers
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-02-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: html-attributes-utils
|