diff options
| author | Marc Florisson | 2014-02-03 16:03:06 +0100 |
|---|---|---|
| committer | Marc Florisson | 2014-02-03 16:03:06 +0100 |
| commit | a96a2e1a2fbd09285a0315fb289fd847cf3e0248 (patch) | |
| tree | dcb72a6c56825a1054fb5f20d538060ab7b02be5 | |
| parent | 5f22f2e49594813d67428d34db590a769a78686b (diff) | |
| download | chouette-core-a96a2e1a2fbd09285a0315fb289fd847cf3e0248.tar.bz2 | |
display line error and cct link on import#show
| -rw-r--r-- | app/helpers/compliance_check_tasks_helper.rb | 7 | ||||
| -rw-r--r-- | app/views/import_tasks/_results_dashboard.html.erb | 3 | ||||
| -rw-r--r-- | app/views/import_tasks/show.html.erb | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/app/helpers/compliance_check_tasks_helper.rb b/app/helpers/compliance_check_tasks_helper.rb index 3aab59452..dd61a4fbe 100644 --- a/app/helpers/compliance_check_tasks_helper.rb +++ b/app/helpers/compliance_check_tasks_helper.rb @@ -2,4 +2,11 @@ module ComplianceCheckTasksHelper include TypeIdsModelsHelper + def button_link_class( compliance_check_task ) + if compliance_check_task.any_error_severity_failure? || compliance_check_task.status == "failed" + "btn-danger" + else + "btn-default" + end + end end diff --git a/app/views/import_tasks/_results_dashboard.html.erb b/app/views/import_tasks/_results_dashboard.html.erb index d1e674964..bde732f73 100644 --- a/app/views/import_tasks/_results_dashboard.html.erb +++ b/app/views/import_tasks/_results_dashboard.html.erb @@ -46,7 +46,8 @@ </thead> <tbody> <% @lines_list.each_with_index do |line, index| %> - <tr> + <% tr_class = (line["status"]=="saved") ? '' : 'class=\'danger\''%> + <tr <%= tr_class %>> <td><%= index + 1 %></td> <td><%= line["name"] %></td> <td><%= t("import_tasks.show.table.line." + line["status"] ) %></td> diff --git a/app/views/import_tasks/show.html.erb b/app/views/import_tasks/show.html.erb index 781b9b07e..81cf175be 100644 --- a/app/views/import_tasks/show.html.erb +++ b/app/views/import_tasks/show.html.erb @@ -4,7 +4,7 @@ <div class="links"> <%= link_to t("import_tasks.show.imported_file"), file_to_import_referential_import_task_path(@import_task.referential, @import_task), :class => "btn btn-default" %> <% if @import_task.compliance_check_task %> - <%= link_to t("import_tasks.compliance_check_task"), referential_compliance_check_task_path(@import_task.referential, @import_task.compliance_check_task), :class => "btn btn-default" %> + <%= link_to t("import_tasks.compliance_check_task"), referential_compliance_check_task_path(@import_task.referential, @import_task.compliance_check_task), :class => "btn #{button_link_class(@import_task.compliance_check_task)}" %> <% end %> </div> <%= render( :partial => "results_dashboard") if @import_task.completed? %> |
