##// END OF EJS Templates
Unlimited and optional project description. The project list will show truncated descriptions only (the first fews lines)....
Jean-Philippe Lang -
r1074:df99d8f30801
parent child
Show More
@@ -0,0 +1,8
1 class ChangeProjectsDescriptionToText < ActiveRecord::Migration
2 def self.up
3 change_column :projects, :description, :text, :default => ''
4 end
5
6 def self.down
7 end
8 end
@@ -1,225 +1,233
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class Project < ActiveRecord::Base
18 class Project < ActiveRecord::Base
19 # Project statuses
19 # Project statuses
20 STATUS_ACTIVE = 1
20 STATUS_ACTIVE = 1
21 STATUS_ARCHIVED = 9
21 STATUS_ARCHIVED = 9
22
22
23 has_many :members, :include => :user, :conditions => "#{User.table_name}.status=#{User::STATUS_ACTIVE}"
23 has_many :members, :include => :user, :conditions => "#{User.table_name}.status=#{User::STATUS_ACTIVE}"
24 has_many :users, :through => :members
24 has_many :users, :through => :members
25 has_many :custom_values, :dependent => :delete_all, :as => :customized
25 has_many :custom_values, :dependent => :delete_all, :as => :customized
26 has_many :enabled_modules, :dependent => :delete_all
26 has_many :enabled_modules, :dependent => :delete_all
27 has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
27 has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
28 has_many :issues, :dependent => :destroy, :order => "#{Issue.table_name}.created_on DESC", :include => [:status, :tracker]
28 has_many :issues, :dependent => :destroy, :order => "#{Issue.table_name}.created_on DESC", :include => [:status, :tracker]
29 has_many :issue_changes, :through => :issues, :source => :journals
29 has_many :issue_changes, :through => :issues, :source => :journals
30 has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
30 has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
31 has_many :time_entries, :dependent => :delete_all
31 has_many :time_entries, :dependent => :delete_all
32 has_many :queries, :dependent => :delete_all
32 has_many :queries, :dependent => :delete_all
33 has_many :documents, :dependent => :destroy
33 has_many :documents, :dependent => :destroy
34 has_many :news, :dependent => :delete_all, :include => :author
34 has_many :news, :dependent => :delete_all, :include => :author
35 has_many :issue_categories, :dependent => :delete_all, :order => "#{IssueCategory.table_name}.name"
35 has_many :issue_categories, :dependent => :delete_all, :order => "#{IssueCategory.table_name}.name"
36 has_many :boards, :order => "position ASC"
36 has_many :boards, :order => "position ASC"
37 has_one :repository, :dependent => :destroy
37 has_one :repository, :dependent => :destroy
38 has_many :changesets, :through => :repository
38 has_many :changesets, :through => :repository
39 has_one :wiki, :dependent => :destroy
39 has_one :wiki, :dependent => :destroy
40 # Custom field for the project issues
40 # Custom field for the project issues
41 has_and_belongs_to_many :custom_fields,
41 has_and_belongs_to_many :custom_fields,
42 :class_name => 'IssueCustomField',
42 :class_name => 'IssueCustomField',
43 :order => "#{CustomField.table_name}.position",
43 :order => "#{CustomField.table_name}.position",
44 :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}",
44 :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}",
45 :association_foreign_key => 'custom_field_id'
45 :association_foreign_key => 'custom_field_id'
46
46
47 acts_as_tree :order => "name", :counter_cache => true
47 acts_as_tree :order => "name", :counter_cache => true
48
48
49 acts_as_searchable :columns => ['name', 'description'], :project_key => 'id'
49 acts_as_searchable :columns => ['name', 'description'], :project_key => 'id'
50 acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
50 acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
51 :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
51 :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
52
52
53 attr_protected :status, :enabled_module_names
53 attr_protected :status, :enabled_module_names
54
54
55 validates_presence_of :name, :description, :identifier
55 validates_presence_of :name, :identifier
56 validates_uniqueness_of :name, :identifier
56 validates_uniqueness_of :name, :identifier
57 validates_associated :custom_values, :on => :update
57 validates_associated :custom_values, :on => :update
58 validates_associated :repository, :wiki
58 validates_associated :repository, :wiki
59 validates_length_of :name, :maximum => 30
59 validates_length_of :name, :maximum => 30
60 validates_length_of :description, :maximum => 255
61 validates_length_of :homepage, :maximum => 60
60 validates_length_of :homepage, :maximum => 60
62 validates_length_of :identifier, :in => 3..20
61 validates_length_of :identifier, :in => 3..20
63 validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
62 validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
64
63
65 before_destroy :delete_all_members
64 before_destroy :delete_all_members
66
65
67 def identifier=(identifier)
66 def identifier=(identifier)
68 super unless identifier_frozen?
67 super unless identifier_frozen?
69 end
68 end
70
69
71 def identifier_frozen?
70 def identifier_frozen?
72 errors[:identifier].nil? && !(new_record? || identifier.blank?)
71 errors[:identifier].nil? && !(new_record? || identifier.blank?)
73 end
72 end
74
73
75 def issues_with_subprojects(include_subprojects=false)
74 def issues_with_subprojects(include_subprojects=false)
76 conditions = nil
75 conditions = nil
77 if include_subprojects && !active_children.empty?
76 if include_subprojects && !active_children.empty?
78 ids = [id] + active_children.collect {|c| c.id}
77 ids = [id] + active_children.collect {|c| c.id}
79 conditions = ["#{Issue.table_name}.project_id IN (#{ids.join(',')})"]
78 conditions = ["#{Issue.table_name}.project_id IN (#{ids.join(',')})"]
80 end
79 end
81 conditions ||= ["#{Issue.table_name}.project_id = ?", id]
80 conditions ||= ["#{Issue.table_name}.project_id = ?", id]
82 # Quick and dirty fix for Rails 2 compatibility
81 # Quick and dirty fix for Rails 2 compatibility
83 Issue.send(:with_scope, :find => { :conditions => conditions }) do
82 Issue.send(:with_scope, :find => { :conditions => conditions }) do
84 yield
83 yield
85 end
84 end
86 end
85 end
87
86
88 # Return all issues status changes for the project between the 2 given dates
87 # Return all issues status changes for the project between the 2 given dates
89 def issues_status_changes(from, to)
88 def issues_status_changes(from, to)
90 Journal.find(:all, :include => [:issue, :details, :user],
89 Journal.find(:all, :include => [:issue, :details, :user],
91 :conditions => ["#{Journal.table_name}.journalized_type = 'Issue'" +
90 :conditions => ["#{Journal.table_name}.journalized_type = 'Issue'" +
92 " AND #{Issue.table_name}.project_id = ?" +
91 " AND #{Issue.table_name}.project_id = ?" +
93 " AND #{JournalDetail.table_name}.prop_key = 'status_id'" +
92 " AND #{JournalDetail.table_name}.prop_key = 'status_id'" +
94 " AND #{Journal.table_name}.created_on BETWEEN ? AND ?",
93 " AND #{Journal.table_name}.created_on BETWEEN ? AND ?",
95 id, from, to+1])
94 id, from, to+1])
96 end
95 end
97
96
98 # returns latest created projects
97 # returns latest created projects
99 # non public projects will be returned only if user is a member of those
98 # non public projects will be returned only if user is a member of those
100 def self.latest(user=nil, count=5)
99 def self.latest(user=nil, count=5)
101 find(:all, :limit => count, :conditions => visible_by(user), :order => "created_on DESC")
100 find(:all, :limit => count, :conditions => visible_by(user), :order => "created_on DESC")
102 end
101 end
103
102
104 def self.visible_by(user=nil)
103 def self.visible_by(user=nil)
105 if user && user.admin?
104 if user && user.admin?
106 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
105 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
107 elsif user && user.memberships.any?
106 elsif user && user.memberships.any?
108 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND (#{Project.table_name}.is_public = #{connection.quoted_true} or #{Project.table_name}.id IN (#{user.memberships.collect{|m| m.project_id}.join(',')}))"
107 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND (#{Project.table_name}.is_public = #{connection.quoted_true} or #{Project.table_name}.id IN (#{user.memberships.collect{|m| m.project_id}.join(',')}))"
109 else
108 else
110 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND #{Project.table_name}.is_public = #{connection.quoted_true}"
109 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND #{Project.table_name}.is_public = #{connection.quoted_true}"
111 end
110 end
112 end
111 end
113
112
114 def self.find(*args)
113 def self.find(*args)
115 if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
114 if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
116 project = find_by_identifier(*args)
115 project = find_by_identifier(*args)
117 raise ActiveRecord::RecordNotFound, "Couldn't find Project with identifier=#{args.first}" if project.nil?
116 raise ActiveRecord::RecordNotFound, "Couldn't find Project with identifier=#{args.first}" if project.nil?
118 project
117 project
119 else
118 else
120 super
119 super
121 end
120 end
122 end
121 end
123
122
124 def to_param
123 def to_param
125 identifier
124 identifier
126 end
125 end
127
126
128 def active?
127 def active?
129 self.status == STATUS_ACTIVE
128 self.status == STATUS_ACTIVE
130 end
129 end
131
130
132 def archive
131 def archive
133 # Archive subprojects if any
132 # Archive subprojects if any
134 children.each do |subproject|
133 children.each do |subproject|
135 subproject.archive
134 subproject.archive
136 end
135 end
137 update_attribute :status, STATUS_ARCHIVED
136 update_attribute :status, STATUS_ARCHIVED
138 end
137 end
139
138
140 def unarchive
139 def unarchive
141 return false if parent && !parent.active?
140 return false if parent && !parent.active?
142 update_attribute :status, STATUS_ACTIVE
141 update_attribute :status, STATUS_ACTIVE
143 end
142 end
144
143
145 def active_children
144 def active_children
146 children.select {|child| child.active?}
145 children.select {|child| child.active?}
147 end
146 end
148
147
149 # Returns an array of the trackers used by the project and its sub projects
148 # Returns an array of the trackers used by the project and its sub projects
150 def rolled_up_trackers
149 def rolled_up_trackers
151 @rolled_up_trackers ||=
150 @rolled_up_trackers ||=
152 Tracker.find(:all, :include => :projects,
151 Tracker.find(:all, :include => :projects,
153 :select => "DISTINCT #{Tracker.table_name}.*",
152 :select => "DISTINCT #{Tracker.table_name}.*",
154 :conditions => ["#{Project.table_name}.id = ? OR #{Project.table_name}.parent_id = ?", id, id],
153 :conditions => ["#{Project.table_name}.id = ? OR #{Project.table_name}.parent_id = ?", id, id],
155 :order => "#{Tracker.table_name}.position")
154 :order => "#{Tracker.table_name}.position")
156 end
155 end
157
156
158 # Deletes all project's members
157 # Deletes all project's members
159 def delete_all_members
158 def delete_all_members
160 Member.delete_all(['project_id = ?', id])
159 Member.delete_all(['project_id = ?', id])
161 end
160 end
162
161
163 # Users issues can be assigned to
162 # Users issues can be assigned to
164 def assignable_users
163 def assignable_users
165 members.select {|m| m.role.assignable?}.collect {|m| m.user}.sort
164 members.select {|m| m.role.assignable?}.collect {|m| m.user}.sort
166 end
165 end
167
166
168 # Returns the mail adresses of users that should be always notified on project events
167 # Returns the mail adresses of users that should be always notified on project events
169 def recipients
168 def recipients
170 members.select {|m| m.mail_notification? || m.user.mail_notification?}.collect {|m| m.user.mail}
169 members.select {|m| m.mail_notification? || m.user.mail_notification?}.collect {|m| m.user.mail}
171 end
170 end
172
171
173 # Returns an array of all custom fields enabled for project issues
172 # Returns an array of all custom fields enabled for project issues
174 # (explictly associated custom fields and custom fields enabled for all projects)
173 # (explictly associated custom fields and custom fields enabled for all projects)
175 def custom_fields_for_issues(tracker)
174 def custom_fields_for_issues(tracker)
176 all_custom_fields.select {|c| tracker.custom_fields.include? c }
175 all_custom_fields.select {|c| tracker.custom_fields.include? c }
177 end
176 end
178
177
179 def all_custom_fields
178 def all_custom_fields
180 @all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
179 @all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
181 end
180 end
182
181
183 def <=>(project)
182 def <=>(project)
184 name.downcase <=> project.name.downcase
183 name.downcase <=> project.name.downcase
185 end
184 end
186
185
186 def to_s
187 name
188 end
189
190 # Returns a short description of the projects (first lines)
191 def short_description(length = 255)
192 description.gsub(/^(.{#{length}}[^\n]*).*$/m, '\1').strip if description
193 end
194
187 def allows_to?(action)
195 def allows_to?(action)
188 if action.is_a? Hash
196 if action.is_a? Hash
189 allowed_actions.include? "#{action[:controller]}/#{action[:action]}"
197 allowed_actions.include? "#{action[:controller]}/#{action[:action]}"
190 else
198 else
191 allowed_permissions.include? action
199 allowed_permissions.include? action
192 end
200 end
193 end
201 end
194
202
195 def module_enabled?(module_name)
203 def module_enabled?(module_name)
196 module_name = module_name.to_s
204 module_name = module_name.to_s
197 enabled_modules.detect {|m| m.name == module_name}
205 enabled_modules.detect {|m| m.name == module_name}
198 end
206 end
199
207
200 def enabled_module_names=(module_names)
208 def enabled_module_names=(module_names)
201 enabled_modules.clear
209 enabled_modules.clear
202 module_names = [] unless module_names && module_names.is_a?(Array)
210 module_names = [] unless module_names && module_names.is_a?(Array)
203 module_names.each do |name|
211 module_names.each do |name|
204 enabled_modules << EnabledModule.new(:name => name.to_s)
212 enabled_modules << EnabledModule.new(:name => name.to_s)
205 end
213 end
206 end
214 end
207
215
208 protected
216 protected
209 def validate
217 def validate
210 errors.add(parent_id, " must be a root project") if parent and parent.parent
218 errors.add(parent_id, " must be a root project") if parent and parent.parent
211 errors.add_to_base("A project with subprojects can't be a subproject") if parent and children.size > 0
219 errors.add_to_base("A project with subprojects can't be a subproject") if parent and children.size > 0
212 end
220 end
213
221
214 private
222 private
215 def allowed_permissions
223 def allowed_permissions
216 @allowed_permissions ||= begin
224 @allowed_permissions ||= begin
217 module_names = enabled_modules.collect {|m| m.name}
225 module_names = enabled_modules.collect {|m| m.name}
218 Redmine::AccessControl.modules_permissions(module_names).collect {|p| p.name}
226 Redmine::AccessControl.modules_permissions(module_names).collect {|p| p.name}
219 end
227 end
220 end
228 end
221
229
222 def allowed_actions
230 def allowed_actions
223 @actions_allowed ||= allowed_permissions.inject([]) { |actions, permission| actions += Redmine::AccessControl.allowed_actions(permission) }.flatten
231 @actions_allowed ||= allowed_permissions.inject([]) { |actions, permission| actions += Redmine::AccessControl.allowed_actions(permission) }.flatten
224 end
232 end
225 end
233 end
@@ -1,50 +1,50
1 <div class="contextual">
1 <div class="contextual">
2 <%= link_to l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add' %>
2 <%= link_to l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add' %>
3 </div>
3 </div>
4
4
5 <h2><%=l(:label_project_plural)%></h2>
5 <h2><%=l(:label_project_plural)%></h2>
6
6
7 <% form_tag() do %>
7 <% form_tag() do %>
8 <fieldset><legend><%= l(:label_filter_plural) %></legend>
8 <fieldset><legend><%= l(:label_filter_plural) %></legend>
9 <label><%= l(:field_status) %> :</label>
9 <label><%= l(:field_status) %> :</label>
10 <%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
10 <%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
11 <%= submit_tag l(:button_apply), :class => "small" %>
11 <%= submit_tag l(:button_apply), :class => "small" %>
12 </fieldset>
12 </fieldset>
13 <% end %>
13 <% end %>
14 &nbsp;
14 &nbsp;
15
15
16 <table class="list">
16 <table class="list">
17 <thead><tr>
17 <thead><tr>
18 <%= sort_header_tag('name', :caption => l(:label_project)) %>
18 <%= sort_header_tag('name', :caption => l(:label_project)) %>
19 <th><%=l(:field_description)%></th>
19 <th><%=l(:field_description)%></th>
20 <th><%=l(:field_is_public)%></th>
20 <th><%=l(:field_is_public)%></th>
21 <th><%=l(:label_subproject_plural)%></th>
21 <th><%=l(:label_subproject_plural)%></th>
22 <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
22 <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
23 <th></th>
23 <th></th>
24 <th></th>
24 <th></th>
25 </tr></thead>
25 </tr></thead>
26 <tbody>
26 <tbody>
27 <% for project in @projects %>
27 <% for project in @projects %>
28 <tr class="<%= cycle("odd", "even") %>">
28 <tr class="<%= cycle("odd", "even") %>">
29 <td><%= project.active? ? link_to(h(project.name), :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %>
29 <td><%= project.active? ? link_to(h(project.name), :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %>
30 <td><%= textilizable project.description, :project => project %>
30 <td><%= textilizable project.short_description, :project => project %>
31 <td align="center"><%= image_tag 'true.png' if project.is_public? %>
31 <td align="center"><%= image_tag 'true.png' if project.is_public? %>
32 <td align="center"><%= project.children.size %>
32 <td align="center"><%= project.children.size %>
33 <td align="center"><%= format_date(project.created_on) %>
33 <td align="center"><%= format_date(project.created_on) %>
34 <td align="center" style="width:10%">
34 <td align="center" style="width:10%">
35 <small>
35 <small>
36 <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %>
36 <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %>
37 <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project }, :method => :post, :class => 'icon icon-unlock') if !project.active? && (project.parent.nil? || project.parent.active?) %>
37 <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project }, :method => :post, :class => 'icon icon-unlock') if !project.active? && (project.parent.nil? || project.parent.active?) %>
38 </small>
38 </small>
39 </td>
39 </td>
40 <td align="center" style="width:10%">
40 <td align="center" style="width:10%">
41 <small><%= link_to(l(:button_delete), { :controller => 'projects', :action => 'destroy', :id => project }, :class => 'icon icon-del') %></small>
41 <small><%= link_to(l(:button_delete), { :controller => 'projects', :action => 'destroy', :id => project }, :class => 'icon icon-del') %></small>
42 </td>
42 </td>
43 </tr>
43 </tr>
44 <% end %>
44 <% end %>
45 </tbody>
45 </tbody>
46 </table>
46 </table>
47
47
48 <p class="pagination"><%= pagination_links_full @project_pages, @project_count %></p>
48 <p class="pagination"><%= pagination_links_full @project_pages, @project_count %></p>
49
49
50 <% html_title(l(:label_project_plural)) -%>
50 <% html_title(l(:label_project_plural)) -%>
@@ -1,53 +1,56
1 <%= error_messages_for 'project' %>
1 <%= error_messages_for 'project' %>
2
2
3 <div class="box">
3 <div class="box">
4 <!--[form:project]-->
4 <!--[form:project]-->
5 <p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p>
5 <p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p>
6
6
7 <% if User.current.admin? and !@root_projects.empty? %>
7 <% if User.current.admin? and !@root_projects.empty? %>
8 <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
8 <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
9 <% end %>
9 <% end %>
10
10
11 <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 5 %><em><%= l(:text_caracters_maximum, 255) %></em></p>
11 <p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
12 <p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %><br /><em><%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) unless @project.identifier_frozen? %></em></p>
12 <p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %>
13 <% unless @project.identifier_frozen? %>
14 <br /><em><%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) %></em>
15 <% end %></p>
13 <p><%= f.text_field :homepage, :size => 40 %></p>
16 <p><%= f.text_field :homepage, :size => 40 %></p>
14 <p><%= f.check_box :is_public %></p>
17 <p><%= f.check_box :is_public %></p>
15 <%= wikitoolbar_for 'project_description' %>
18 <%= wikitoolbar_for 'project_description' %>
16
19
17 <% for @custom_value in @custom_values %>
20 <% for @custom_value in @custom_values %>
18 <p><%= custom_field_tag_with_label @custom_value %></p>
21 <p><%= custom_field_tag_with_label @custom_value %></p>
19 <% end %>
22 <% end %>
20 </div>
23 </div>
21
24
22 <% unless @trackers.empty? %>
25 <% unless @trackers.empty? %>
23 <fieldset class="box"><legend><%=l(:label_tracker_plural)%></legend>
26 <fieldset class="box"><legend><%=l(:label_tracker_plural)%></legend>
24 <% @trackers.each do |tracker| %>
27 <% @trackers.each do |tracker| %>
25 <label class="floating">
28 <label class="floating">
26 <%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %>
29 <%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %>
27 <%= tracker %>
30 <%= tracker %>
28 </label>
31 </label>
29 <% end %>
32 <% end %>
30 <%= hidden_field_tag 'project[tracker_ids][]', '' %>
33 <%= hidden_field_tag 'project[tracker_ids][]', '' %>
31 </fieldset>
34 </fieldset>
32 <% end %>
35 <% end %>
33
36
34 <% unless @custom_fields.empty? %>
37 <% unless @custom_fields.empty? %>
35 <fieldset class="box"><legend><%=l(:label_custom_field_plural)%></legend>
38 <fieldset class="box"><legend><%=l(:label_custom_field_plural)%></legend>
36 <% for custom_field in @custom_fields %>
39 <% for custom_field in @custom_fields %>
37 <label class="floating">
40 <label class="floating">
38 <%= check_box_tag 'project[custom_field_ids][]', custom_field.id, ((@project.custom_fields.include? custom_field) or custom_field.is_for_all?), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
41 <%= check_box_tag 'project[custom_field_ids][]', custom_field.id, ((@project.custom_fields.include? custom_field) or custom_field.is_for_all?), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
39 <%= custom_field.name %>
42 <%= custom_field.name %>
40 </label>
43 </label>
41 <% end %>
44 <% end %>
42 <%= hidden_field_tag 'project[custom_field_ids][]', '' %>
45 <%= hidden_field_tag 'project[custom_field_ids][]', '' %>
43 </fieldset>
46 </fieldset>
44 <% end %>
47 <% end %>
45 <!--[eoform:project]-->
48 <!--[eoform:project]-->
46
49
47
50
48 <% content_for :header_tags do %>
51 <% content_for :header_tags do %>
49 <%= javascript_include_tag 'calendar/calendar' %>
52 <%= javascript_include_tag 'calendar/calendar' %>
50 <%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
53 <%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
51 <%= javascript_include_tag 'calendar/calendar-setup' %>
54 <%= javascript_include_tag 'calendar/calendar-setup' %>
52 <%= stylesheet_link_tag 'calendar' %>
55 <%= stylesheet_link_tag 'calendar' %>
53 <% end %>
56 <% end %>
@@ -1,20 +1,20
1 <h2><%=l(:label_project_plural)%></h2>
1 <h2><%=l(:label_project_plural)%></h2>
2
2
3 <% @project_tree.keys.sort.each do |project| %>
3 <% @project_tree.keys.sort.each do |project| %>
4 <h3><%= link_to h(project.name), {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %></h3>
4 <h3><%= link_to h(project.name), {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %></h3>
5 <%= textilizable(project.description, :project => project) %>
5 <%= textilizable(project.short_description, :project => project) %>
6
6
7 <% if @project_tree[project].any? %>
7 <% if @project_tree[project].any? %>
8 <p><%= l(:label_subproject_plural) %>:
8 <p><%= l(:label_subproject_plural) %>:
9 <%= @project_tree[project].sort.collect {|subproject|
9 <%= @project_tree[project].sort.collect {|subproject|
10 link_to(h(subproject.name), {:action => 'show', :id => subproject}, :class => (User.current.member_of?(subproject) ? "icon icon-fav" : ""))}.join(', ') %></p>
10 link_to(h(subproject.name), {:action => 'show', :id => subproject}, :class => (User.current.member_of?(subproject) ? "icon icon-fav" : ""))}.join(', ') %></p>
11 <% end %>
11 <% end %>
12 <% end %>
12 <% end %>
13
13
14 <% if User.current.logged? %>
14 <% if User.current.logged? %>
15 <div class="contextual">
15 <div class="contextual">
16 <span class="icon icon-fav"><%= l(:label_my_projects) %></span>
16 <span class="icon icon-fav"><%= l(:label_my_projects) %></span>
17 </div>
17 </div>
18 <% end %>
18 <% end %>
19
19
20 <% html_title(l(:label_project_plural)) -%>
20 <% html_title(l(:label_project_plural)) -%>
@@ -1,30 +1,30
1 <h2><%= l(:label_home) %></h2>
1 <h2><%= l(:label_home) %></h2>
2
2
3 <div class="splitcontentleft">
3 <div class="splitcontentleft">
4 <%= textilizable Setting.welcome_text %>
4 <%= textilizable Setting.welcome_text %>
5 <% if @news.any? %>
5 <% if @news.any? %>
6 <div class="box">
6 <div class="box">
7 <h3><%=l(:label_news_latest)%></h3>
7 <h3><%=l(:label_news_latest)%></h3>
8 <%= render :partial => 'news/news', :collection => @news %>
8 <%= render :partial => 'news/news', :collection => @news %>
9 <%= link_to l(:label_news_view_all), :controller => 'news' %>
9 <%= link_to l(:label_news_view_all), :controller => 'news' %>
10 </div>
10 </div>
11 <% end %>
11 <% end %>
12 </div>
12 </div>
13
13
14 <div class="splitcontentright">
14 <div class="splitcontentright">
15 <div class="box">
15 <div class="box">
16 <h3 class="icon22 icon22-projects"><%=l(:label_project_latest)%></h3>
16 <h3 class="icon22 icon22-projects"><%=l(:label_project_latest)%></h3>
17 <ul>
17 <ul>
18 <% for project in @projects %>
18 <% for project in @projects %>
19 <li>
19 <li>
20 <%= link_to project.name, :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)
20 <%= link_to project.name, :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)
21 <%= textilizable project.description, :project => project %>
21 <%= textilizable project.short_description, :project => project %>
22 </li>
22 </li>
23 <% end %>
23 <% end %>
24 </ul>
24 </ul>
25 </div>
25 </div>
26 </div>
26 </div>
27
27
28 <% content_for :header_tags do %>
28 <% content_for :header_tags do %>
29 <%= auto_discovery_link_tag(:atom, {:controller => 'news', :action => 'index', :key => User.current.rss_key, :format => 'atom'}, {:title => l(:label_news_latest)}) %>
29 <%= auto_discovery_link_tag(:atom, {:controller => 'news', :action => 'index', :key => User.current.rss_key, :format => 'atom'}, {:title => l(:label_news_latest)}) %>
30 <% end %>
30 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now