<% content_for :document_ready do %> $('.show_hide_err').click(function(event){ var that = $(this); var prov = $(this).attr('err'); $('#control_errors_list tr').each( function() { $(this).find(':checkbox').prop('checked', 0); }); $('.show_hide_err').each( function() { $(this).removeClass('gras'); } ); $(that).addClass('gras'); if (prov=='cl0') { $("#control_errors_list tr:hidden").each( function() { $(this).show(); } ); } else { $("#control_errors_list tr:visible").each( function() { $(this).hide(); } ); $("."+prov).show(); $("#errtyp").val(prov); } }); $('#selectAll').click(function() { $('.chkbox:checkbox').each( function() { $(this).prop('checked', 0); }); if (this.checked) { $('#control_errors_list tr:visible').each( function() { $(this).find(':checkbox').prop("checked", 1); }); } }); $('#nom_fic').click(function() { var errtyp = $("#errtyp").val(); location.replace('pictures_control?tri=1&errtyp='+errtyp); }); PwStats(); <% end %>

<%=I18n.t('pictures_control')%>


<% tab_ctrl = [[0,'Toutes','cl0'],[1,'Extension non .jpg','cl1'],[1,'Non jpeg','cl2'],[1,'Fichier corrompu','cl3'],[1,'Non RVB','cl4'],[1,'Fichier > 25 Mo','cl5'],[1,'Métadonnées insuffisantes','cl6'], [1,'Date non valide','cl7'],[1,'Photo < 480 px','cl8'],[0,'','cl9'],[0,'','cl10'],[2,'Photo recompressée','cl11'],[1,'Photo grise > 40%','cl12'],[0,'','cl13'], [1,'Image du fichier csv non trouvée','cl14'],[2,"Multiple instances d'IPTC",'cl15'],[2,'HD inférieure à 1200px','cl16'],[1,'Envoi PP2 : Déjà présent sur PixPalace','cl17'], [2,'Métadonnées insuffisantes (base interne)','cl18'],[2,'Photo grise > 10%','cl19'],[2,'Champs IPTC additionnels pour API manquants','cl20'],[1,'Nom de fichier trop long','cl21']] %> <% tab_err6 = ['Aucune métadonnées', 'Aucun champ de crédit', 'Aucun champ de description', 'Aucun champ de crédit, ni de description','URL de la video BD manquante','Identification HD pour API manquante'] %> <%= render 'adm_agency/providers_form', {form_ctrlr_name: 'pictures_control'} unless !session[:pixtech_author].blank? || session[:provs].count <= 1 %>
<% flash.each do |key, value| %>
× <%= value %>
<% end %> <%= @err_id.count %> photos
Non traitées : <% tab_ctrl.each_with_index do |i,index|%> <% if tab_ctrl[index][0]==1 %> <%= tab_ctrl[index][1] %> (<%= @taberr["err#{index}"] %>) <%end%> <% end %>
Traitées avec avertissement : <% tab_ctrl.each_with_index do |i,index|%> <% if tab_ctrl[index][0]==2 %> <% unless session[:pixtech].blank? && index == 18 %> <%= tab_ctrl[index][1] %> (<%= @taberr["err#{index}"] %>) <% end %> <%end%> <% end %>
<%= form_tag '#', name: 'pc_form', id: 'pc_form', target: '_blank' do %> <%= hidden_field_tag :tri, @tri %> <%= hidden_field_tag :msg, '' %> <%= hidden_field_tag :errtyp, @errtyp %>
Appliquer à la sélection  
<% unless @pw_providers.count+@local_providers.count == 1%><% end %>
<%= I18n.t(session[:provider_word], count: 1).capitalize %>Date de réception Erreur / Avertissement Nom du fichier Vignette
<% @err_id.each do |f| %> <% unless @pw_providers.count+@local_providers.count == 1%><% end %> <% end %>
<%= @err_prov[f] %><%= @err_date[f] %> <% if tab_ctrl[@err_code[f]][0]==2 %> <% if @err_code[f] == 6 || @err_code[f] == 18 %> <%= tab_err6[@err_meta_missing[f]] %> <% else %> <%= tab_ctrl[@err_code[f]][1] %> <% end %> <% else %> <% if @err_code[f] == 6 || @err_code[f] == 18 %> <%= tab_err6[@err_meta_missing[f]] %> <% else %> <%= tab_ctrl[@err_code[f]][1] %> <% end %> <% end %> <%= @err_file[f] %> <% unless @err_code[f] < 6 || @err_code[f] == 14 %><% end %> <%= check_box_tag 'del_id[]', "#{f}@@#{@err_im_id[f]}", false, class: 'chkbox' %>
<% end %>