##// END OF EJS Templates
Merged r4080 from trunk....
Eric Davis -
r4028:d1952aefb8e3
parent child
Show More
@@ -20,12 +20,4 module AdminHelper
20 options_for_select([[l(:label_all), ''],
20 options_for_select([[l(:label_all), ''],
21 [l(:status_active), 1]], selected)
21 [l(:status_active), 1]], selected)
22 end
22 end
23
24 def css_project_classes(project)
25 s = 'project'
26 s << ' root' if project.root?
27 s << ' child' if project.child?
28 s << (project.leaf? ? ' leaf' : ' parent')
29 s
30 end
31 end
23 end
@@ -412,7 +412,15 class Project < ActiveRecord::Base
412 def short_description(length = 255)
412 def short_description(length = 255)
413 description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
413 description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
414 end
414 end
415
415
416 def css_classes
417 s = 'project'
418 s << ' root' if root?
419 s << ' child' if child?
420 s << (leaf? ? ' leaf' : ' parent')
421 s
422 end
423
416 # Return true if this project is allowed to do the specified action.
424 # Return true if this project is allowed to do the specified action.
417 # action can be:
425 # action can be:
418 # * a parameter-like Hash (eg. :controller => 'projects', :action => 'edit')
426 # * a parameter-like Hash (eg. :controller => 'projects', :action => 'edit')
@@ -26,7 +26,7
26 </tr></thead>
26 </tr></thead>
27 <tbody>
27 <tbody>
28 <% project_tree(@projects) do |project, level| %>
28 <% project_tree(@projects) do |project, level| %>
29 <tr class="<%= cycle("odd", "even") %> <%= css_project_classes(project) %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
29 <tr class="<%= cycle("odd", "even") %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
30 <td class="name"><%= link_to_project(project, :action => 'settings') %></td>
30 <td class="name"><%= link_to_project(project, :action => 'settings') %></td>
31 <td><%= textilizable project.short_description, :project => project %></td>
31 <td><%= textilizable project.short_description, :project => project %></td>
32 <td align="center"><%= checked_image project.is_public? %></td>
32 <td align="center"><%= checked_image project.is_public? %></td>
General Comments 0
You need to be logged in to leave comments. Login now