Merge pull request #4777 from betagouv/fix/4501-instructors-thousand-separators
Les nombres peuvent être copiés/collés sans inclure les espaces des séparateurs de milliers
This commit is contained in:
commit
0a3e0404e7
3 changed files with 12 additions and 1 deletions
|
@ -11,3 +11,8 @@
|
|||
.mb-4 {
|
||||
margin-bottom: 4 * $default-spacer;
|
||||
}
|
||||
|
||||
.numbers-delimiter {
|
||||
display: inline-block;
|
||||
width: 5px;
|
||||
}
|
||||
|
|
6
app/helpers/number_helper.rb
Normal file
6
app/helpers/number_helper.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
module NumberHelper
|
||||
def number_with_html_delimiter(num)
|
||||
# we are using the span delimiter that doesn't insert spaces when copying and pasting the number
|
||||
number_with_delimiter(num, delimiter: tag.span(class: 'numbers-delimiter'))
|
||||
end
|
||||
end
|
|
@ -35,7 +35,7 @@
|
|||
- when TypeDeChamp.type_champs.fetch(:datetime)
|
||||
= c.to_s
|
||||
- when TypeDeChamp.type_champs.fetch(:number)
|
||||
= number_with_delimiter(c.to_s)
|
||||
= number_with_html_delimiter(c.to_s)
|
||||
- else
|
||||
= format_text_value(c.to_s)
|
||||
|
||||
|
|
Loading…
Reference in a new issue