@@ -46,23 +46,15 class ProjectsController < ApplicationController | |||
|
46 | 46 | render :action => 'list' unless request.xhr? |
|
47 | 47 | end |
|
48 | 48 | |
|
49 |
# Lists |
|
|
49 | # Lists visible projects | |
|
50 | 50 | def list |
|
51 | sort_init "#{Project.table_name}.name", "asc" | |
|
52 | sort_update | |
|
53 | @project_count = Project.count(:all, :conditions => Project.visible_by(logged_in_user)) | |
|
54 | @project_pages = Paginator.new self, @project_count, | |
|
55 | 15, | |
|
56 | params['page'] | |
|
57 | @projects = Project.find :all, :order => sort_clause, | |
|
58 | :conditions => Project.visible_by(logged_in_user), | |
|
59 | :include => :parent, | |
|
60 | :limit => @project_pages.items_per_page, | |
|
61 | :offset => @project_pages.current.offset | |
|
62 | ||
|
63 | render :action => "list", :layout => false if request.xhr? | |
|
51 | projects = Project.find :all, | |
|
52 | :conditions => Project.visible_by(logged_in_user), | |
|
53 | :include => :parent | |
|
54 | @project_tree = projects.group_by {|p| p.parent || p} | |
|
55 | @project_tree.each_key {|p| @project_tree[p] -= [p]} | |
|
64 | 56 | end |
|
65 | ||
|
57 | ||
|
66 | 58 | # Add a new project |
|
67 | 59 | def add |
|
68 | 60 | @custom_fields = IssueCustomField.find(:all) |
@@ -60,7 +60,12 module IssuesHelper | |||
|
60 | 60 | label = content_tag('strong', label) |
|
61 | 61 | old_value = content_tag("i", h(old_value)) if detail.old_value |
|
62 | 62 | old_value = content_tag("strike", old_value) if detail.old_value and (!detail.value or detail.value.empty?) |
|
63 | value = content_tag("i", h(value)) if value | |
|
63 | if detail.property == 'attachment' && !value.blank? && Attachment.find_by_id(detail.prop_key) | |
|
64 | # Link to the attachment if it has not been removed | |
|
65 | value = link_to(value, :controller => 'attachments', :action => 'download', :id => detail.prop_key) | |
|
66 | else | |
|
67 | value = content_tag("i", h(value)) if value | |
|
68 | end | |
|
64 | 69 | end |
|
65 | 70 | |
|
66 | 71 | if !detail.value.blank? |
@@ -1,30 +1,21 | |||
|
1 | 1 | <h2><%=l(:label_project_plural)%></h2> |
|
2 | 2 | |
|
3 |
< |
|
|
4 | <thead><tr> | |
|
5 | <%= sort_header_tag("#{Project.table_name}.name", :caption => l(:label_project)) %> | |
|
6 | <th><%=l(:field_parent)%></th> | |
|
7 | <%= sort_header_tag("#{Project.table_name}.created_on", :caption => l(:field_created_on)) %> | |
|
8 | </tr></thead> | |
|
9 | <tbody> | |
|
10 | <% for project in @projects %> | |
|
11 | <tr class="<%= cycle("odd", "even") %>"> | |
|
12 | <td> | |
|
13 | <%= link_to project.name, {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %><br /> | |
|
14 | <%= textilizable project.description, :project => project %> | |
|
15 | </td> | |
|
16 | <td><%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %></td> | |
|
17 | <td align="center"><%= format_date(project.created_on) %></td> | |
|
18 | </tr> | |
|
3 | <dl class="projects"> | |
|
4 | <% @project_tree.keys.sort.each do |project| %> | |
|
5 | <dt><%= link_to project.name, {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %> | |
|
6 | <dd><%= textilizable(project.description, :project => project) %> | |
|
7 | ||
|
8 | <% if @project_tree[project].any? %> | |
|
9 | <%= l(:label_subproject_plural) %>: | |
|
10 | <%= @project_tree[project].sort.collect {|subproject| | |
|
11 | link_to(subproject.name, {:action => 'show', :id => subproject}, :class => (User.current.member_of?(subproject) ? "icon icon-fav" : ""))}.join(', ') %> | |
|
12 | <% end %> | |
|
13 | </dd></dt> | |
|
19 | 14 | <% end %> |
|
20 | </tbody> | |
|
21 | </table> | |
|
15 | </dl> | |
|
22 | 16 | |
|
23 | 17 | <% if User.current.logged? %> |
|
24 | 18 | <div class="contextual"> |
|
25 | 19 | <span class="icon icon-fav"><%= l(:label_my_projects) %></span> |
|
26 | 20 | </div> |
|
27 | 21 | <% end %> |
|
28 | ||
|
29 | <%= pagination_links_full @project_pages %> | |
|
30 | [ <%= @project_pages.current.first_item %> - <%= @project_pages.current.last_item %> / <%= @project_count %> ] |
@@ -118,7 +118,6 background-repeat: no-repeat; | |||
|
118 | 118 | padding-left: 20px; |
|
119 | 119 | padding-top: 2px; |
|
120 | 120 | padding-bottom: 3px; |
|
121 | vertical-align: middle; | |
|
122 | 121 | } |
|
123 | 122 | |
|
124 | 123 | #navigation .icon { |
@@ -545,6 +544,9 font-size: 1em; | |||
|
545 | 544 | .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; } |
|
546 | 545 | .milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; } |
|
547 | 546 | |
|
547 | /***** project list *****/ | |
|
548 | dl.projects dt { font-size: 120%; margin-top:1.2em; padding: 2px 2px 4px 2px; background-color:#fafbfc; } | |
|
549 | ||
|
548 | 550 | /***** Tooltips ******/ |
|
549 | 551 | .tooltip{position:relative;z-index:24;} |
|
550 | 552 | .tooltip:hover{z-index:25;color:#000;} |
General Comments 0
You need to be logged in to leave comments.
Login now