Skip to content

Commit

Permalink
fix loop of images in row in array from display view: allows only ima…
Browse files Browse the repository at this point in the history
…ges from the same media. closes #103
  • Loading branch information
numeroteca committed Mar 17, 2013
1 parent 30532df commit 8afd562
Showing 1 changed file with 25 additions and 33 deletions.
58 changes: 25 additions & 33 deletions app/views/coding/display.html.erb
Expand Up @@ -79,23 +79,13 @@
</div>
</div>
<!--End Share buttons-->
<div class="row">
<div class="span3" style="width: 195px; ">
<!-- <h2>Surfaces percentage:</h2> -->
</div>
<div class="" style="/*width: 644px;*/">
<!-- <div id="chart" style="margin-left: 218px;"></div> -->
<div id="chart_div" style="margin-left: 82px;width: 1210px; margin-bottom: -30px;"></div>
</div>
</div>

<!-- <div id="ratios"> -->
<% @ratios.each do |v,r| %>
<% hidden_field_tag "v#{v}", r %>
<% end %>
<!-- </div> -->
<%= hidden_field_tag "number_of_column", @ratios.length %>
<%= hidden_field_tag "number_of_rows", @thread.media.length %>
<!-- <div id="ratios"> -->
<% @ratios.each do |v,r| %>
<% hidden_field_tag "v#{v}", r %>
<% end %>
<!-- </div> -->
<%= hidden_field_tag "number_of_column", @ratios.length %>
<%= hidden_field_tag "number_of_rows", @thread.media.length %>


<div id="ratios">
Expand Down Expand Up @@ -127,27 +117,29 @@
</div>
</div>
<div class="img_box span10" >
<% @thread.images.by_media(m).each_with_index do |image, ic| %>
<div id="<%= "image_box#{ic+1}" %>" style="margin-bottom: 4px" class="span1 <%= "thum_image#{ic+1}" %>" image_name="<%= image.image_name %>">
<a href='<%= "/#{@thread.owner.username.split(' ').join('_')}/#{@thread.thread_name}/coding/?i=#{image.image_name}" %>' title="">
<% @thread.images.each_with_index do |image, ic| %>
<% if @images[ic].media == m %> <!-- only images from that particular media-->
<div id="<%= "image_box#{ic+1}" %>" style="margin-bottom: 4px" class="span1 <%= "thum_image#{ic+1}" %>" image_name="<%= image.image_name %>">
<a href='<%= "/#{@thread.owner.username.split(' ').join('_')}/#{@thread.thread_name}/coding/?i=#{image.image_name}" %>' title="">

<% #image_tag "/assets#{@thread.images[ic].local_path}", id: "image#{ic+1}", style: " opacity: 0.8;", image_size: @images[ic].size%>
<!-- display live version form kiosko, just for the online beta version on heroku -->
<% if @images[ic].local_path == "404.jpg" %>
<img src="/assets/404.jpg" alt="" id="<%= "image#{ic+1}" %>" style=" opacity: 0.7;" image_size="<%= @images[ic].size %>" />
<% else %>
<% if @thread.image_coded? @images[ic] %>
<img src="<%= @images[ic].local_path %>" alt="" id="<%= "image#{ic+1}" %>" class="thum-img" style=" opacity: 0.4;" image_size="<%= @images[ic].size %>" name="<%= @images[ic].image_name %>" />
<% #image_tag "/assets#{@thread.images[ic].local_path}", id: "image#{ic+1}", style: " opacity: 0.8;", image_size: @images[ic].size%>
<!-- display live version form kiosko, just for the online beta version on heroku -->
<% if @images[ic].local_path == "404.jpg" %>
<img src="/assets/404.jpg" alt="" id="<%= "image#{ic+1}" %>" style=" opacity: 0.7;" image_size="<%= @images[ic].size %>" />
<% else %>
<img src="<%= @images[ic].local_path %>" alt="" id="<%= "image#{ic+1}" %>" class="thum-img" style=" opacity: 0.8;" image_size="<%= @images[ic].size %>" name="<%= @images[ic].image_name %>" />
<% if @thread.image_coded? @images[ic] %>
<img src="<%= @images[ic].local_path %>" alt="" id="<%= "image#{ic+1}" %>" class="thum-img" style=" opacity: 0.3;" image_size="<%= @images[ic].size %>" name="<%= @images[ic].image_name %>" />
<% else %>
<img src="<%= @images[ic].local_path %>" alt="" id="<%= "image#{ic+1}" %>" class="thum-img" style=" opacity: 0.7;" image_size="<%= @images[ic].size %>" name="<%= @images[ic].image_name %>" />
<% end %>
<% end %>
<!-- end -->
</a>
<% @thread.highlighted_areas_for_image(image).each do |ha| %>
<div id="<%= "ha_#{ha.id}" %>" style="position: absolute; overflow: hidden; z-index: 0; left: 0px; top: 0px; width: 0px; height: 0px; display: block; opacity: 0.7;" class=""></div>
<% end %>
<!-- end -->
</a>
<% @thread.highlighted_areas_for_image(image).each do |ha| %>
<div id="<%= "ha_#{ha.id}" %>" style="position: absolute; overflow: hidden; z-index: 0; left: 0px; top: 0px; width: 0px; height: 0px; display: block; opacity: 0.7;" class=""></div>
</div>
<% end %>
</div>
<% end %>
</div>
</div>
Expand Down

0 comments on commit 8afd562

Please sign in to comment.