diff options
| author | Teddy Wing | 2017-11-21 12:21:24 +0100 |
|---|---|---|
| committer | Teddy Wing | 2017-11-21 12:21:24 +0100 |
| commit | 706fb9e315eceaa778cbbdafc315a1465f220e20 (patch) | |
| tree | 053dbbc032d18334cb581501e9add619dfff307e /app | |
| parent | acb37189bea8e0bd2c36d9b02042a8e3ee5bb238 (diff) | |
| download | chouette-core-706fb9e315eceaa778cbbdafc315a1465f220e20.tar.bz2 | |
referentials_helper.rb#line_status: Fix style of text label
The label previously took on the colour of the icon (green or red) and
was set in Times/browser default.
It was set in the wrong style because the label was put inside the
`<span>` for the icon. To fix the problem, leave the icon `<span>` empty
and put the label just after it in a text DOM node. This makes the text
label render correctly, in black 14px Open Sans.
Also remove the unnecessary `cls` variables and ternaries as these are
already handled by the outer `if` condition.
Refs #5005
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/referentials_helper.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/referentials_helper.rb b/app/helpers/referentials_helper.rb index f3c18d9f8..d9fb48d01 100644 --- a/app/helpers/referentials_helper.rb +++ b/app/helpers/referentials_helper.rb @@ -2,11 +2,11 @@ module ReferentialsHelper # Line statuses helper def line_status(status) if status - cls = 'danger' - content_tag :span, status ? " #{t('false')} " : " #{t('true')}", class: "fa fa-exclamation-circle fa-lg text-#{cls}" + content_tag(:span, nil, class: 'fa fa-exclamation-circle fa-lg text-danger') + + t('false') else - cls = 'success' - content_tag :span, status ? " #{t('false')} " : " #{t('true')}", class: "fa fa-check-circle fa-lg text-#{cls}" + content_tag(:span, nil, class: 'fa fa-check-circle fa-lg text-success') + + t('true') end end end |
