<commit_before><div class="wine_actions">
  <span class="action">
  <%= link_to "Écrire une critique", new_wine_review_url(params[:wine_id]), :title => "Écrire une critique", :class => "button reviews" %>
</span>
<% if current_person.andand.in_cellar?(@wine) %>
  Bouteille au cellier!
<% else %>
  <span class="action cellar_results">
    <%= link_to "Ajouter au cellier", "#", :title => "Ajouter au cellier", :class => "button cellar" %>
    <%= image_tag 'loading.gif', :class => 'ajax_loading', :style => "display: none" %>
    <script type="text/javascript">
      $(".ajax_loading").ajaxStart(function(){
          $(this).show();
      });
      $(".ajax_loading").ajaxStop(function(){
          $(this).hide();
      }); 
      $(".wine_actions .cellar_results").click(function() {
          $.ajax({
            url: "<%= person_cellar_wines_url(current_person, :wine_id => @wine.id) %>",
            type: 'post',
            success: function(data) {
              $(".wine_actions .cellar_results").html(data);
            }
          });
      });<commit_msg>fixed bug: do not show cellar button if not logged in<commit_after><div class="wine_actions">
  <span class="action">
  <%= link_to "Écrire une critique", new_wine_review_url(params[:wine_id]), :title => "Écrire une critique", :class => "button reviews" %>
</span>
<% if current_person.andand.in_cellar?(@wine) %>
  Bouteille au cellier!
<% elsif current_person %>
  <span class="action cellar_results">
    <%= link_to "Ajouter au cellier", "#", :title => "Ajouter au cellier", :class => "button cellar" %>
    <%= image_tag 'loading.gif', :class => 'ajax_loading', :style => "display: none" %>
    <script type="text/javascript">
      $(".ajax_loading").ajaxStart(function(){
          $(this).show();
      });
      $(".ajax_loading").ajaxStop(function(){
          $(this).hide();
      }); 
      $(".wine_actions .cellar_results").click(function() {
          $.ajax({
            url: "<%= person_cellar_wines_url(current_person, :wine_id => @wine.id) %>",
            type: 'post',
            success: function(data) {
              $(".wine_actions .cellar_results").html(data);
            }
          });
      });
{'fraction_non_alphanumeric': 0.19318181818181818, 'fraction_numerical': 0.0, 'mean_word_length': 3.031135531135531, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 39, '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': '115118', 'n_tokens_mistral': 729, 'n_tokens_neox': 688, 'n_words': 137}