diff options
| -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? %> | 
