diff options
| -rw-r--r-- | app/assets/stylesheets/application.sass | 1 | ||||
| -rw-r--r-- | app/assets/stylesheets/base/_config.sass | 4 | ||||
| -rw-r--r-- | app/assets/stylesheets/components/_alerts.sass | 42 | ||||
| -rw-r--r-- | app/helpers/newapplication_helper.rb | 4 | ||||
| -rw-r--r-- | app/views/layouts/_flash_messages.html.slim | 14 | ||||
| -rw-r--r-- | app/views/referentials/show.html.slim | 4 | 
6 files changed, 59 insertions, 10 deletions
| diff --git a/app/assets/stylesheets/application.sass b/app/assets/stylesheets/application.sass index 263302926..df62cea93 100644 --- a/app/assets/stylesheets/application.sass +++ b/app/assets/stylesheets/application.sass @@ -11,6 +11,7 @@  @import 'layout'  @import 'components/buttons' +@import 'components/alerts'  @import 'components/select2'  @import 'components/forms'  @import 'components/tables' diff --git a/app/assets/stylesheets/base/_config.sass b/app/assets/stylesheets/base/_config.sass index 2660ae3cb..0c86270c1 100644 --- a/app/assets/stylesheets/base/_config.sass +++ b/app/assets/stylesheets/base/_config.sass @@ -17,5 +17,5 @@ $blue: #007fbb  $darkgrey: #4b4b4b  $grey: #a4a4a4 -$green: #006d5c -$red: #e22019 +$green: #70b12b +$red: #da2f36 diff --git a/app/assets/stylesheets/components/_alerts.sass b/app/assets/stylesheets/components/_alerts.sass new file mode 100644 index 000000000..ecca87197 --- /dev/null +++ b/app/assets/stylesheets/components/_alerts.sass @@ -0,0 +1,42 @@ +//----------// +//  Alerts  // +//----------// + +.alert +  margin: 0 +  padding: 10px 50px +  border-radius: 0 +  border: none + +  .fa + span +    margin-left: 10px + +  &.alert-dismissible +    padding-right: 70px + +    .close +      font-size: 1em +      text-shadow: none +      top: 3px +      opacity: 1 +      font-weight: 300 + +  &.alert-success +    background-color: $green +    color: #fff + +    .close +      color: darken($green, 5%) + +      &:hover, &:focus +        color: darken($green, 10%) + +  &.alert-danger +    background-color: $red +    color: #fff + +    .close +      color: darken($red, 5%) + +      &:hover, &:focus +        color: darken($red, 10%) diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index e4e0c31a3..42d21105a 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -138,11 +138,11 @@ module NewapplicationHelper            end          elsif action == :archive            unless item.archived? -            content_tag :li, link_to(t("actions.#{action}"), polymorph_url) +            content_tag :li, link_to(t("actions.#{action}"), polymorph_url, method: :put)            end          elsif action == :unarchive            if item.archived? -            content_tag :li, link_to(t("actions.#{action}"), polymorph_url) +            content_tag :li, link_to(t("actions.#{action}"), polymorph_url, method: :put)            end          else            content_tag :li, link_to(t("actions.#{action}"), polymorph_url) diff --git a/app/views/layouts/_flash_messages.html.slim b/app/views/layouts/_flash_messages.html.slim index 3f9ee6203..9d7745076 100644 --- a/app/views/layouts/_flash_messages.html.slim +++ b/app/views/layouts/_flash_messages.html.slim @@ -1,9 +1,15 @@  - flash.each do |name, msg|    - if msg.is_a?(String)      - if name == 'notice' -      .notice.alert class="alert-success" role="alert" -        = content_tag :span, msg +      .alert.alert-success.alert-dismissible role="alert" +        button.close type='button' data-dismiss='alert' aria-label='Fermer' +          span.fa.fa-times-circle aria-hidden='true' +        span.fa.fa-lg.fa-info-circle +        span = msg      - if name == 'error' || name == 'alert' -      .notice.alert class="alert-danger" role="alert" -        = content_tag :span, msg +      .alert.alert-danger.alert-dismissible role="alert" +        button.close type='button' data-dismiss='alert' aria-label='Fermer' +          span.fa.fa-times-circle aria-hidden='true' +        span.fa.fa-lg.fa-exclamation-circle +        span = msg diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim index 6cc6e0ba9..f5c93129a 100644 --- a/app/views/referentials/show.html.slim +++ b/app/views/referentials/show.html.slim @@ -14,9 +14,9 @@        button.btn.btn-primary type='button' data-toggle='modal' data-target='#purgeModal' Purger        - if @referential.archived? -        = link_to t('actions.unarchive'), unarchive_referential_path(@referential.id), class: 'btn btn-primary' +        = link_to t('actions.unarchive'), unarchive_referential_path(@referential.id), method: :put, class: 'btn btn-primary'        - else -        = link_to t('actions.archive'), archive_referential_path(@referential.id), class: 'btn btn-primary' +        = link_to t('actions.archive'), archive_referential_path(@referential.id), method: :put, class: 'btn btn-primary'        = link_to t('actions.destroy'), referential_path(@referential), method: :delete, data: {confirm: t('referentials.actions.destroy_confirm')}, class: 'btn btn-primary' | 
