OSDN Git Service

classname rename to module_name
[pettanr/pettanr.git] / app / views / provider_statuses / licenses_import.html.erb
index 90e2022..58045d8 100644 (file)
@@ -1,31 +1,15 @@
 <h1><%= t('.title') %></h1>
 <p id="notice"><%= notice %></p>
 
-<% if @failures == nil %>
-  <h1>No Response</h1>
-<% elsif @failures.empty? %>
-  <h2>
-    <%= t('provider_statuses.licenses_import.success') %>
-  </h2>
+<% if @import_result.response? %>
+  <% if @import_result.success? %>
+    <h2>
+      <%= t("provider_statuses.#{@import_result.action}.success") %>
+    </h2>
+  <% else %>
+    <%= render 'import_errors', :import_result => @import_result %>
+    <%= link_to t("provider_statuses.#{@import_result.action}.to_show"), provider_status_path(@provider_status) %>
+  <% end %>
 <% else %>
-  <h2>
-    <%= t('provider_statuses.licenses_import.fail', :size => @failures.size) %>
-  </h2>
-  <table>
-    <tr>
-      <th><%= t_m 'License.caption' -%></th>
-      <th><%= t_m 'License.name' -%></th>
-    </tr>
-    <% @failures.each do |license| %>
-      <tr>
-        <td>
-          <%= link_to h(license['caption']), license['url'] %>
-        </td>
-        <td>
-          <%= h(license['name']) %>
-        </td>
-      </tr>
-    <% end %>
-  </table>
-  <%= link_to t('provider_statuses.licenses_import.to_show'), provider_status_path(@provider_status) %>
+  <h1>No Response</h1>
 <% end %>