Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.10 KB | None | 0 0
  1. <% unless @projects.empty? %>
  2.   <table>
  3.     <% number_of_columns = 5 %>
  4.     <% @projects.each_with_index do |project, project_index| %>
  5.  
  6.       <% if (project_index == 0)%>
  7.         <tr>
  8.       <% end %>
  9.       <% if (project_index % number_of_columns == 0) %>
  10.         </tr>
  11.         <tr>
  12.       <% end %>
  13.    
  14.       <td>
  15.         <% project_link_dom_id = "project_link_" + project.id.to_s %>
  16.         <a href="<%= project_path(project) %>" class="invisible_link">
  17.           <%=
  18.             image_tag(
  19.               project.icon.url(:thumbnail),
  20.               {
  21.                 :class => "project_icon",
  22.                 :onmouseover => "toggle_css_class(document.getElementById('#{ project_link_dom_id }'), 'link', 'link_hover');",
  23.                 :onmouseout => "toggle_css_class(document.getElementById('#{ project_link_dom_id }'), 'link', 'link_hover');"
  24.               }
  25.             )
  26.           %>
  27.         </a>
  28.         <br/>
  29.         <%= link_to project.name.downcase, { :action => :show, :id => project}, { :id => project_link_dom_id } -%><br/>
  30.       </td>
  31.     <% end %>
  32.   </table>
  33. <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement