<commit_before><%= form_for( [:admin, @speaker],  html: {class: 'form-horizontal'} ) do |f| %>
  <div class="form-group">
    <%= f.label :photo, 'Photo', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.file_field :photo, "data-show-upload" => "false", class: "btn btn-default file_input" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :name, 'Name*', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :name, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :surname, 'Surname*', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :surname, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :position, 'Position', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :position, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :description, 'Description*', class: "col-lg-2 control-label"%>
    <div class="col-lg-7">
     <%= render "admin/share/wysiwyg" %> 
     <div id="editor" class="well col-md-9 form-control"></div>
    </div>
      <%= hidden_field( :speaker, :description, class: 'wysiwyg_textarea') %>
  </div> 
  <div class="form-group">
    <%= f.label :email, 'Email*', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :email, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :facebook, class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :facebook, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :linkedin, class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :linkedin, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :twitter, class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :twitter, class: "form-control" %>
    </div>
  </div><div class="form-group">
    <%= f.label :site, class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :site, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <div class="col-lg-7 col-lg-offset-2">
      <%= f.submit class: "btn btn-primary" %>
    </div>
  </div>
<% end %>
<commit_msg>Fixed displaying of uploaded speakers photos in form<commit_after><%= form_for( [:admin, @speaker],  html: {class: 'form-horizontal'} ) do |f| %>
  <div class="form-group">
    <%= f.label :photo, 'Photo', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.file_field :photo, "data-show-upload" => "false", "data-show-remove" => "false", class: "btn btn-default speaker file_input" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :name, 'Name*', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :name, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :surname, 'Surname*', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :surname, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :position, 'Position', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :position, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :description, 'Description*', class: "col-lg-2 control-label"%>
    <div class="col-lg-7">
     <%= render "admin/share/wysiwyg" %> 
     <div id="editor" class="well col-md-9 form-control"></div>
    </div>
      <%= hidden_field( :speaker, :description, class: 'wysiwyg_textarea') %>
  </div> 
  <div class="form-group">
    <%= f.label :email, 'Email*', class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :email, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :facebook, class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :facebook, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :linkedin, class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :linkedin, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label :twitter, class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :twitter, class: "form-control" %>
    </div>
  </div><div class="form-group">
    <%= f.label :site, class: "col-lg-2 control-label" %>
    <div class="col-lg-7">
      <%= f.text_field :site, class: "form-control" %>
    </div>
  </div>
  <div class="form-group">
    <div class="col-lg-7 col-lg-offset-2">
      <%= f.submit class: "btn btn-primary" %>
    </div>
  </div>
<% end %>
<script type="text/javascript">
  if ($('.speaker.file_input')) {
    $(".speaker.file_input").fileinput({
      maxFilesNum: 1,
      <% if @speaker.photo.present? %>
        initialPreview: [
          "<img src='<%= @speaker.photo.url %>' class='file-preview-image' style='width:auto;height:160px;' alt='<%= @speaker.photo_file_name %>'>"
        ],
        initialPreviewAsData: true,
        overwriteInitial: true,
        initialCaption: "<%= @speaker.photo_file_name %>"
      <% end %>
    });
  }
</script>

{'fraction_non_alphanumeric': 0.2299168975069252, 'fraction_numerical': 0.009233610341643583, 'mean_word_length': 2.950401167031364, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 154, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1674738', 'n_tokens_mistral': 2170, 'n_tokens_neox': 2054, 'n_words': 411}