@@ -1,150 +1,156 | |||||
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 | module ApplicationHelper |
|
18 | module ApplicationHelper | |
19 |
|
19 | |||
20 | # Return current logged in user or nil |
|
20 | # Return current logged in user or nil | |
21 | def loggedin? |
|
21 | def loggedin? | |
22 | @logged_in_user |
|
22 | @logged_in_user | |
23 | end |
|
23 | end | |
24 |
|
24 | |||
25 | # Return true if user is logged in and is admin, otherwise false |
|
25 | # Return true if user is logged in and is admin, otherwise false | |
26 | def admin_loggedin? |
|
26 | def admin_loggedin? | |
27 | @logged_in_user and @logged_in_user.admin? |
|
27 | @logged_in_user and @logged_in_user.admin? | |
28 | end |
|
28 | end | |
29 |
|
29 | |||
30 | # Return true if user is authorized for controller/action, otherwise false |
|
30 | # Return true if user is authorized for controller/action, otherwise false | |
31 | def authorize_for(controller, action) |
|
31 | def authorize_for(controller, action) | |
32 | # check if action is allowed on public projects |
|
32 | # check if action is allowed on public projects | |
33 | if @project.is_public? and Permission.allowed_to_public "%s/%s" % [ controller, action ] |
|
33 | if @project.is_public? and Permission.allowed_to_public "%s/%s" % [ controller, action ] | |
34 | return true |
|
34 | return true | |
35 | end |
|
35 | end | |
36 | # check if user is authorized |
|
36 | # check if user is authorized | |
37 | if @logged_in_user and (@logged_in_user.admin? or Permission.allowed_to_role( "%s/%s" % [ controller, action ], @logged_in_user.role_for_project(@project.id) ) ) |
|
37 | if @logged_in_user and (@logged_in_user.admin? or Permission.allowed_to_role( "%s/%s" % [ controller, action ], @logged_in_user.role_for_project(@project.id) ) ) | |
38 | return true |
|
38 | return true | |
39 | end |
|
39 | end | |
40 | return false |
|
40 | return false | |
41 | end |
|
41 | end | |
42 |
|
42 | |||
43 | # Display a link if user is authorized |
|
43 | # Display a link if user is authorized | |
44 | def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference) |
|
44 | def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference) | |
45 | link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller], options[:action]) |
|
45 | link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller], options[:action]) | |
46 | end |
|
46 | end | |
47 |
|
47 | |||
48 | # Display a link to user's account page |
|
48 | # Display a link to user's account page | |
49 | def link_to_user(user) |
|
49 | def link_to_user(user) | |
50 | link_to user.display_name, :controller => 'account', :action => 'show', :id => user |
|
50 | link_to user.display_name, :controller => 'account', :action => 'show', :id => user | |
51 | end |
|
51 | end | |
52 |
|
52 | |||
53 | def format_date(date) |
|
53 | def format_date(date) | |
54 | l_date(date) if date |
|
54 | l_date(date) if date | |
55 | end |
|
55 | end | |
56 |
|
56 | |||
57 | def format_time(time) |
|
57 | def format_time(time) | |
58 | l_datetime(time) if time |
|
58 | l_datetime(time) if time | |
59 | end |
|
59 | end | |
60 |
|
60 | |||
61 | def pagination_links_full(paginator, options={}, html_options={}) |
|
61 | def pagination_links_full(paginator, options={}, html_options={}) | |
62 | html ='' |
|
62 | html ='' | |
63 | html << link_to(('« ' + l(:label_previous) ), { :page => paginator.current.previous }) + ' ' if paginator.current.previous |
|
63 | html << link_to(('« ' + l(:label_previous) ), { :page => paginator.current.previous }) + ' ' if paginator.current.previous | |
64 | html << (pagination_links(paginator, options, html_options) || '') |
|
64 | html << (pagination_links(paginator, options, html_options) || '') | |
65 | html << ' ' + link_to((l(:label_next) + ' »'), { :page => paginator.current.next }) if paginator.current.next |
|
65 | html << ' ' + link_to((l(:label_next) + ' »'), { :page => paginator.current.next }) if paginator.current.next | |
66 | html |
|
66 | html | |
67 | end |
|
67 | end | |
68 |
|
68 | |||
69 | def error_messages_for(object_name, options = {}) |
|
69 | def error_messages_for(object_name, options = {}) | |
70 | options = options.symbolize_keys |
|
70 | options = options.symbolize_keys | |
71 | object = instance_variable_get("@#{object_name}") |
|
71 | object = instance_variable_get("@#{object_name}") | |
72 | if object && !object.errors.empty? |
|
72 | if object && !object.errors.empty? | |
73 | # build full_messages here with controller current language |
|
73 | # build full_messages here with controller current language | |
74 | full_messages = [] |
|
74 | full_messages = [] | |
75 | object.errors.each do |attr, msg| |
|
75 | object.errors.each do |attr, msg| | |
76 | next if msg.nil? |
|
76 | next if msg.nil? | |
77 | if attr == "base" |
|
77 | if attr == "base" | |
78 | full_messages << l(msg) |
|
78 | full_messages << l(msg) | |
79 | else |
|
79 | else | |
80 | full_messages << "« " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " » " + l(msg) unless attr == "custom_values" |
|
80 | full_messages << "« " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " » " + l(msg) unless attr == "custom_values" | |
81 | end |
|
81 | end | |
82 | end |
|
82 | end | |
83 | # retrieve custom values error messages |
|
83 | # retrieve custom values error messages | |
84 | if object.errors[:custom_values] |
|
84 | if object.errors[:custom_values] | |
85 | object.custom_values.each do |v| |
|
85 | object.custom_values.each do |v| | |
86 | v.errors.each do |attr, msg| |
|
86 | v.errors.each do |attr, msg| | |
87 | next if msg.nil? |
|
87 | next if msg.nil? | |
88 | full_messages << "« " + v.custom_field.name + " » " + l(msg) |
|
88 | full_messages << "« " + v.custom_field.name + " » " + l(msg) | |
89 | end |
|
89 | end | |
90 | end |
|
90 | end | |
91 | end |
|
91 | end | |
92 | content_tag("div", |
|
92 | content_tag("div", | |
93 | content_tag( |
|
93 | content_tag( | |
94 | options[:header_tag] || "h2", lwr(:gui_validation_error, full_messages.length) + " :" |
|
94 | options[:header_tag] || "h2", lwr(:gui_validation_error, full_messages.length) + " :" | |
95 | ) + |
|
95 | ) + | |
96 | content_tag("ul", full_messages.collect { |msg| content_tag("li", msg) }), |
|
96 | content_tag("ul", full_messages.collect { |msg| content_tag("li", msg) }), | |
97 | "id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation" |
|
97 | "id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation" | |
98 | ) |
|
98 | ) | |
99 | else |
|
99 | else | |
100 | "" |
|
100 | "" | |
101 | end |
|
101 | end | |
102 | end |
|
102 | end | |
103 |
|
103 | |||
104 | def lang_options_for_select |
|
104 | def lang_options_for_select | |
105 | (GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]} |
|
105 | (GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]} | |
106 | end |
|
106 | end | |
107 |
|
107 | |||
108 | def label_tag_for(name, option_tags = nil, options = {}) |
|
108 | def label_tag_for(name, option_tags = nil, options = {}) | |
109 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") |
|
109 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") | |
110 | content_tag("label", label_text) |
|
110 | content_tag("label", label_text) | |
111 | end |
|
111 | end | |
112 |
|
112 | |||
113 | def labelled_tabular_form_for(name, object, options, &proc) |
|
113 | def labelled_tabular_form_for(name, object, options, &proc) | |
114 | options[:html] ||= {} |
|
114 | options[:html] ||= {} | |
115 | options[:html].store :class, "tabular" |
|
115 | options[:html].store :class, "tabular" | |
116 | form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc) |
|
116 | form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc) | |
117 | end |
|
117 | end | |
|
118 | ||||
|
119 | def check_all_links(form_name) | |||
|
120 | link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") + | |||
|
121 | " | " + | |||
|
122 | link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)") | |||
|
123 | end | |||
118 | end |
|
124 | end | |
119 |
|
125 | |||
120 | class TabularFormBuilder < ActionView::Helpers::FormBuilder |
|
126 | class TabularFormBuilder < ActionView::Helpers::FormBuilder | |
121 | include GLoc |
|
127 | include GLoc | |
122 |
|
128 | |||
123 | def initialize(object_name, object, template, options, proc) |
|
129 | def initialize(object_name, object, template, options, proc) | |
124 | set_language_if_valid options.delete(:lang) |
|
130 | set_language_if_valid options.delete(:lang) | |
125 | @object_name, @object, @template, @options, @proc = object_name, object, template, options, proc |
|
131 | @object_name, @object, @template, @options, @proc = object_name, object, template, options, proc | |
126 | end |
|
132 | end | |
127 |
|
133 | |||
128 | (field_helpers - %w(radio_button) + %w(date_select)).each do |selector| |
|
134 | (field_helpers - %w(radio_button) + %w(date_select)).each do |selector| | |
129 | src = <<-END_SRC |
|
135 | src = <<-END_SRC | |
130 | def #{selector}(field, options = {}) |
|
136 | def #{selector}(field, options = {}) | |
131 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") |
|
137 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") | |
132 | label = @template.content_tag("label", label_text, |
|
138 | label = @template.content_tag("label", label_text, | |
133 | :class => (@object.errors[field] ? "error" : nil), |
|
139 | :class => (@object.errors[field] ? "error" : nil), | |
134 | :for => (@object_name.to_s + "_" + field.to_s)) |
|
140 | :for => (@object_name.to_s + "_" + field.to_s)) | |
135 | label + super |
|
141 | label + super | |
136 | end |
|
142 | end | |
137 | END_SRC |
|
143 | END_SRC | |
138 | class_eval src, __FILE__, __LINE__ |
|
144 | class_eval src, __FILE__, __LINE__ | |
139 | end |
|
145 | end | |
140 |
|
146 | |||
141 | def select(field, choices, options = {}) |
|
147 | def select(field, choices, options = {}) | |
142 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") |
|
148 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") | |
143 | label = @template.content_tag("label", label_text, |
|
149 | label = @template.content_tag("label", label_text, | |
144 | :class => (@object.errors[field] ? "error" : nil), |
|
150 | :class => (@object.errors[field] ? "error" : nil), | |
145 | :for => (@object_name.to_s + "_" + field.to_s)) |
|
151 | :for => (@object_name.to_s + "_" + field.to_s)) | |
146 | label + super |
|
152 | label + super | |
147 | end |
|
153 | end | |
148 |
|
154 | |||
149 | end |
|
155 | end | |
150 |
|
156 |
@@ -1,25 +1,24 | |||||
1 | <h2><%=l(:field_mail_notification)%></h2> |
|
1 | <h2><%=l(:field_mail_notification)%></h2> | |
2 |
|
2 | |||
3 | <p><%=l(:text_select_mail_notifications)%></p> |
|
|||
4 |
|
||||
5 | <%= start_form_tag ({}, :id => 'mail_options_form')%> |
|
3 | <%= start_form_tag ({}, :id => 'mail_options_form')%> | |
6 |
|
4 | |||
|
5 | <div class="box"> | |||
|
6 | <p><%=l(:text_select_mail_notifications)%></p> | |||
|
7 | ||||
7 | <% actions = @actions.group_by {|p| p.group_id } %> |
|
8 | <% actions = @actions.group_by {|p| p.group_id } %> | |
8 | <% actions.keys.sort.each do |group_id| %> |
|
9 | <% actions.keys.sort.each do |group_id| %> | |
9 | <fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend> |
|
10 | <fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend> | |
10 | <% actions[group_id].each do |p| %> |
|
11 | <% actions[group_id].each do |p| %> | |
11 | <div style="width:170px;float:left;"><%= check_box_tag "action_ids[]", p.id, p.mail_enabled? %> |
|
12 | <div style="width:170px;float:left;"><%= check_box_tag "action_ids[]", p.id, p.mail_enabled? %> | |
12 | <%= l(p.description.to_sym) %> |
|
13 | <%= l(p.description.to_sym) %> | |
13 | </div> |
|
14 | </div> | |
14 | <% end %> |
|
15 | <% end %> | |
15 | </fieldset> |
|
16 | </fieldset> | |
16 | <% end %> |
|
17 | <% end %> | |
17 |
|
18 | |||
18 |
|
||||
19 | <br /> |
|
19 | <br /> | |
20 | <p> |
|
20 | <p><%= check_all_links 'mail_options_form' %></p> | |
21 | <a href="javascript:checkAll('mail_options_form', true)"><%=l(:button_check_all)%></a> | |
|
21 | </div> | |
22 | <a href="javascript:checkAll('mail_options_form', false)"><%=l(:button_uncheck_all)%></a> |
|
22 | ||
23 | </p> |
|
|||
24 | <%= submit_tag l(:button_save) %> |
|
23 | <%= submit_tag l(:button_save) %> | |
25 | <%= end_form_tag %> No newline at end of file |
|
24 | <%= end_form_tag %> |
@@ -1,25 +1,25 | |||||
1 | <h2><%=l(:label_change_log)%></h2> |
|
1 | <h2><%=l(:label_change_log)%></h2> | |
2 |
|
2 | |||
3 |
|
||||
4 | <%= start_form_tag %> |
|
3 | <%= start_form_tag %> | |
5 | <% @trackers.each do |tracker| %> |
|
4 | <% @trackers.each do |tracker| %> | |
6 | <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> |
|
5 | <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> | |
7 | <%= tracker.name %> |
|
6 | <%= tracker.name %> | |
8 | <% end %> |
|
7 | <% end %> | |
9 | <%= submit_tag l(:button_apply), :class => 'button-small' %> |
|
8 | <%= submit_tag l(:button_apply), :class => 'button-small' %> | |
10 | <%= end_form_tag %> |
|
9 | <%= end_form_tag %><br /> | |
11 |
|
10 | | ||
12 | <p> </p> |
|
|||
13 |
|
11 | |||
|
12 | <div class="box"> | |||
14 | <% ver_id = nil |
|
13 | <% ver_id = nil | |
15 | @fixed_issues.each do |issue| %> |
|
14 | @fixed_issues.each do |issue| %> | |
16 | <% unless ver_id == issue.fixed_version_id %> |
|
15 | <% unless ver_id == issue.fixed_version_id %> | |
17 | <% if ver_id %></ul><% end %> |
|
16 | <% if ver_id %></ul><% end %> | |
18 | <p><strong><%= issue.fixed_version.name %></strong> - <%= format_date(issue.fixed_version.effective_date) %><br /> |
|
17 | <p><strong><%= issue.fixed_version.name %></strong> - <%= format_date(issue.fixed_version.effective_date) %><br /> | |
19 | <%=h issue.fixed_version.description %></p> |
|
18 | <%=h issue.fixed_version.description %></p> | |
20 | <ul> |
|
19 | <ul> | |
21 | <% ver_id = issue.fixed_version_id |
|
20 | <% ver_id = issue.fixed_version_id | |
22 | end %> |
|
21 | end %> | |
23 | <li><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %> [<%= issue.tracker.name %>]: <%= issue.subject %></li> |
|
22 | <li><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %> [<%= issue.tracker.name %>]: <%= issue.subject %></li> | |
24 | <% end %> |
|
23 | <% end %> | |
25 |
|
24 | |||
|
25 | </div> No newline at end of file |
@@ -1,21 +1,23 | |||||
1 | <h2><%=l(:label_document_plural)%></h2> |
|
1 | <h2><%=l(:label_document_plural)%></h2> | |
2 |
|
2 | |||
|
3 | <% if @documents.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %> | |||
|
4 | ||||
3 | <% documents = @documents.group_by {|d| d.category } %> |
|
5 | <% documents = @documents.group_by {|d| d.category } %> | |
4 | <% documents.each do |category, docs| %> |
|
6 | <% documents.each do |category, docs| %> | |
5 | <h3><%= category.name %></h3> |
|
7 | <h3><%= category.name %></h3> | |
6 | <ul> |
|
8 | <ul> | |
7 | <% docs.each do |d| %> |
|
9 | <% docs.each do |d| %> | |
8 | <li> |
|
10 | <li> | |
9 | <b><%= link_to d.title, :controller => 'documents', :action => 'show', :id => d %></b> |
|
11 | <b><%= link_to d.title, :controller => 'documents', :action => 'show', :id => d %></b> | |
10 | <br /> |
|
12 | <br /> | |
11 | <%=l(:field_description)%>: <%= d.description %><br /> |
|
13 | <%=l(:field_description)%>: <%= d.description %><br /> | |
12 | <%= format_time(d.created_on) %> |
|
14 | <%= format_time(d.created_on) %> | |
13 | </li> |
|
15 | </li> | |
14 |
|
16 | |||
15 | <% end %> |
|
17 | <% end %> | |
16 | </ul> |
|
18 | </ul> | |
17 | <% end %> |
|
19 | <% end %> | |
18 |
|
20 | |||
19 | <p> |
|
21 | <p> | |
20 | <%= link_to_if_authorized '» ' + l(:label_document_new), :controller => 'projects', :action => 'add_document', :id => @project %> |
|
22 | <%= link_to_if_authorized '» ' + l(:label_document_new), :controller => 'projects', :action => 'add_document', :id => @project %> | |
21 | </p> |
|
23 | </p> |
@@ -1,14 +1,16 | |||||
1 | <h2><%=l(:label_news_plural)%></h2> |
|
1 | <h2><%=l(:label_news_plural)%></h2> | |
2 |
|
2 | |||
|
3 | <% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %> | |||
|
4 | ||||
3 | <% for news in @news %> |
|
5 | <% for news in @news %> | |
4 | <p> |
|
6 | <p> | |
5 | <b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br /> |
|
7 | <b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br /> | |
6 | <%= news.summary %><br /> |
|
8 | <%= news.summary %><br /> | |
7 | <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small> |
|
9 | <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small> | |
8 | </p> |
|
10 | </p> | |
9 | <% end %> |
|
11 | <% end %> | |
10 |
|
12 | |||
11 | <%= pagination_links_full @news_pages %> |
|
13 | <%= pagination_links_full @news_pages %> | |
12 | <p> |
|
14 | <p> | |
13 | <%= link_to_if_authorized '» ' + l(:label_news_new), :controller => 'projects', :action => 'add_news', :id => @project %> |
|
15 | <%= link_to_if_authorized '» ' + l(:label_news_new), :controller => 'projects', :action => 'add_news', :id => @project %> | |
14 | </p> |
|
16 | </p> |
@@ -1,72 +1,72 | |||||
1 | <h2><%=l(:label_overview)%></h2> |
|
1 | <h2><%=l(:label_overview)%></h2> | |
2 |
|
2 | |||
3 | <div class="splitcontentleft"> |
|
3 | <div class="splitcontentleft"> | |
4 | <%= @project.description %> |
|
4 | <%= simple_format auto_link @project.description %> | |
5 | <ul> |
|
5 | <ul> | |
6 | <li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li> |
|
6 | <li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li> | |
7 | <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li> |
|
7 | <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li> | |
8 | <% for custom_value in @custom_values %> |
|
8 | <% for custom_value in @custom_values %> | |
9 | <% if !custom_value.value.empty? %> |
|
9 | <% if !custom_value.value.empty? %> | |
10 | <li><%= custom_value.custom_field.name%>: <%= custom_value.value%></li> |
|
10 | <li><%= custom_value.custom_field.name%>: <%= custom_value.value%></li> | |
11 | <% end %> |
|
11 | <% end %> | |
12 | <% end %> |
|
12 | <% end %> | |
13 | </ul> |
|
13 | </ul> | |
14 |
|
14 | |||
15 | <div class="box"> |
|
15 | <div class="box"> | |
16 | <h3><%= image_tag "tracker" %> <%=l(:label_tracker_plural)%></h3> |
|
16 | <h3><%= image_tag "tracker" %> <%=l(:label_tracker_plural)%></h3> | |
17 | <ul> |
|
17 | <ul> | |
18 | <% for tracker in @trackers %> |
|
18 | <% for tracker in @trackers %> | |
19 | <li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project, |
|
19 | <li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project, | |
20 | :set_filter => 1, |
|
20 | :set_filter => 1, | |
21 | "tracker_id" => tracker.id %>: |
|
21 | "tracker_id" => tracker.id %>: | |
22 | <%= issue_count = Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %> |
|
22 | <%= issue_count = Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %> | |
23 | <%= lwr(:label_open_issues, issue_count) %> |
|
23 | <%= lwr(:label_open_issues, issue_count) %> | |
24 | </li> |
|
24 | </li> | |
25 | <% end %> |
|
25 | <% end %> | |
26 | </ul> |
|
26 | </ul> | |
27 | <% if authorize_for 'projects', 'add_issue' %> |
|
27 | <% if authorize_for 'projects', 'add_issue' %> | |
28 | » <%=l(:label_issue_new)%>: |
|
28 | » <%=l(:label_issue_new)%>: | |
29 | <ul> |
|
29 | <ul> | |
30 | <% @trackers.each do |tracker| %> |
|
30 | <% @trackers.each do |tracker| %> | |
31 | <li><%= link_to tracker.name, :controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker %></li> |
|
31 | <li><%= link_to tracker.name, :controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker %></li> | |
32 | <% end %> |
|
32 | <% end %> | |
33 | </ul> |
|
33 | </ul> | |
34 | <% end %> |
|
34 | <% end %> | |
35 | <center><small>[ <%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %> ]</small></center> |
|
35 | <center><small>[ <%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %> ]</small></center> | |
36 | </div> |
|
36 | </div> | |
37 | </div> |
|
37 | </div> | |
38 |
|
38 | |||
39 | <div class="splitcontentright"> |
|
39 | <div class="splitcontentright"> | |
40 | <div class="box"> |
|
40 | <div class="box"> | |
41 | <h3><%= image_tag "users" %> <%=l(:label_member_plural)%></h3> |
|
41 | <h3><%= image_tag "users" %> <%=l(:label_member_plural)%></h3> | |
42 | <% for member in @members %> |
|
42 | <% for member in @members %> | |
43 | <%= link_to_user member.user %> (<%= member.role.name %>)<br /> |
|
43 | <%= link_to_user member.user %> (<%= member.role.name %>)<br /> | |
44 | <% end %> |
|
44 | <% end %> | |
45 | </div> |
|
45 | </div> | |
46 |
|
46 | |||
47 | <% if @subprojects %> |
|
47 | <% if @subprojects %> | |
48 | <div class="box"> |
|
48 | <div class="box"> | |
49 | <h3><%= image_tag "projects" %> <%=l(:label_subproject_plural)%></h3> |
|
49 | <h3><%= image_tag "projects" %> <%=l(:label_subproject_plural)%></h3> | |
50 | <% for subproject in @subprojects %> |
|
50 | <% for subproject in @subprojects %> | |
51 | <%= link_to subproject.name, :action => 'show', :id => subproject %><br /> |
|
51 | <%= link_to subproject.name, :action => 'show', :id => subproject %><br /> | |
52 | <% end %> |
|
52 | <% end %> | |
53 | </div> |
|
53 | </div> | |
54 | <% end %> |
|
54 | <% end %> | |
55 |
|
55 | |||
56 | <div class="box"> |
|
56 | <div class="box"> | |
57 | <h3><%=l(:label_news_latest)%></h3> |
|
57 | <h3><%=l(:label_news_latest)%></h3> | |
58 | <% for news in @news %> |
|
58 | <% for news in @news %> | |
59 | <p><b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br /> |
|
59 | <p><b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br /> | |
60 | <%= news.summary %> |
|
60 | <%= news.summary %> | |
61 | <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small></p> |
|
61 | <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small></p> | |
62 | <hr /> |
|
62 | <hr /> | |
63 | <% end %> |
|
63 | <% end %> | |
64 | <center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center> |
|
64 | <center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center> | |
65 | </div> |
|
65 | </div> | |
66 | </div> |
|
66 | </div> | |
67 |
|
67 | |||
68 |
|
68 | |||
69 |
|
69 | |||
70 |
|
70 | |||
71 |
|
71 | |||
72 |
|
72 |
@@ -1,21 +1,20 | |||||
1 | <%= error_messages_for 'role' %> |
|
1 | <%= error_messages_for 'role' %> | |
2 | <div class="box"> |
|
2 | <div class="box"> | |
3 | <!--[form:role]--> |
|
3 | <!--[form:role]--> | |
4 | <p><%= f.text_field :name, :required => true %></p> |
|
4 | <p><%= f.text_field :name, :required => true %></p> | |
5 |
|
5 | |||
6 | <strong><%=l(:label_permissions)%>:</strong> |
|
6 | <strong><%=l(:label_permissions)%>:</strong> | |
7 | <% permissions = @permissions.group_by {|p| p.group_id } %> |
|
7 | <% permissions = @permissions.group_by {|p| p.group_id } %> | |
8 | <% permissions.keys.sort.each do |group_id| %> |
|
8 | <% permissions.keys.sort.each do |group_id| %> | |
9 | <fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend> |
|
9 | <fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend> | |
10 | <% permissions[group_id].each do |p| %> |
|
10 | <% permissions[group_id].each do |p| %> | |
11 | <div style="width:170px;float:left;"><%= check_box_tag "permission_ids[]", p.id, (@role.permissions.include? p) %> |
|
11 | <div style="width:170px;float:left;"><%= check_box_tag "permission_ids[]", p.id, (@role.permissions.include? p) %> | |
12 | <%= l(p.description.to_sym) %> |
|
12 | <%= l(p.description.to_sym) %> | |
13 | </div> |
|
13 | </div> | |
14 | <% end %> |
|
14 | <% end %> | |
15 | </fieldset> |
|
15 | </fieldset> | |
16 | <% end %> |
|
16 | <% end %> | |
17 | <br /> |
|
17 | <br /> | |
18 | <a href="javascript:checkAll('role_form', true)"><%=l(:button_check_all)%></a> | |
|
18 | <%= check_all_links 'role_form' %> | |
19 | <a href="javascript:checkAll('role_form', false)"><%=l(:button_uncheck_all)%></a><br /> |
|
|||
20 | <!--[eoform:role]--> |
|
19 | <!--[eoform:role]--> | |
21 | </div> |
|
20 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now