cirandas.net

ref: master

plugins/suppliers/views/suppliers_plugin_myprofile/_supplier.html.erb


<%= if supplier.dummy? then t('views.supplier._supplier.supplier_with_registr') else t('views.supplier._supplier.registered_supplier_i') end %>
<%= link_to supplier.name, supplier.profile.url, :class => 'supplier-name', :target => '_blank' %>
<% if supplier.name_abbreviation %>
<%= t('views.supplier._supplier.abreviated_name') + ' ' %><%= supplier.name_abbreviation %>
<% end %>

<%= supplier.description %>

<%= t('views.supplier._supplier.this_supplier_has') %>
<% products = supplier.consumer.distributed_products.unarchived.from_supplier_id(supplier.id) %> <% if products.size > 0 %> <%= link_to t('views.supplier._supplier.products', count: products.size), {controller: 'suppliers_plugin/product', action: :index, supplier_id: supplier.id}, target: '_blank' %> <%= t('views.supplier._supplier.among_them') %> <% if supplier.dummy? %> <% msg = products.available.size.to_s + t('views.supplier._supplier.products_are_active') %> <% else %> <% msg = products.size.to_s + t('views.supplier._supplier.products_distributed') %> <% end %> <%= link_to msg, {controller: 'suppliers_plugin/product', action: :index, supplier_id: supplier.id}, target: '_blank', class: 'supplier-distributed-products-count' %> <% else %> <%= t('views.supplier._supplier.any_registered_produc') %> <% end %>
<%= t('views.supplier._supplier.actions') %>
<%= link_to_function t('views.supplier._supplier.edit'), '', 'toggle-edit' => '' %>
'><%= link_to_remote t('views.supplier._supplier.deactivate'), :url => {:action => :toggle_active, :id => supplier.id} %>
'><%= link_to_remote t('views.supplier._supplier.activate'), :url => {:action => :toggle_active, :id => supplier.id} %>
<%= link_to_remote t('views.supplier._supplier.disassociate'), :url => {:action => :destroy, :id => supplier.id}, :confirm => t('views.supplier._supplier.by_removing_this_supp'), :class => 'supplier-remove' %>
<%= link_to t('views.supplier._supplier.manage_products'), {controller: 'consumers_coop_plugin_product', action: :index, supplier_id: supplier.id}, target: '_blank' %>
<%# link_to t('views.supplier._supplier.add_product'), {controller: 'consumers_coop_plugin_product', profile: supplier.profile.identifier, action: :new}, target: '_blank' %>
<%= render :partial => 'suppliers_plugin_myprofile/edit', :locals => {:supplier => supplier} %>