<commit_before>- # do some setup
- content_for :head, stylesheet_link_tag('lightbox.css', :plugin => 'natto')
- content_for :javascript, javascript_include_tag('lightbox', 'scriptaculous.js?load=effects,builder', :cache => false, :plugin => 'natto')
- content_for :page_title, "Project: #{@object.title}"
- # collect the current medium, and indexes for the previous/next
- current_medium, previous_medium, next_medium = get_indices(@object.media, params[:medium])
- # retrieve width and height of the current medium
- resized_medium = current_medium.nil? ? nil : current_medium.thumbnails.find_by_thumbnail("resized")
- # drop in margin adjustments to get a horizontal AND vertical center on our medium
- unless current_medium.nil?
  - content_for :head do
    %style{:type => "text/css"}
      = "#media_column_wrapper { width:#{resized_medium.width}px; height:#{resized_medium.height}px; margin-left:-#{resized_medium.width / 2}px; margin-top:-#{resized_medium.height / 2}px; }"
#media_column
  #media_column_wrapper= link_to(image_tag(resized_medium.public_filename, :alt => current_medium.alt_text), current_medium.public_filename(:large), :rel => "lightbox") unless current_medium.nil?
  #previous= link_to("", project_details_path(@object, previous_medium))
  #next= link_to("", project_details_path(@object, next_medium)) unless next_medium.nil?
#information_column
  %h2= @object.client
  %p.big
    %b><
      %em= @object.title
  .separator
  - if current_medium.nil?
    No media have been associated to this project.
    - if logged_in? && current_user.is_administrator?
      = link_to("Manage media", media_project_path(@object))
  %p.small= @object.description
  %ul
    - counter = 0
    - @object.media.each do |medium|
      %li{:class => medium == current_medium ? 'active' : nil}
        = link_to((counter + 1), :medium => counter)
        - counter += 1
  #project_navigation
    = link_to("View full size", current_medium.public_filename, :rel => "lightbox") unless current_medium.nil?
    = link_to("Close", {:controller => 'pages', :action => 'show_by_title', :title => "Portfolio"})
.clear<commit_msg>Added compensations for non-images in projects show.<commit_after>- # do some setup
- content_for :head, stylesheet_link_tag('lightbox.css', :plugin => 'natto')
- content_for :javascript, javascript_include_tag('lightbox', 'scriptaculous.js?load=effects,builder', :cache => false, :plugin => 'natto')
- content_for :page_title, "Project: #{@object.title}"
- # collect the current medium, and indexes for the previous/next
- current_medium, previous_medium, next_medium = get_indices(@object.media, params[:medium])
- # retrieve width and height of the current medium
- if current_medium.is_image?
  - resized_medium = current_medium.nil? ? nil : current_medium.thumbnails.find_by_thumbnail("resized")
  - full_image = current_medium.thumbnails.find_by_thumbnail(Medium::LARGE).public_filename
- elsif current_medium.is_video?
  - full_image = current_medium.public_filename
- # drop in margin adjustments to get a horizontal AND vertical center on our medium
- unless current_medium.nil?
  - content_for :head do
    %style{:type => "text/css"}
      - if current_medium.is_image?
        = "#media_column_wrapper { width:#{resized_medium.width}px; height:#{resized_medium.height}px; margin-left:-#{resized_medium.width / 2}px; margin-top:-#{resized_medium.height / 2}px; }"
        - elsif current_medium.is_video?
          = "#media_column_wrapper { width:320px; height:240px; margin-left:-160px; margin-top:-120px; }"
        - elsif current_medium.is_audio?
          = "#media_column_wrapper { width:320px; height:40px; margin-left:-160px; margin-top:-20px; }"
#media_column
  #media_column_wrapper
    - unless current_medium.nil?
      - if current_medium.is_image?
        = link_to(image_tag(resized_medium.public_filename, :alt => current_medium.alt_text), full_image, :rel => "lightbox")
      - else
        = render :partial => 'shared/embed', :locals => {:medium => current_medium}
  #previous= link_to("", project_details_path(@object, previous_medium))
  #next= link_to("", project_details_path(@object, next_medium)) unless next_medium.nil?
#information_column
  %h2= @object.client
  %p.big
    %b><
      %em= @object.title
  .separator
  - if current_medium.nil?
    No media have been associated to this project.
    - if logged_in? && current_user.is_administrator?
      = link_to("Manage media", media_project_path(@object))
  %ul
    - counter = 0
    - @object.media.each do |medium|
      %li{:class => medium == current_medium ? 'active' : nil}
        = link_to((counter + 1), :medium => counter)
        - counter += 1
  #project_navigation
    = link_to("View full size", full_image, :rel => "lightbox") unless current_medium.nil?
    = link_to("Close", {:controller => 'pages', :action => 'show_by_title', :title => "Portfolio"})
.clear
{'fraction_non_alphanumeric': 0.13848039215686275, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 4.590182648401827, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 32, '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': '6253855', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1550, 'n_words': 346}