dsfr-assets 1.14.3 → 1.15.0.1
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 +22 -0
- data/lib/dsfr/assets/railtie.rb +5 -1
- data/lib/dsfr/assets/version.rb +2 -1
- data/lib/dsfr/assets.rb +62 -0
- data/vendor/assets/javascripts/dsfr.module.min.js +2 -2
- data/vendor/assets/javascripts/dsfr.nomodule.min.js +2 -2
- data/vendor/assets/stylesheets/dsfr.min.css +12 -8
- data/vendor/assets/stylesheets/dsfr.print.min.css +2 -2
- data/vendor/assets/stylesheets/fonts/Marianne-Bold.woff +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Bold.woff2 +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Bold_Italic.woff +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Bold_Italic.woff2 +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Light.woff +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Light.woff2 +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Light_Italic.woff +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Light_Italic.woff2 +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Medium.woff +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Medium.woff2 +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Medium_Italic.woff +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Medium_Italic.woff2 +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Regular.woff +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Regular.woff2 +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Regular_Italic.woff +0 -0
- data/vendor/assets/stylesheets/fonts/Marianne-Regular_Italic.woff2 +0 -0
- data/vendor/assets/stylesheets/icons/arrows/fr--arrow-right-down-circle-fill.svg +1 -0
- data/vendor/assets/stylesheets/icons/arrows/fr--arrow-right-up-circle-fill.svg +1 -0
- data/vendor/assets/stylesheets/utility/dsfr-utility.min.css +3 -3
- metadata +5 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f90485bfb5d8978aa95970f0e74c0d693439af85948168670970f41689f20620
|
|
4
|
+
data.tar.gz: 51364247bbff8ef54ec353f684cb9f09cec5a9321debe59f4b21ccf5c06a32b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73581a3f11b5ec0ccb2f407a9d089a388ae0c73ff5668d902a3b7dac388b55921447eee0f717fd387ee904f00cefa20ef23e0ee3085715a7a9eb75ae38d14713
|
|
7
|
+
data.tar.gz: '09ada11298dec3740f37f8b1fba9b976a4ed3715a823a28f5657d8e392a224181dd8eb7b06ac838d5f9dfab509bf2ef83b99db0d5c80379ad63dd6c89f2d4542'
|
data/README.md
CHANGED
|
@@ -4,6 +4,16 @@ Cette gem met à disposition les assets du [Système de Design de l'État (DSFR)
|
|
|
4
4
|
|
|
5
5
|
Le numéro de version correspond aux [versions du DSFR](https://github.com/GouvernementFR/dsfr/releases) embarquées.
|
|
6
6
|
|
|
7
|
+
## Licence et droit d'utilisation
|
|
8
|
+
|
|
9
|
+
#### ⚠️ Utilisation interdite en dehors des sites Internet de l'État
|
|
10
|
+
|
|
11
|
+
> Le code du DSFR est sous licence Etalab 2.0 (à l'exception d'éléments soumis à des conditions spécifiques, comme les fontes Marianne), mais son utilisation est encadrée par des [Modalités d'Utilisation](https://github.com/GouvernementFR/dsfr/blob/main/doc/legal/cgu.md). En raison de son rôle de marqueur d'identité visuelle de l'État, le DSFR ne doit pas être utilisé par des entités extérieures à l'administration, et limite sa réplicabilité en dehors d'un nom de domaine en .gouv.fr. En cas d'usage à des fins trompeuses ou frauduleuses, l'État se réserve le droit d'entreprendre les actions nécessaires pour y mettre un terme.
|
|
12
|
+
|
|
13
|
+
#### ⚠️ Prohibited Use Outside Government Websites
|
|
14
|
+
|
|
15
|
+
> The DSFR code is licensed under the Etalab 2.0 licence (excluding assets subject to specific conditions, such as the Marianne fonts), but its use is restricted by specific [terms of use](https://github.com/GouvernementFR/dsfr/blob/main/doc/legal/cgu.md). Given its role as a marker of the French State's visual identity, the DSFR must not be used by entities outside the public administration. It cannot be used outside a .gouv.fr domain name.
|
|
16
|
+
|
|
7
17
|
## Installation
|
|
8
18
|
|
|
9
19
|
```bash
|
|
@@ -15,6 +25,18 @@ bundle add dsfr-assets
|
|
|
15
25
|
|
|
16
26
|
require 'dsfr/assets'
|
|
17
27
|
```
|
|
28
|
+
|
|
29
|
+
Après avoir lu les [modalités d'Utilisation](https://github.com/GouvernementFR/dsfr/blob/main/doc/legal/cgu.md), déclarez votre acceptation dans un initializer :
|
|
30
|
+
|
|
31
|
+
```ruby
|
|
32
|
+
# config/initializers/dsfr_assets.rb
|
|
33
|
+
|
|
34
|
+
Dsfr::Assets.accepted_license_version = "1.0.1"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
En intégration continue, vous pouvez utiliser la variable
|
|
38
|
+
d'environnement `DSFR_ACCEPT_LICENSE=1` à la place.
|
|
39
|
+
|
|
18
40
|
## Usage
|
|
19
41
|
|
|
20
42
|
Dans votre template/layout :
|
data/lib/dsfr/assets/railtie.rb
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
module Dsfr
|
|
4
4
|
module Assets
|
|
5
|
-
#
|
|
5
|
+
# :nodoc:
|
|
6
6
|
class Engine < ::Rails::Railtie
|
|
7
|
+
initializer "dsfr-assets.check_license", after: :load_config_initializers do
|
|
8
|
+
Dsfr::Assets.check_license!
|
|
9
|
+
end
|
|
10
|
+
|
|
7
11
|
initializer "dsfr-assets.paths" do |app|
|
|
8
12
|
app.config.assets.paths << File.expand_path("../../../vendor/assets/stylesheets", __dir__)
|
|
9
13
|
app.config.assets.paths << File.expand_path("../../../vendor/assets/javascripts", __dir__)
|
data/lib/dsfr/assets/version.rb
CHANGED
data/lib/dsfr/assets.rb
CHANGED
|
@@ -2,4 +2,66 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "assets/version"
|
|
4
4
|
|
|
5
|
+
module Dsfr
|
|
6
|
+
# :nodoc:
|
|
7
|
+
module Assets
|
|
8
|
+
class LicenseError < StandardError; end
|
|
9
|
+
|
|
10
|
+
class << self
|
|
11
|
+
attr_writer :accepted_license_version
|
|
12
|
+
|
|
13
|
+
def cgu_url
|
|
14
|
+
"https://github.com/GouvernementFR/dsfr/blob/v#{VERSION}/doc/legal/cgu.md"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def check_license!
|
|
18
|
+
return if license_env_bypass?
|
|
19
|
+
|
|
20
|
+
if @accepted_license_version.nil?
|
|
21
|
+
raise LicenseError, missing_license_message
|
|
22
|
+
elsif @accepted_license_version != CGU_VERSION
|
|
23
|
+
raise LicenseError, license_version_mismatch_message(@accepted_license_version)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
private
|
|
28
|
+
|
|
29
|
+
def license_env_bypass?
|
|
30
|
+
ENV["DSFR_ACCEPT_LICENSE"] == "1"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def missing_license_message
|
|
34
|
+
<<~MSG
|
|
35
|
+
|
|
36
|
+
[dsfr-assets] Vous devez accepter les modalités
|
|
37
|
+
d'utilisation du DSFR (v#{CGU_VERSION}).
|
|
38
|
+
|
|
39
|
+
Lisez-les ici :
|
|
40
|
+
|
|
41
|
+
#{cgu_url}
|
|
42
|
+
|
|
43
|
+
Puis ajoutez dans un initializer Rails :
|
|
44
|
+
Dsfr::Assets.accepted_license_version = "#{CGU_VERSION}"
|
|
45
|
+
MSG
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def license_version_mismatch_message(version)
|
|
49
|
+
<<~MSG
|
|
50
|
+
|
|
51
|
+
[DSFR] La version des modalités d'utilisation acceptée
|
|
52
|
+
("#{version}") ne correspond pas à la
|
|
53
|
+
version requise ("#{CGU_VERSION}").
|
|
54
|
+
|
|
55
|
+
Lisez la nouvelle version ici :
|
|
56
|
+
|
|
57
|
+
#{cgu_url}
|
|
58
|
+
|
|
59
|
+
Puis mettez à jour votre initializer :
|
|
60
|
+
Dsfr::Assets.accepted_license_version = "#{CGU_VERSION}"
|
|
61
|
+
MSG
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
5
67
|
require_relative "assets/railtie" if defined?(Rails::Railtie)
|