<commit_before><!--start: Wrapper-->
<div id="wrapper" class="full">       

  <!--start: Row -->
  <div class="row-fluid">

    <div class="span8 separate">

      <%= image_tag(@photo.file.url(:full), class: 'photo annotatable', id: 'photo') %>

      <p>
        <strong>Footer:</strong> <%= raw(@photo.footer) %>
      </p>

      <p>
        Personas relacionadas:
        <% @photo.related_entities.each do |entity| %>
          <%= link_to entity.short_or_long_name, entity_path(entity) %>
        <% end %>
      </p>

      <% if can? :manage, @photo %>
      <p>
        Tags: 
        <% @photo.tag_list.each do |tag| %>
          <%= link_to tag, tagged_photos_path(tag_name: tag) %>
        <% end %>
      </p>
      <p>
        <%= link_to 'Full-resolution link', @photo.file.url %>
      </p>
      <% end %>

      <hr>

      <%= link_to 'Back', photos_path %>

    </div>

  </div>

</div>

<!-- FIXME: Annotorious Proof of Concept. Much improvement left -->
<script>
$(function() {
  // Annotorious seems to break the $ jQuery object, which creates havoc with 
  // other Javascript code, so we load it dynamically after the page is loaded.
  // Interestingly this doesn't happen with the dev (uncompiled) version.
  $.getScript('/javascripts/annotorious/annotorious.min.js', function(data, textStatus){

    jQuery.getScript('/javascripts/annotorious/anno-elasticsearch-plugin.js', function(data, textStatus){
      <% if not can? :manage, @photo %>
      // Set default properties so the widget doesn't come back after annotations loaded
      anno.setProperties = { hide_selection_widget: true, hide_annotations: false };
      // ...and then hide the widget
      anno.hideSelectionWidget();
      <% end %>

      // FIXME: Pointing at a demo server, not production ready
      anno.addPlugin('ElasticSearch', { base_url: 'http://62.218.164.156/annotations/' });
    });

  });  
});
</script>
<style>
  /* FIXME: Clumsy and insecure way of disabling edit buttons in pop-up */
  <% if not can? :manage, @photo %>
  .annotorious-popup-button-edit,
  .annotorious-popup-button-delete {
    display: none;
  }
  <% end %>
</style><commit_msg>Temporarily disable annotation storage, to test Heroku<commit_after><!--start: Wrapper-->
<div id="wrapper" class="full">       

  <!--start: Row -->
  <div class="row-fluid">

    <div class="span8 separate">

      <%= image_tag(@photo.file.url(:full), class: 'photo annotatable', id: 'photo') %>

      <p>
        <strong>Footer:</strong> <%= raw(@photo.footer) %>
      </p>

      <p>
        Personas relacionadas:
        <% @photo.related_entities.each do |entity| %>
          <%= link_to entity.short_or_long_name, entity_path(entity) %>
        <% end %>
      </p>

      <% if can? :manage, @photo %>
      <p>
        Tags: 
        <% @photo.tag_list.each do |tag| %>
          <%= link_to tag, tagged_photos_path(tag_name: tag) %>
        <% end %>
      </p>
      <p>
        <%= link_to 'Full-resolution link', @photo.file.url %>
      </p>
      <% end %>

      <hr>

      <%= link_to 'Back', photos_path %>

    </div>

  </div>

</div>

<!-- FIXME: Annotorious Proof of Concept. Much improvement left -->
<script>
$(function() {
  // Annotorious seems to break the $ jQuery object, which creates havoc with 
  // other Javascript code, so we load it dynamically after the page is loaded.
  // Interestingly this doesn't happen with the dev (uncompiled) version.
  $.getScript('/javascripts/annotorious/annotorious.min.js', function(data, textStatus){

    jQuery.getScript('/javascripts/annotorious/anno-elasticsearch-plugin.js', function(data, textStatus){
      <% if not can? :manage, @photo %>
      // Set default properties so the widget doesn't come back after annotations loaded
      anno.setProperties = { hide_selection_widget: true, hide_annotations: false };
      // ...and then hide the widget
      anno.hideSelectionWidget();
      <% end %>

      // FIXME: Pointing at a demo server, not production ready
      // anno.addPlugin('ElasticSearch', { base_url: 'http://192.168.3.11/annotations/' });
    });

  });  
});
</script>
<style>
  /* FIXME: Clumsy and insecure way of disabling edit buttons in pop-up */
  <% if not can? :manage, @photo %>
  .annotorious-popup-button-edit,
  .annotorious-popup-button-delete {
    display: none;
  }
  <% end %>
</style>
{'fraction_non_alphanumeric': 0.15949656750572083, 'fraction_numerical': 0.005034324942791762, 'mean_word_length': 2.612396694214876, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7634276', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1329, 'n_words': 357}