diff options
| author | jpl | 2017-08-31 14:40:21 +0200 |
|---|---|---|
| committer | jpl | 2017-08-31 14:40:21 +0200 |
| commit | 61fb31f1f6664d2dc47d0b79d5b524d59c7d14bc (patch) | |
| tree | 9c12261f45d3daf4fe8c6e1ce583d840e892bb18 /app | |
| parent | 412861903ed16b52bf57b394b1ea599d56fb75d3 (diff) | |
| download | chouette-core-61fb31f1f6664d2dc47d0b79d5b524d59c7d14bc.tar.bz2 | |
Refs #4369: adding import status helper
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/newapplication_helper.rb | 14 | ||||
| -rw-r--r-- | app/views/imports/index.html.slim | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index df19113db..e6a6f7e11 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -287,4 +287,18 @@ module NewapplicationHelper end end + # Import statuses helper + def import_status(status) + if %w[new running pending].include? status + content_tag :span, '', class: "fa fa-clock-o" + else + cls ='' + cls = 'success' if status == 'successful' + cls = 'warning' if status == 'warning' + cls = 'danger' if %w[failed aborted canceled].include? status + + content_tag :span, '', class: "fa fa-circle text-#{cls}" + end + end + end diff --git a/app/views/imports/index.html.slim b/app/views/imports/index.html.slim index 09014350f..98a0f0108 100644 --- a/app/views/imports/index.html.slim +++ b/app/views/imports/index.html.slim @@ -20,7 +20,7 @@ [ \ TableBuilderHelper::Column.new( \ key: :status, \ - attribute: 'status' \ + attribute: Proc.new { |n| import_status(n.status) }, \ ), \ TableBuilderHelper::Column.new( \ key: :started_at, \ |
