##// END OF EJS Templates
remove trailing white-spaces from projects helper source....
Toshi MARUYAMA -
r5729:40d9d4f08ce7
parent child
Show More
@@ -1,16 +1,16
1 # redMine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006-2011 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.
@@ -20,7 +20,7 module ProjectsHelper
20 return '' unless version && version.is_a?(Version)
20 return '' unless version && version.is_a?(Version)
21 link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, options
21 link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, options
22 end
22 end
23
23
24 def project_settings_tabs
24 def project_settings_tabs
25 tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural},
25 tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural},
26 {:name => 'modules', :action => :select_project_modules, :partial => 'projects/settings/modules', :label => :label_module_plural},
26 {:name => 'modules', :action => :select_project_modules, :partial => 'projects/settings/modules', :label => :label_module_plural},
@@ -32,9 +32,9 module ProjectsHelper
32 {:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural},
32 {:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural},
33 {:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities}
33 {:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities}
34 ]
34 ]
35 tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
35 tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
36 end
36 end
37
37
38 def parent_project_select_tag(project)
38 def parent_project_select_tag(project)
39 selected = project.parent
39 selected = project.parent
40 # retrieve the requested parent project
40 # retrieve the requested parent project
@@ -42,13 +42,13 module ProjectsHelper
42 if parent_id
42 if parent_id
43 selected = (parent_id.blank? ? nil : Project.find(parent_id))
43 selected = (parent_id.blank? ? nil : Project.find(parent_id))
44 end
44 end
45
45
46 options = ''
46 options = ''
47 options << "<option value=''></option>" if project.allowed_parents.include?(nil)
47 options << "<option value=''></option>" if project.allowed_parents.include?(nil)
48 options << project_tree_options_for_select(project.allowed_parents.compact, :selected => selected)
48 options << project_tree_options_for_select(project.allowed_parents.compact, :selected => selected)
49 content_tag('select', options, :name => 'project[parent_id]', :id => 'project_parent_id')
49 content_tag('select', options, :name => 'project[parent_id]', :id => 'project_parent_id')
50 end
50 end
51
51
52 # Renders a tree of projects as a nested set of unordered lists
52 # Renders a tree of projects as a nested set of unordered lists
53 # The given collection may be a subset of the whole project tree
53 # The given collection may be a subset of the whole project tree
54 # (eg. some intermediate nodes are private and can not be seen)
54 # (eg. some intermediate nodes are private and can not be seen)
@@ -65,7 +65,7 module ProjectsHelper
65 else
65 else
66 ancestors.pop
66 ancestors.pop
67 s << "</li>"
67 s << "</li>"
68 while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
68 while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
69 ancestors.pop
69 ancestors.pop
70 s << "</ul></li>\n"
70 s << "</ul></li>\n"
71 end
71 end
@@ -93,7 +93,7 module ProjectsHelper
93 if selected && !versions.include?(selected)
93 if selected && !versions.include?(selected)
94 grouped[selected.project.name] << [selected.name, selected.id]
94 grouped[selected.project.name] << [selected.name, selected.id]
95 end
95 end
96
96
97 if grouped.keys.size > 1
97 if grouped.keys.size > 1
98 grouped_options_for_select(grouped, selected && selected.id)
98 grouped_options_for_select(grouped, selected && selected.id)
99 else
99 else
General Comments 0
You need to be logged in to leave comments. Login now