@@ -20,12 +20,4 module AdminHelper | |||
|
20 | 20 | options_for_select([[l(:label_all), ''], |
|
21 | 21 | [l(:status_active), 1]], selected) |
|
22 | 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 | 23 | end |
@@ -412,7 +412,15 class Project < ActiveRecord::Base | |||
|
412 | 412 | def short_description(length = 255) |
|
413 | 413 | description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description |
|
414 | 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 | 424 | # Return true if this project is allowed to do the specified action. |
|
417 | 425 | # action can be: |
|
418 | 426 | # * a parameter-like Hash (eg. :controller => 'projects', :action => 'edit') |
@@ -26,7 +26,7 | |||
|
26 | 26 | </tr></thead> |
|
27 | 27 | <tbody> |
|
28 | 28 | <% project_tree(@projects) do |project, level| %> |
|
29 |
<tr class="<%= cycle("odd", "even") %> <%= |
|
|
29 | <tr class="<%= cycle("odd", "even") %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> | |
|
30 | 30 | <td class="name"><%= link_to_project(project, :action => 'settings') %></td> |
|
31 | 31 | <td><%= textilizable project.short_description, :project => project %></td> |
|
32 | 32 | <td align="center"><%= checked_image project.is_public? %></td> |
General Comments 0
You need to be logged in to leave comments.
Login now