app/views/spree/admin/variants/index.html.erb in spree_backend-3.0.10 vs app/views/spree/admin/variants/index.html.erb in spree_backend-3.1.0.rc1
- old
+ new
@@ -37,11 +37,13 @@
<% end %>
</tbody>
</table>
<% else %>
<div class="no-objects-found alert alert-info">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Variant)) %>,
- <%= link_to(Spree.t(:add_one), spree.new_admin_product_variant_path(@product)) if can? :create, Spree::Variant %>!
+ <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Variant)) %>
+ <% if can?(:create, Spree::Variant) && !@product.empty_option_values? %>
+ - <%= link_to(Spree.t(:add_one), spree.new_admin_product_variant_path(@product)) %>
+ <% end %>!
</div>
<% end %>
<% if @product.empty_option_values? %>
<% if can?(:create, Spree::OptionType) && can?(:create, Spree::OptionValue) %>