##// END OF EJS Templates
Add a time tracking block for 'My page' (#615)....
Jean-Philippe Lang -
r1245:a8fcf8487d41
parent child
Show More
@@ -0,0 +1,52
1 <h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3>
2 <%
3 entries = TimeEntry.find(:all,
4 :conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - 6, Date.today],
5 :include => [:activity, :project, {:issue => [:tracker, :status]}],
6 :order => "#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC")
7 entries_by_day = entries.group_by(&:spent_on)
8 %>
9
10 <div class="total-hours">
11 <p><%= l(:label_total) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p>
12 </div>
13
14 <% if entries.any? %>
15 <table class="list time-entries">
16 <thead>
17 <th><%= l(:label_activity) %></th>
18 <th><%= l(:label_project) %></th>
19 <th><%= l(:field_comments) %></th>
20 <th><%= l(:field_hours) %></th>
21 <th></th>
22 </thead>
23 <tbody>
24 <% entries_by_day.keys.sort.reverse.each do |day| %>
25 <tr class="odd">
26 <td><strong><%= day == Date.today ? l(:label_today).titleize : format_date(day) %></strong></td>
27 <td colspan="2"></td>
28 <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td>
29 <td></td>
30 </tr>
31 <% entries_by_day[day].each do |entry| -%>
32 <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;">
33 <td class="activity"><%=h entry.activity %></td>
34 <td class="subject"><%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :title => h("#{entry.issue.subject} (#{entry.issue.status})")) if entry.issue %></td>
35 <td class="comments"><%=h entry.comments %></td>
36 <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td>
37 <td align="center">
38 <% if entry.editable_by?(@user) -%>
39 <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry},
40 :title => l(:button_edit) %>
41 <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry},
42 :confirm => l(:text_are_you_sure),
43 :method => :post,
44 :title => l(:button_delete) %>
45 <% end -%>
46 </td>
47 </tr>
48 <% end -%>
49 <% end -%>
50 </tbdoy>
51 </table>
52 <% end %>
@@ -1,160 +1,161
1 1 # redMine - project management software
2 2 # Copyright (C) 2006 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 class MyController < ApplicationController
19 19 helper :issues
20 20
21 21 layout 'base'
22 22 before_filter :require_login
23 23
24 24 BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
25 25 'issuesreportedbyme' => :label_reported_issues,
26 26 'issueswatched' => :label_watched_issues,
27 27 'news' => :label_news_latest,
28 28 'calendar' => :label_calendar,
29 'documents' => :label_document_plural
29 'documents' => :label_document_plural,
30 'timelog' => :label_spent_time
30 31 }.freeze
31 32
32 33 DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'],
33 34 'right' => ['issuesreportedbyme']
34 35 }.freeze
35 36
36 37 verify :xhr => true,
37 38 :session => :page_layout,
38 39 :only => [:add_block, :remove_block, :order_blocks]
39 40
40 41 def index
41 42 page
42 43 render :action => 'page'
43 44 end
44 45
45 46 # Show user's page
46 47 def page
47 48 @user = User.current
48 49 @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
49 50 end
50 51
51 52 # Edit user's account
52 53 def account
53 54 @user = User.current
54 55 @pref = @user.pref
55 56 if request.post?
56 57 @user.attributes = params[:user]
57 58 @user.mail_notification = (params[:notification_option] == 'all')
58 59 @user.pref.attributes = params[:pref]
59 60 @user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
60 61 if @user.save
61 62 @user.pref.save
62 63 @user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : [])
63 64 set_language_if_valid @user.language
64 65 flash[:notice] = l(:notice_account_updated)
65 66 redirect_to :action => 'account'
66 67 return
67 68 end
68 69 end
69 70 @notification_options = [[l(:label_user_mail_option_all), 'all'],
70 71 [l(:label_user_mail_option_none), 'none']]
71 72 # Only users that belong to more than 1 project can select projects for which they are notified
72 73 # Note that @user.membership.size would fail since AR ignores :include association option when doing a count
73 74 @notification_options.insert 1, [l(:label_user_mail_option_selected), 'selected'] if @user.memberships.length > 1
74 75 @notification_option = @user.mail_notification? ? 'all' : (@user.notified_projects_ids.empty? ? 'none' : 'selected')
75 76 end
76 77
77 78 # Manage user's password
78 79 def password
79 80 @user = User.current
80 81 flash[:error] = l(:notice_can_t_change_password) and redirect_to :action => 'account' and return if @user.auth_source_id
81 82 if request.post?
82 83 if @user.check_password?(params[:password])
83 84 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
84 85 if @user.save
85 86 flash[:notice] = l(:notice_account_password_updated)
86 87 redirect_to :action => 'account'
87 88 end
88 89 else
89 90 flash[:error] = l(:notice_account_wrong_password)
90 91 end
91 92 end
92 93 end
93 94
94 95 # Create a new feeds key
95 96 def reset_rss_key
96 97 if request.post? && User.current.rss_token
97 98 User.current.rss_token.destroy
98 99 flash[:notice] = l(:notice_feeds_access_key_reseted)
99 100 end
100 101 redirect_to :action => 'account'
101 102 end
102 103
103 104 # User's page layout configuration
104 105 def page_layout
105 106 @user = User.current
106 107 @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT.dup
107 108 session[:page_layout] = @blocks
108 109 %w(top left right).each {|f| session[:page_layout][f] ||= [] }
109 110 @block_options = []
110 111 BLOCKS.each {|k, v| @block_options << [l(v), k]}
111 112 end
112 113
113 114 # Add a block to user's page
114 115 # The block is added on top of the page
115 116 # params[:block] : id of the block to add
116 117 def add_block
117 118 block = params[:block]
118 119 render(:nothing => true) and return unless block && (BLOCKS.keys.include? block)
119 120 @user = User.current
120 121 # remove if already present in a group
121 122 %w(top left right).each {|f| (session[:page_layout][f] ||= []).delete block }
122 123 # add it on top
123 124 session[:page_layout]['top'].unshift block
124 125 render :partial => "block", :locals => {:user => @user, :block_name => block}
125 126 end
126 127
127 128 # Remove a block to user's page
128 129 # params[:block] : id of the block to remove
129 130 def remove_block
130 131 block = params[:block]
131 132 # remove block in all groups
132 133 %w(top left right).each {|f| (session[:page_layout][f] ||= []).delete block }
133 134 render :nothing => true
134 135 end
135 136
136 137 # Change blocks order on user's page
137 138 # params[:group] : group to order (top, left or right)
138 139 # params[:list-(top|left|right)] : array of block ids of the group
139 140 def order_blocks
140 141 group = params[:group]
141 142 group_items = params["list-#{group}"]
142 143 if group_items and group_items.is_a? Array
143 144 # remove group blocks if they are presents in other groups
144 145 %w(top left right).each {|f|
145 146 session[:page_layout][f] = (session[:page_layout][f] || []) - group_items
146 147 }
147 148 session[:page_layout][group] = group_items
148 149 end
149 150 render :nothing => true
150 151 end
151 152
152 153 # Save user's page layout
153 154 def page_layout_save
154 155 @user = User.current
155 156 @user.pref[:my_page_layout] = session[:page_layout] if session[:page_layout]
156 157 @user.pref.save
157 158 session[:page_layout] = nil
158 159 redirect_to :action => 'page'
159 160 end
160 161 end
@@ -1,239 +1,241
1 1 # redMine - project management software
2 2 # Copyright (C) 2006-2007 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 class TimelogController < ApplicationController
19 19 layout 'base'
20 20 menu_item :issues
21 21 before_filter :find_project, :authorize
22 22
23 23 verify :method => :post, :only => :destroy, :redirect_to => { :action => :details }
24 24
25 25 helper :sort
26 26 include SortHelper
27 27 helper :issues
28 28 include TimelogHelper
29 29
30 30 def report
31 31 @available_criterias = { 'project' => {:sql => "#{TimeEntry.table_name}.project_id",
32 32 :klass => Project,
33 33 :label => :label_project},
34 34 'version' => {:sql => "#{Issue.table_name}.fixed_version_id",
35 35 :klass => Version,
36 36 :label => :label_version},
37 37 'category' => {:sql => "#{Issue.table_name}.category_id",
38 38 :klass => IssueCategory,
39 39 :label => :field_category},
40 40 'member' => {:sql => "#{TimeEntry.table_name}.user_id",
41 41 :klass => User,
42 42 :label => :label_member},
43 43 'tracker' => {:sql => "#{Issue.table_name}.tracker_id",
44 44 :klass => Tracker,
45 45 :label => :label_tracker},
46 46 'activity' => {:sql => "#{TimeEntry.table_name}.activity_id",
47 47 :klass => Enumeration,
48 48 :label => :label_activity}
49 49 }
50 50
51 51 @criterias = params[:criterias] || []
52 52 @criterias = @criterias.select{|criteria| @available_criterias.has_key? criteria}
53 53 @criterias.uniq!
54 54 @criterias = @criterias[0,3]
55 55
56 56 @columns = (params[:period] && %w(year month week).include?(params[:period])) ? params[:period] : 'month'
57 57
58 58 if params[:date_from]
59 59 begin; @date_from = params[:date_from].to_date; rescue; end
60 60 end
61 61 if params[:date_to]
62 62 begin; @date_to = params[:date_to].to_date; rescue; end
63 63 end
64 64 @date_from ||= Date.civil(Date.today.year, 1, 1)
65 65 @date_to ||= (Date.civil(Date.today.year, Date.today.month, 1) >> 1) - 1
66 66
67 67 unless @criterias.empty?
68 68 sql_select = @criterias.collect{|criteria| @available_criterias[criteria][:sql] + " AS " + criteria}.join(', ')
69 69 sql_group_by = @criterias.collect{|criteria| @available_criterias[criteria][:sql]}.join(', ')
70 70
71 71 sql = "SELECT #{sql_select}, tyear, tmonth, tweek, SUM(hours) AS hours"
72 72 sql << " FROM #{TimeEntry.table_name}"
73 73 sql << " LEFT JOIN #{Issue.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id"
74 74 sql << " LEFT JOIN #{Project.table_name} ON #{TimeEntry.table_name}.project_id = #{Project.table_name}.id"
75 75 sql << " WHERE (#{Project.table_name}.id = %s OR #{Project.table_name}.parent_id = %s)" % [@project.id, @project.id]
76 76 sql << " AND (%s)" % Project.allowed_to_condition(User.current, :view_time_entries)
77 77 sql << " AND spent_on BETWEEN '%s' AND '%s'" % [ActiveRecord::Base.connection.quoted_date(@date_from.to_time), ActiveRecord::Base.connection.quoted_date(@date_to.to_time)]
78 78 sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek"
79 79
80 80 @hours = ActiveRecord::Base.connection.select_all(sql)
81 81
82 82 @hours.each do |row|
83 83 case @columns
84 84 when 'year'
85 85 row['year'] = row['tyear']
86 86 when 'month'
87 87 row['month'] = "#{row['tyear']}-#{row['tmonth']}"
88 88 when 'week'
89 89 row['week'] = "#{row['tyear']}-#{row['tweek']}"
90 90 end
91 91 end
92 92
93 93 @total_hours = @hours.inject(0) {|s,k| s = s + k['hours'].to_f}
94 94 end
95 95
96 96 @periods = []
97 97 date_from = @date_from
98 98 # 100 columns max
99 99 while date_from < @date_to && @periods.length < 100
100 100 case @columns
101 101 when 'year'
102 102 @periods << "#{date_from.year}"
103 103 date_from = date_from >> 12
104 104 when 'month'
105 105 @periods << "#{date_from.year}-#{date_from.month}"
106 106 date_from = date_from >> 1
107 107 when 'week'
108 108 @periods << "#{date_from.year}-#{date_from.cweek}"
109 109 date_from = date_from + 7
110 110 end
111 111 end
112 112
113 113 render :layout => false if request.xhr?
114 114 end
115 115
116 116 def details
117 117 sort_init 'spent_on', 'desc'
118 118 sort_update
119 119
120 120 @free_period = false
121 121 @from, @to = nil, nil
122 122
123 123 if params[:period_type] == '1' || (params[:period_type].nil? && !params[:period].nil?)
124 124 case params[:period].to_s
125 125 when 'today'
126 126 @from = @to = Date.today
127 127 when 'yesterday'
128 128 @from = @to = Date.today - 1
129 129 when 'current_week'
130 130 @from = Date.today - (Date.today.cwday - 1)%7
131 131 @to = @from + 6
132 132 when 'last_week'
133 133 @from = Date.today - 7 - (Date.today.cwday - 1)%7
134 134 @to = @from + 6
135 135 when '7_days'
136 136 @from = Date.today - 7
137 137 @to = Date.today
138 138 when 'current_month'
139 139 @from = Date.civil(Date.today.year, Date.today.month, 1)
140 140 @to = (@from >> 1) - 1
141 141 when 'last_month'
142 142 @from = Date.civil(Date.today.year, Date.today.month, 1) << 1
143 143 @to = (@from >> 1) - 1
144 144 when '30_days'
145 145 @from = Date.today - 30
146 146 @to = Date.today
147 147 when 'current_year'
148 148 @from = Date.civil(Date.today.year, 1, 1)
149 149 @to = Date.civil(Date.today.year, 12, 31)
150 150 end
151 151 elsif params[:period_type] == '2' || (params[:period_type].nil? && (!params[:from].nil? || !params[:to].nil?))
152 152 begin; @from = params[:from].to_s.to_date unless params[:from].blank?; rescue; end
153 153 begin; @to = params[:to].to_s.to_date unless params[:to].blank?; rescue; end
154 154 @free_period = true
155 155 else
156 156 # default
157 157 end
158 158
159 159 @from, @to = @to, @from if @from && @to && @from > @to
160 160
161 161 cond = ARCondition.new
162 162 cond << (@issue.nil? ? ["(#{Project.table_name}.id = ? OR #{Project.table_name}.parent_id = ?)", @project.id, @project.id] :
163 163 ["#{TimeEntry.table_name}.issue_id = ?", @issue.id])
164 164
165 165 if @from
166 166 if @to
167 167 cond << ['spent_on BETWEEN ? AND ?', @from, @to]
168 168 else
169 169 cond << ['spent_on >= ?', @from]
170 170 end
171 171 elsif @to
172 172 cond << ['spent_on <= ?', @to]
173 173 end
174 174
175 175 TimeEntry.visible_by(User.current) do
176 176 respond_to do |format|
177 177 format.html {
178 178 # Paginate results
179 179 @entry_count = TimeEntry.count(:include => :project, :conditions => cond.conditions)
180 180 @entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
181 181 @entries = TimeEntry.find(:all,
182 182 :include => [:project, :activity, :user, {:issue => :tracker}],
183 183 :conditions => cond.conditions,
184 184 :order => sort_clause,
185 185 :limit => @entry_pages.items_per_page,
186 186 :offset => @entry_pages.current.offset)
187 187 @total_hours = TimeEntry.sum(:hours, :include => :project, :conditions => cond.conditions).to_f
188 188 render :layout => !request.xhr?
189 189 }
190 190 format.csv {
191 191 # Export all entries
192 192 @entries = TimeEntry.find(:all,
193 193 :include => [:project, :activity, :user, {:issue => [:tracker, :assigned_to, :priority]}],
194 194 :conditions => cond.conditions,
195 195 :order => sort_clause)
196 196 send_data(entries_to_csv(@entries).read, :type => 'text/csv; header=present', :filename => 'timelog.csv')
197 197 }
198 198 end
199 199 end
200 200 end
201 201
202 202 def edit
203 203 render_403 and return if @time_entry && !@time_entry.editable_by?(User.current)
204 204 @time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
205 205 @time_entry.attributes = params[:time_entry]
206 206 if request.post? and @time_entry.save
207 207 flash[:notice] = l(:notice_successful_update)
208 208 redirect_to :action => 'details', :project_id => @time_entry.project
209 209 return
210 210 end
211 211 @activities = Enumeration::get_values('ACTI')
212 212 end
213 213
214 214 def destroy
215 215 render_404 and return unless @time_entry
216 216 render_403 and return unless @time_entry.editable_by?(User.current)
217 217 @time_entry.destroy
218 218 flash[:notice] = l(:notice_successful_delete)
219 redirect_to :back
220 rescue RedirectBackError
219 221 redirect_to :action => 'details', :project_id => @time_entry.project
220 222 end
221 223
222 224 private
223 225 def find_project
224 226 if params[:id]
225 227 @time_entry = TimeEntry.find(params[:id])
226 228 @project = @time_entry.project
227 229 elsif params[:issue_id]
228 230 @issue = Issue.find(params[:issue_id])
229 231 @project = @issue.project
230 232 elsif params[:project_id]
231 233 @project = Project.find(params[:project_id])
232 234 else
233 235 render_404
234 236 return false
235 237 end
236 238 rescue ActiveRecord::RecordNotFound
237 239 render_404
238 240 end
239 241 end
@@ -1,471 +1,471
1 1 # redMine - project management software
2 2 # Copyright (C) 2006-2007 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 module ApplicationHelper
19 19 include Redmine::WikiFormatting::Macros::Definitions
20 20
21 21 def current_role
22 22 @current_role ||= User.current.role_for_project(@project)
23 23 end
24 24
25 25 # Return true if user is authorized for controller/action, otherwise false
26 26 def authorize_for(controller, action)
27 27 User.current.allowed_to?({:controller => controller, :action => action}, @project)
28 28 end
29 29
30 30 # Display a link if user is authorized
31 31 def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference)
32 32 link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action])
33 33 end
34 34
35 35 # Display a link to user's account page
36 36 def link_to_user(user)
37 37 user ? link_to(user, :controller => 'account', :action => 'show', :id => user) : 'Anonymous'
38 38 end
39 39
40 def link_to_issue(issue)
41 link_to "#{issue.tracker.name} ##{issue.id}", :controller => "issues", :action => "show", :id => issue
40 def link_to_issue(issue, options={})
41 link_to "#{issue.tracker.name} ##{issue.id}", {:controller => "issues", :action => "show", :id => issue}, options
42 42 end
43 43
44 44 def toggle_link(name, id, options={})
45 45 onclick = "Element.toggle('#{id}'); "
46 46 onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
47 47 onclick << "return false;"
48 48 link_to(name, "#", :onclick => onclick)
49 49 end
50 50
51 51 def show_and_goto_link(name, id, options={})
52 52 onclick = "Element.show('#{id}'); "
53 53 onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
54 54 onclick << "Element.scrollTo('#{id}'); "
55 55 onclick << "return false;"
56 56 link_to(name, "#", options.merge(:onclick => onclick))
57 57 end
58 58
59 59 def image_to_function(name, function, html_options = {})
60 60 html_options.symbolize_keys!
61 61 tag(:input, html_options.merge({
62 62 :type => "image", :src => image_path(name),
63 63 :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
64 64 }))
65 65 end
66 66
67 67 def prompt_to_remote(name, text, param, url, html_options = {})
68 68 html_options[:onclick] = "promptToRemote('#{text}', '#{param}', '#{url_for(url)}'); return false;"
69 69 link_to name, {}, html_options
70 70 end
71 71
72 72 def format_date(date)
73 73 return nil unless date
74 74 # "Setting.date_format.size < 2" is a temporary fix (content of date_format setting changed)
75 75 @date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format)
76 76 date.strftime(@date_format)
77 77 end
78 78
79 79 def format_time(time, include_date = true)
80 80 return nil unless time
81 81 time = time.to_time if time.is_a?(String)
82 82 zone = User.current.time_zone
83 83 if time.utc?
84 84 local = zone ? zone.adjust(time) : time.getlocal
85 85 else
86 86 local = zone ? zone.adjust(time.getutc) : time
87 87 end
88 88 @date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format)
89 89 @time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format)
90 90 include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format)
91 91 end
92 92
93 93 def html_hours(text)
94 94 text.gsub(%r{(\d+)\.(\d+)}, '<span class="hours hours-int">\1</span><span class="hours hours-dec">.\2</span>')
95 95 end
96 96
97 97 def authoring(created, author)
98 98 time_tag = content_tag('acronym', distance_of_time_in_words(Time.now, created), :title => format_time(created))
99 99 l(:label_added_time_by, author || 'Anonymous', time_tag)
100 100 end
101 101
102 102 def l_or_humanize(s)
103 103 l_has_string?("label_#{s}".to_sym) ? l("label_#{s}".to_sym) : s.to_s.humanize
104 104 end
105 105
106 106 def day_name(day)
107 107 l(:general_day_names).split(',')[day-1]
108 108 end
109 109
110 110 def month_name(month)
111 111 l(:actionview_datehelper_select_month_names).split(',')[month-1]
112 112 end
113 113
114 114 def pagination_links_full(paginator, count=nil, options={})
115 115 page_param = options.delete(:page_param) || :page
116 116 url_param = params.dup
117 117 # don't reuse params if filters are present
118 118 url_param.clear if url_param.has_key?(:set_filter)
119 119
120 120 html = ''
121 121 html << link_to_remote(('&#171; ' + l(:label_previous)),
122 122 {:update => 'content',
123 123 :url => url_param.merge(page_param => paginator.current.previous),
124 124 :complete => 'window.scrollTo(0,0)'},
125 125 {:href => url_for(:params => url_param.merge(page_param => paginator.current.previous))}) + ' ' if paginator.current.previous
126 126
127 127 html << (pagination_links_each(paginator, options) do |n|
128 128 link_to_remote(n.to_s,
129 129 {:url => {:params => url_param.merge(page_param => n)},
130 130 :update => 'content',
131 131 :complete => 'window.scrollTo(0,0)'},
132 132 {:href => url_for(:params => url_param.merge(page_param => n))})
133 133 end || '')
134 134
135 135 html << ' ' + link_to_remote((l(:label_next) + ' &#187;'),
136 136 {:update => 'content',
137 137 :url => url_param.merge(page_param => paginator.current.next),
138 138 :complete => 'window.scrollTo(0,0)'},
139 139 {:href => url_for(:params => url_param.merge(page_param => paginator.current.next))}) if paginator.current.next
140 140
141 141 unless count.nil?
142 142 html << [" (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})", per_page_links(paginator.items_per_page)].compact.join(' | ')
143 143 end
144 144
145 145 html
146 146 end
147 147
148 148 def per_page_links(selected=nil)
149 149 url_param = params.dup
150 150 url_param.clear if url_param.has_key?(:set_filter)
151 151
152 152 links = Setting.per_page_options_array.collect do |n|
153 153 n == selected ? n : link_to_remote(n, {:update => "content", :url => params.dup.merge(:per_page => n)},
154 154 {:href => url_for(url_param.merge(:per_page => n))})
155 155 end
156 156 links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil
157 157 end
158 158
159 159 def html_title(*args)
160 160 if args.empty?
161 161 title = []
162 162 title << @project.name if @project
163 163 title += @html_title if @html_title
164 164 title << Setting.app_title
165 165 title.compact.join(' - ')
166 166 else
167 167 @html_title ||= []
168 168 @html_title += args
169 169 end
170 170 end
171 171
172 172 def accesskey(s)
173 173 Redmine::AccessKeys.key_for s
174 174 end
175 175
176 176 # Formats text according to system settings.
177 177 # 2 ways to call this method:
178 178 # * with a String: textilizable(text, options)
179 179 # * with an object and one of its attribute: textilizable(issue, :description, options)
180 180 def textilizable(*args)
181 181 options = args.last.is_a?(Hash) ? args.pop : {}
182 182 case args.size
183 183 when 1
184 184 obj = nil
185 185 text = args.shift
186 186 when 2
187 187 obj = args.shift
188 188 text = obj.send(args.shift).to_s
189 189 else
190 190 raise ArgumentError, 'invalid arguments to textilizable'
191 191 end
192 192 return '' if text.blank?
193 193
194 194 only_path = options.delete(:only_path) == false ? false : true
195 195
196 196 # when using an image link, try to use an attachment, if possible
197 197 attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
198 198
199 199 if attachments
200 200 text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(gif|jpg|jpeg|png))!/) do |m|
201 201 style = $1
202 202 filename = $6
203 203 rf = Regexp.new(filename, Regexp::IGNORECASE)
204 204 # search for the picture in attachments
205 205 if found = attachments.detect { |att| att.filename =~ rf }
206 206 image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found.id
207 207 "!#{style}#{image_url}!"
208 208 else
209 209 "!#{style}#{filename}!"
210 210 end
211 211 end
212 212 end
213 213
214 214 text = (Setting.text_formatting == 'textile') ?
215 215 Redmine::WikiFormatting.to_html(text) { |macro, args| exec_macro(macro, obj, args) } :
216 216 simple_format(auto_link(h(text)))
217 217
218 218 # different methods for formatting wiki links
219 219 case options[:wiki_links]
220 220 when :local
221 221 # used for local links to html files
222 222 format_wiki_link = Proc.new {|project, title| "#{title}.html" }
223 223 when :anchor
224 224 # used for single-file wiki export
225 225 format_wiki_link = Proc.new {|project, title| "##{title}" }
226 226 else
227 227 format_wiki_link = Proc.new {|project, title| url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :id => project, :page => title) }
228 228 end
229 229
230 230 project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
231 231
232 232 # Wiki links
233 233 #
234 234 # Examples:
235 235 # [[mypage]]
236 236 # [[mypage|mytext]]
237 237 # wiki links can refer other project wikis, using project name or identifier:
238 238 # [[project:]] -> wiki starting page
239 239 # [[project:|mytext]]
240 240 # [[project:mypage]]
241 241 # [[project:mypage|mytext]]
242 242 text = text.gsub(/(!)?(\[\[([^\]\|]+)(\|([^\]\|]+))?\]\])/) do |m|
243 243 link_project = project
244 244 esc, all, page, title = $1, $2, $3, $5
245 245 if esc.nil?
246 246 if page =~ /^([^\:]+)\:(.*)$/
247 247 link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
248 248 page = $2
249 249 title ||= $1 if page.blank?
250 250 end
251 251
252 252 if link_project && link_project.wiki
253 253 # check if page exists
254 254 wiki_page = link_project.wiki.find_page(page)
255 255 link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page)),
256 256 :class => ('wiki-page' + (wiki_page ? '' : ' new')))
257 257 else
258 258 # project or wiki doesn't exist
259 259 title || page
260 260 end
261 261 else
262 262 all
263 263 end
264 264 end
265 265
266 266 # Redmine links
267 267 #
268 268 # Examples:
269 269 # Issues:
270 270 # #52 -> Link to issue #52
271 271 # Changesets:
272 272 # r52 -> Link to revision 52
273 273 # commit:a85130f -> Link to scmid starting with a85130f
274 274 # Documents:
275 275 # document#17 -> Link to document with id 17
276 276 # document:Greetings -> Link to the document with title "Greetings"
277 277 # document:"Some document" -> Link to the document with title "Some document"
278 278 # Versions:
279 279 # version#3 -> Link to version with id 3
280 280 # version:1.0.0 -> Link to version named "1.0.0"
281 281 # version:"1.0 beta 2" -> Link to version named "1.0 beta 2"
282 282 # Attachments:
283 283 # attachment:file.zip -> Link to the attachment of the current object named file.zip
284 284 text = text.gsub(%r{([\s\(,-^])(!)?(attachment|document|version|commit)?((#|r)(\d+)|(:)([^"][^\s<>]+|"[^"]+"))(?=[[:punct:]]|\s|<|$)}) do |m|
285 285 leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8
286 286 link = nil
287 287 if esc.nil?
288 288 if prefix.nil? && sep == 'r'
289 289 if project && (changeset = project.changesets.find_by_revision(oid))
290 290 link = link_to("r#{oid}", {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project.id, :rev => oid},
291 291 :class => 'changeset',
292 292 :title => truncate(changeset.comments, 100))
293 293 end
294 294 elsif sep == '#'
295 295 oid = oid.to_i
296 296 case prefix
297 297 when nil
298 298 if issue = Issue.find_by_id(oid, :include => [:project, :status], :conditions => Project.visible_by(User.current))
299 299 link = link_to("##{oid}", {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid},
300 300 :class => (issue.closed? ? 'issue closed' : 'issue'),
301 301 :title => "#{truncate(issue.subject, 100)} (#{issue.status.name})")
302 302 link = content_tag('del', link) if issue.closed?
303 303 end
304 304 when 'document'
305 305 if document = Document.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
306 306 link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
307 307 :class => 'document'
308 308 end
309 309 when 'version'
310 310 if version = Version.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
311 311 link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
312 312 :class => 'version'
313 313 end
314 314 end
315 315 elsif sep == ':'
316 316 # removes the double quotes if any
317 317 name = oid.gsub(%r{^"(.*)"$}, "\\1")
318 318 case prefix
319 319 when 'document'
320 320 if project && document = project.documents.find_by_title(name)
321 321 link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
322 322 :class => 'document'
323 323 end
324 324 when 'version'
325 325 if project && version = project.versions.find_by_name(name)
326 326 link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
327 327 :class => 'version'
328 328 end
329 329 when 'commit'
330 330 if project && (changeset = project.changesets.find(:first, :conditions => ["scmid LIKE ?", "#{name}%"]))
331 331 link = link_to h("#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project.id, :rev => changeset.revision}, :class => 'changeset', :title => truncate(changeset.comments, 100)
332 332 end
333 333 when 'attachment'
334 334 if attachments && attachment = attachments.detect {|a| a.filename == name }
335 335 link = link_to h(attachment.filename), {:only_path => only_path, :controller => 'attachments', :action => 'download', :id => attachment},
336 336 :class => 'attachment'
337 337 end
338 338 end
339 339 end
340 340 end
341 341 leading + (link || "#{prefix}#{sep}#{oid}")
342 342 end
343 343
344 344 text
345 345 end
346 346
347 347 # Same as Rails' simple_format helper without using paragraphs
348 348 def simple_format_without_paragraph(text)
349 349 text.to_s.
350 350 gsub(/\r\n?/, "\n"). # \r\n and \r -> \n
351 351 gsub(/\n\n+/, "<br /><br />"). # 2+ newline -> 2 br
352 352 gsub(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
353 353 end
354 354
355 355 def error_messages_for(object_name, options = {})
356 356 options = options.symbolize_keys
357 357 object = instance_variable_get("@#{object_name}")
358 358 if object && !object.errors.empty?
359 359 # build full_messages here with controller current language
360 360 full_messages = []
361 361 object.errors.each do |attr, msg|
362 362 next if msg.nil?
363 363 msg = msg.first if msg.is_a? Array
364 364 if attr == "base"
365 365 full_messages << l(msg)
366 366 else
367 367 full_messages << "&#171; " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " &#187; " + l(msg) unless attr == "custom_values"
368 368 end
369 369 end
370 370 # retrieve custom values error messages
371 371 if object.errors[:custom_values]
372 372 object.custom_values.each do |v|
373 373 v.errors.each do |attr, msg|
374 374 next if msg.nil?
375 375 msg = msg.first if msg.is_a? Array
376 376 full_messages << "&#171; " + v.custom_field.name + " &#187; " + l(msg)
377 377 end
378 378 end
379 379 end
380 380 content_tag("div",
381 381 content_tag(
382 382 options[:header_tag] || "span", lwr(:gui_validation_error, full_messages.length) + ":"
383 383 ) +
384 384 content_tag("ul", full_messages.collect { |msg| content_tag("li", msg) }),
385 385 "id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation"
386 386 )
387 387 else
388 388 ""
389 389 end
390 390 end
391 391
392 392 def lang_options_for_select(blank=true)
393 393 (blank ? [["(auto)", ""]] : []) +
394 394 GLoc.valid_languages.collect{|lang| [ ll(lang.to_s, :general_lang_name), lang.to_s]}.sort{|x,y| x.last <=> y.last }
395 395 end
396 396
397 397 def label_tag_for(name, option_tags = nil, options = {})
398 398 label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "")
399 399 content_tag("label", label_text)
400 400 end
401 401
402 402 def labelled_tabular_form_for(name, object, options, &proc)
403 403 options[:html] ||= {}
404 404 options[:html][:class] = 'tabular' unless options[:html].has_key?(:class)
405 405 form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc)
406 406 end
407 407
408 408 def check_all_links(form_name)
409 409 link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") +
410 410 " | " +
411 411 link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
412 412 end
413 413
414 414 def progress_bar(pcts, options={})
415 415 pcts = [pcts, pcts] unless pcts.is_a?(Array)
416 416 pcts[1] = pcts[1] - pcts[0]
417 417 pcts << (100 - pcts[1] - pcts[0])
418 418 width = options[:width] || '100px;'
419 419 legend = options[:legend] || ''
420 420 content_tag('table',
421 421 content_tag('tr',
422 422 (pcts[0] > 0 ? content_tag('td', '', :width => "#{pcts[0].floor}%;", :class => 'closed') : '') +
423 423 (pcts[1] > 0 ? content_tag('td', '', :width => "#{pcts[1].floor}%;", :class => 'done') : '') +
424 424 (pcts[2] > 0 ? content_tag('td', '', :width => "#{pcts[2].floor}%;", :class => 'todo') : '')
425 425 ), :class => 'progress', :style => "width: #{width};") +
426 426 content_tag('p', legend, :class => 'pourcent')
427 427 end
428 428
429 429 def context_menu_link(name, url, options={})
430 430 options[:class] ||= ''
431 431 if options.delete(:selected)
432 432 options[:class] << ' icon-checked disabled'
433 433 options[:disabled] = true
434 434 end
435 435 if options.delete(:disabled)
436 436 options.delete(:method)
437 437 options.delete(:confirm)
438 438 options.delete(:onclick)
439 439 options[:class] << ' disabled'
440 440 url = '#'
441 441 end
442 442 link_to name, url, options
443 443 end
444 444
445 445 def calendar_for(field_id)
446 446 image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
447 447 javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
448 448 end
449 449
450 450 def wikitoolbar_for(field_id)
451 451 return '' unless Setting.text_formatting == 'textile'
452 452
453 453 help_link = l(:setting_text_formatting) + ': ' +
454 454 link_to(l(:label_help), compute_public_path('wiki_syntax', 'help', 'html'),
455 455 :onclick => "window.open(\"#{ compute_public_path('wiki_syntax', 'help', 'html') }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;")
456 456
457 457 javascript_include_tag('jstoolbar/jstoolbar') +
458 458 javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language}") +
459 459 javascript_tag("var toolbar = new jsToolBar($('#{field_id}')); toolbar.setHelpLink('#{help_link}'); toolbar.draw();")
460 460 end
461 461
462 462 def content_for(name, content = nil, &block)
463 463 @has_content ||= {}
464 464 @has_content[name] = true
465 465 super(name, content, &block)
466 466 end
467 467
468 468 def has_content?(name)
469 469 (@has_content && @has_content[name]) || false
470 470 end
471 471 end
@@ -1,576 +1,576
1 1 body { font-family: Verdana, sans-serif; font-size: 12px; color:#484848; margin: 0; padding: 0; min-width: 900px; }
2 2
3 3 h1, h2, h3, h4 { font-family: "Trebuchet MS", Verdana, sans-serif;}
4 4 h1 {margin:0; padding:0; font-size: 24px;}
5 5 h2, .wiki h1 {font-size: 20px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;}
6 6 h3, .wiki h2 {font-size: 16px;padding: 2px 10px 1px 0px;margin: 0 0 10px 0; border-bottom: 1px solid #bbbbbb; color: #444;}
7 7 h4, .wiki h3 {font-size: 12px;padding: 2px 10px 1px 0px;margin-bottom: 5px; border-bottom: 1px dotted #bbbbbb; color: #444;}
8 8
9 9 /***** Layout *****/
10 10 #wrapper {background: white;}
11 11
12 12 #top-menu {background: #2C4056;color: #fff;height:1.5em; padding: 2px 6px 0px 6px;}
13 13 #top-menu ul {margin: 0; padding: 0;}
14 14 #top-menu li {
15 15 float:left;
16 16 list-style-type:none;
17 17 margin: 0px 0px 0px 0px;
18 18 padding: 0px 0px 0px 0px;
19 19 white-space:nowrap;
20 20 }
21 21 #top-menu a {color: #fff; padding-right: 4px;}
22 22 #top-menu #loggedas { float: right; margin-right: 0.5em; color: #fff; }
23 23
24 24 #account {float:right;}
25 25
26 26 #header {height:5.3em;margin:0;background-color:#507AAA;color:#f8f8f8; padding: 4px 8px 0px 6px; position:relative;}
27 27 #header a {color:#f8f8f8;}
28 28 #quick-search {float:right;}
29 29
30 30 #main-menu {position: absolute; bottom: 0px; left:6px; margin-right: -500px;}
31 31 #main-menu ul {margin: 0; padding: 0;}
32 32 #main-menu li {
33 33 float:left;
34 34 list-style-type:none;
35 35 margin: 0px 10px 0px 0px;
36 36 padding: 0px 0px 0px 0px;
37 37 white-space:nowrap;
38 38 }
39 39 #main-menu li a {
40 40 display: block;
41 41 color: #fff;
42 42 text-decoration: none;
43 43 margin: 0;
44 44 padding: 4px 4px 4px 4px;
45 45 background: #2C4056;
46 46 }
47 47 #main-menu li a:hover, #main-menu li a.selected {background:#759FCF;}
48 48
49 49 #main {background: url(../images/mainbg.png) repeat-x; background-color:#EEEEEE;}
50 50
51 51 #sidebar{ float: right; width: 17%; position: relative; z-index: 9; min-height: 600px; padding: 0; margin: 0;}
52 52 * html #sidebar{ width: 17%; }
53 53 #sidebar h3{ font-size: 14px; margin-top:14px; color: #666; }
54 54 #sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; }
55 55 * html #sidebar hr{ width: 95%; position: relative; left: -6px; color: #ccc; }
56 56
57 57 #content { width: 80%; background: url(../images/contentbg.png) repeat-x; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; height:600px; min-height: 600px;}
58 58 * html #content{ width: 80%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;}
59 59 html>body #content {
60 60 height: auto;
61 61 min-height: 600px;
62 62 }
63 63
64 64 #main.nosidebar #sidebar{ display: none; }
65 65 #main.nosidebar #content{ width: auto; border-right: 0; }
66 66
67 67 #footer {clear: both; border-top: 1px solid #bbb; font-size: 0.9em; color: #aaa; padding: 5px; text-align:center; background:#fff;}
68 68
69 69 #login-form table {margin-top:5em; padding:1em; margin-left: auto; margin-right: auto; border: 2px solid #FDBF3B; background-color:#FFEBC1; }
70 70 #login-form table td {padding: 6px;}
71 71 #login-form label {font-weight: bold;}
72 72
73 73 .clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; }
74 74
75 75 /***** Links *****/
76 76 a, a:link, a:visited{ color: #2A5685; text-decoration: none; }
77 77 a:hover, a:active{ color: #c61a1a; text-decoration: underline;}
78 78 a img{ border: 0; }
79 79
80 80 a.issue.closed, .issue.closed a { text-decoration: line-through; }
81 81
82 82 /***** Tables *****/
83 83 table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; }
84 84 table.list th { background-color:#EEEEEE; padding: 4px; white-space:nowrap; }
85 85 table.list td { overflow: hidden; vertical-align: top;}
86 86 table.list td.id { width: 2%; text-align: center;}
87 87 table.list td.checkbox { width: 15px; padding: 0px;}
88 88
89 89 tr.issue { text-align: center; white-space: nowrap; }
90 90 tr.issue td.subject, tr.issue td.category { white-space: normal; }
91 91 tr.issue td.subject { text-align: left; }
92 92 tr.issue td.done_ratio table.progress { margin-left:auto; margin-right: auto;}
93 93
94 94 tr.entry { border: 1px solid #f8f8f8; }
95 95 tr.entry td { white-space: nowrap; }
96 96 tr.entry td.filename { width: 30%; }
97 97 tr.entry td.size { text-align: right; font-size: 90%; }
98 98 tr.entry td.revision, tr.entry td.author { text-align: center; }
99 99 tr.entry td.age { text-align: right; }
100 100
101 101 tr.changeset td.author { text-align: center; width: 15%; }
102 102 tr.changeset td.committed_on { text-align: center; width: 15%; }
103 103
104 104 tr.message { height: 2.6em; }
105 105 tr.message td.last_message { font-size: 80%; }
106 106 tr.message.locked td.subject a { background-image: url(../images/locked.png); }
107 107 tr.message.sticky td.subject a { background-image: url(../images/sticky.png); font-weight: bold; }
108 108
109 109 tr.user td { width:13%; }
110 110 tr.user td.email { width:18%; }
111 111 tr.user td { white-space: nowrap; }
112 112 tr.user.locked, tr.user.registered { color: #aaa; }
113 113 tr.user.locked a, tr.user.registered a { color: #aaa; }
114 114
115 115 tr.time-entry { text-align: center; white-space: nowrap; }
116 tr.time-entry td.subject, tr.time-entry td.comments { text-align: left; }
117 tr.time-entry td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; }
118 tr.time-entry .hours-dec { font-size: 0.9em; }
116 tr.time-entry td.subject, tr.time-entry td.comments { text-align: left; white-space: normal; }
117 td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; }
118 td.hours .hours-dec { font-size: 0.9em; }
119 119
120 120 table.list tbody tr:hover { background-color:#ffffdd; }
121 121 table td {padding:2px;}
122 122 table p {margin:0;}
123 123 .odd {background-color:#f6f7f8;}
124 124 .even {background-color: #fff;}
125 125
126 126 .highlight { background-color: #FCFD8D;}
127 127 .highlight.token-1 { background-color: #faa;}
128 128 .highlight.token-2 { background-color: #afa;}
129 129 .highlight.token-3 { background-color: #aaf;}
130 130
131 131 .box{
132 132 padding:6px;
133 133 margin-bottom: 10px;
134 134 background-color:#f6f6f6;
135 135 color:#505050;
136 136 line-height:1.5em;
137 137 border: 1px solid #e4e4e4;
138 138 }
139 139
140 140 div.square {
141 141 border: 1px solid #999;
142 142 float: left;
143 143 margin: .3em .4em 0 .4em;
144 144 overflow: hidden;
145 145 width: .6em; height: .6em;
146 146 }
147 147
148 148 .contextual {float:right; white-space: nowrap; line-height:1.4em;margin-top:5px; padding-left: 10px; font-size:0.9em;}
149 149 .contextual input {font-size:0.9em;}
150 150
151 151 .splitcontentleft{float:left; width:49%;}
152 152 .splitcontentright{float:right; width:49%;}
153 153 form {display: inline;}
154 154 input, select {vertical-align: middle; margin-top: 1px; margin-bottom: 1px;}
155 155 fieldset {border: 1px solid #e4e4e4; margin:0;}
156 156 legend {color: #484848;}
157 157 hr { width: 100%; height: 1px; background: #ccc; border: 0;}
158 158 textarea.wiki-edit { width: 99%; }
159 159 li p {margin-top: 0;}
160 160 div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
161 161
162 162 div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;}
163 163 div#issue-changesets .changeset { padding: 4px;}
164 164 div#issue-changesets .changeset { border-bottom: 1px solid #ddd; }
165 165 div#issue-changesets p { margin-top: 0; margin-bottom: 1em;}
166 166
167 167 div#activity dl { margin-left: 2em; }
168 168 div#activity dd { margin-bottom: 1em; }
169 169 div#activity dt { margin-bottom: 1px; }
170 170 div#activity dt .time { color: #777; font-size: 80%; }
171 171 div#activity dd .description { font-style: italic; }
172 172 div#activity span.project:after { content: " -"; }
173 173
174 174 div#roadmap fieldset.related-issues { margin-bottom: 1em; }
175 175 div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; }
176 176 div#roadmap .wiki h1:first-child { display: none; }
177 177 div#roadmap .wiki h1 { font-size: 120%; }
178 178 div#roadmap .wiki h2 { font-size: 110%; }
179 179
180 180 div#version-summary { float:right; width:380px; margin-left: 16px; margin-bottom: 16px; background-color: #fff; }
181 181 div#version-summary fieldset { margin-bottom: 1em; }
182 182 div#version-summary .total-hours { text-align: right; }
183 183
184 184 table#time-report td.hours { text-align: right; padding-right: 0.5em; }
185 185 table#time-report tbody tr { font-style: italic; color: #777; }
186 186 table#time-report tbody tr.last-level { font-style: normal; color: #555; }
187 187 table#time-report tbody tr.total { font-style: normal; font-weight: bold; color: #555; background-color:#EEEEEE; }
188 188 table#time-report .hours-dec { font-size: 0.9em; }
189 189
190 190 .total-hours { font-size: 110%; font-weight: bold; }
191 191 .total-hours span.hours-int { font-size: 120%; }
192 192
193 193 .autoscroll {overflow-x: auto; padding:1px; width:100%; margin-bottom: 1.2em;}
194 194 #user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; }
195 195
196 196 .pagination {font-size: 90%}
197 197 p.pagination {margin-top:8px;}
198 198
199 199 /***** Tabular forms ******/
200 200 .tabular p{
201 201 margin: 0;
202 202 padding: 5px 0 8px 0;
203 203 padding-left: 180px; /*width of left column containing the label elements*/
204 204 height: 1%;
205 205 clear:left;
206 206 }
207 207
208 208 .tabular label{
209 209 font-weight: bold;
210 210 float: left;
211 211 text-align: right;
212 212 margin-left: -180px; /*width of left column*/
213 213 width: 175px; /*width of labels. Should be smaller than left column to create some right
214 214 margin*/
215 215 }
216 216
217 217 .tabular label.floating{
218 218 font-weight: normal;
219 219 margin-left: 0px;
220 220 text-align: left;
221 221 width: 200px;
222 222 }
223 223
224 224 #preview fieldset {margin-top: 1em; background: url(../images/draft.png)}
225 225
226 226 .tabular.settings p{ padding-left: 300px; }
227 227 .tabular.settings label{ margin-left: -300px; width: 295px; }
228 228
229 229 .required {color: #bb0000;}
230 230 .summary {font-style: italic;}
231 231
232 232 #attachments_fields input[type=text] {margin-left: 8px; }
233 233
234 234 div.attachments p { margin:4px 0 2px 0; }
235 235 div.attachments img { vertical-align: middle; }
236 236 div.attachments span.author { font-size: 0.9em; color: #888; }
237 237
238 238 p.other-formats { text-align: right; font-size:0.9em; color: #666; }
239 239 .other-formats span + span:before { content: "| "; }
240 240
241 241 a.feed { background: url(../images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; }
242 242
243 243 /***** Flash & error messages ****/
244 244 #errorExplanation, div.flash, .nodata {
245 245 padding: 4px 4px 4px 30px;
246 246 margin-bottom: 12px;
247 247 font-size: 1.1em;
248 248 border: 2px solid;
249 249 }
250 250
251 251 div.flash {margin-top: 8px;}
252 252
253 253 div.flash.error, #errorExplanation {
254 254 background: url(../images/false.png) 8px 5px no-repeat;
255 255 background-color: #ffe3e3;
256 256 border-color: #dd0000;
257 257 color: #550000;
258 258 }
259 259
260 260 div.flash.notice {
261 261 background: url(../images/true.png) 8px 5px no-repeat;
262 262 background-color: #dfffdf;
263 263 border-color: #9fcf9f;
264 264 color: #005f00;
265 265 }
266 266
267 267 .nodata {
268 268 text-align: center;
269 269 background-color: #FFEBC1;
270 270 border-color: #FDBF3B;
271 271 color: #A6750C;
272 272 }
273 273
274 274 #errorExplanation ul { font-size: 0.9em;}
275 275
276 276 /***** Ajax indicator ******/
277 277 #ajax-indicator {
278 278 position: absolute; /* fixed not supported by IE */
279 279 background-color:#eee;
280 280 border: 1px solid #bbb;
281 281 top:35%;
282 282 left:40%;
283 283 width:20%;
284 284 font-weight:bold;
285 285 text-align:center;
286 286 padding:0.6em;
287 287 z-index:100;
288 288 filter:alpha(opacity=50);
289 289 opacity: 0.5;
290 290 }
291 291
292 292 html>body #ajax-indicator { position: fixed; }
293 293
294 294 #ajax-indicator span {
295 295 background-position: 0% 40%;
296 296 background-repeat: no-repeat;
297 297 background-image: url(../images/loading.gif);
298 298 padding-left: 26px;
299 299 vertical-align: bottom;
300 300 }
301 301
302 302 /***** Calendar *****/
303 303 table.cal {border-collapse: collapse; width: 100%; margin: 8px 0 6px 0;border: 1px solid #d7d7d7;}
304 304 table.cal thead th {width: 14%;}
305 305 table.cal tbody tr {height: 100px;}
306 306 table.cal th { background-color:#EEEEEE; padding: 4px; }
307 307 table.cal td {border: 1px solid #d7d7d7; vertical-align: top; font-size: 0.9em;}
308 308 table.cal td p.day-num {font-size: 1.1em; text-align:right;}
309 309 table.cal td.odd p.day-num {color: #bbb;}
310 310 table.cal td.today {background:#ffffdd;}
311 311 table.cal td.today p.day-num {font-weight: bold;}
312 312
313 313 /***** Tooltips ******/
314 314 .tooltip{position:relative;z-index:24;}
315 315 .tooltip:hover{z-index:25;color:#000;}
316 316 .tooltip span.tip{display: none; text-align:left;}
317 317
318 318 div.tooltip:hover span.tip{
319 319 display:block;
320 320 position:absolute;
321 321 top:12px; left:24px; width:270px;
322 322 border:1px solid #555;
323 323 background-color:#fff;
324 324 padding: 4px;
325 325 font-size: 0.8em;
326 326 color:#505050;
327 327 }
328 328
329 329 /***** Progress bar *****/
330 330 table.progress {
331 331 border: 1px solid #D7D7D7;
332 332 border-collapse: collapse;
333 333 border-spacing: 0pt;
334 334 empty-cells: show;
335 335 text-align: center;
336 336 float:left;
337 337 margin: 1px 6px 1px 0px;
338 338 }
339 339
340 340 table.progress td { height: 0.9em; }
341 341 table.progress td.closed { background: #BAE0BA none repeat scroll 0%; }
342 342 table.progress td.done { background: #DEF0DE none repeat scroll 0%; }
343 343 table.progress td.open { background: #FFF none repeat scroll 0%; }
344 344 p.pourcent {font-size: 80%;}
345 345 p.progress-info {clear: left; font-style: italic; font-size: 80%;}
346 346
347 347 /***** Tabs *****/
348 348 #content .tabs {height: 2.6em; border-bottom: 1px solid #bbbbbb; margin-bottom:1.2em; position:relative;}
349 349 #content .tabs ul {margin:0; position:absolute; bottom:-2px; padding-left:1em;}
350 350 #content .tabs>ul { bottom:-1px; } /* others */
351 351 #content .tabs ul li {
352 352 float:left;
353 353 list-style-type:none;
354 354 white-space:nowrap;
355 355 margin-right:8px;
356 356 background:#fff;
357 357 }
358 358 #content .tabs ul li a{
359 359 display:block;
360 360 font-size: 0.9em;
361 361 text-decoration:none;
362 362 line-height:1.3em;
363 363 padding:4px 6px 4px 6px;
364 364 border: 1px solid #ccc;
365 365 border-bottom: 1px solid #bbbbbb;
366 366 background-color: #eeeeee;
367 367 color:#777;
368 368 font-weight:bold;
369 369 }
370 370
371 371 #content .tabs ul li a:hover {
372 372 background-color: #ffffdd;
373 373 text-decoration:none;
374 374 }
375 375
376 376 #content .tabs ul li a.selected {
377 377 background-color: #fff;
378 378 border: 1px solid #bbbbbb;
379 379 border-bottom: 1px solid #fff;
380 380 }
381 381
382 382 #content .tabs ul li a.selected:hover {
383 383 background-color: #fff;
384 384 }
385 385
386 386 /***** Diff *****/
387 387 .diff_out { background: #fcc; }
388 388 .diff_in { background: #cfc; }
389 389
390 390 /***** Wiki *****/
391 391 div.wiki table {
392 392 border: 1px solid #505050;
393 393 border-collapse: collapse;
394 394 margin-bottom: 1em;
395 395 }
396 396
397 397 div.wiki table, div.wiki td, div.wiki th {
398 398 border: 1px solid #bbb;
399 399 padding: 4px;
400 400 }
401 401
402 402 div.wiki .external {
403 403 background-position: 0% 60%;
404 404 background-repeat: no-repeat;
405 405 padding-left: 12px;
406 406 background-image: url(../images/external.png);
407 407 }
408 408
409 409 div.wiki a.new {
410 410 color: #b73535;
411 411 }
412 412
413 413 div.wiki pre {
414 414 margin: 1em 1em 1em 1.6em;
415 415 padding: 2px;
416 416 background-color: #fafafa;
417 417 border: 1px solid #dadada;
418 418 width:95%;
419 419 overflow-x: auto;
420 420 }
421 421
422 422 div.wiki div.toc {
423 423 background-color: #ffffdd;
424 424 border: 1px solid #e4e4e4;
425 425 padding: 4px;
426 426 line-height: 1.2em;
427 427 margin-bottom: 12px;
428 428 margin-right: 12px;
429 429 display: table
430 430 }
431 431 * html div.wiki div.toc { width: 50%; } /* IE6 doesn't autosize div */
432 432
433 433 div.wiki div.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
434 434 div.wiki div.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
435 435
436 436 div.wiki div.toc a {
437 437 display: block;
438 438 font-size: 0.9em;
439 439 font-weight: normal;
440 440 text-decoration: none;
441 441 color: #606060;
442 442 }
443 443 div.wiki div.toc a:hover { color: #c61a1a; text-decoration: underline;}
444 444
445 445 div.wiki div.toc a.heading2 { margin-left: 6px; }
446 446 div.wiki div.toc a.heading3 { margin-left: 12px; font-size: 0.8em; }
447 447
448 448 /***** My page layout *****/
449 449 .block-receiver {
450 450 border:1px dashed #c0c0c0;
451 451 margin-bottom: 20px;
452 452 padding: 15px 0 15px 0;
453 453 }
454 454
455 455 .mypage-box {
456 456 margin:0 0 20px 0;
457 457 color:#505050;
458 458 line-height:1.5em;
459 459 }
460 460
461 461 .handle {
462 462 cursor: move;
463 463 }
464 464
465 465 a.close-icon {
466 466 display:block;
467 467 margin-top:3px;
468 468 overflow:hidden;
469 469 width:12px;
470 470 height:12px;
471 471 background-repeat: no-repeat;
472 472 cursor:pointer;
473 473 background-image:url('../images/close.png');
474 474 }
475 475
476 476 a.close-icon:hover {
477 477 background-image:url('../images/close_hl.png');
478 478 }
479 479
480 480 /***** Gantt chart *****/
481 481 .gantt_hdr {
482 482 position:absolute;
483 483 top:0;
484 484 height:16px;
485 485 border-top: 1px solid #c0c0c0;
486 486 border-bottom: 1px solid #c0c0c0;
487 487 border-right: 1px solid #c0c0c0;
488 488 text-align: center;
489 489 overflow: hidden;
490 490 }
491 491
492 492 .task {
493 493 position: absolute;
494 494 height:8px;
495 495 font-size:0.8em;
496 496 color:#888;
497 497 padding:0;
498 498 margin:0;
499 499 line-height:0.8em;
500 500 }
501 501
502 502 .task_late { background:#f66 url(../images/task_late.png); border: 1px solid #f66; }
503 503 .task_done { background:#66f url(../images/task_done.png); border: 1px solid #66f; }
504 504 .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; }
505 505 .milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; }
506 506
507 507 /***** Icons *****/
508 508 .icon {
509 509 background-position: 0% 40%;
510 510 background-repeat: no-repeat;
511 511 padding-left: 20px;
512 512 padding-top: 2px;
513 513 padding-bottom: 3px;
514 514 }
515 515
516 516 .icon22 {
517 517 background-position: 0% 40%;
518 518 background-repeat: no-repeat;
519 519 padding-left: 26px;
520 520 line-height: 22px;
521 521 vertical-align: middle;
522 522 }
523 523
524 524 .icon-add { background-image: url(../images/add.png); }
525 525 .icon-edit { background-image: url(../images/edit.png); }
526 526 .icon-copy { background-image: url(../images/copy.png); }
527 527 .icon-del { background-image: url(../images/delete.png); }
528 528 .icon-move { background-image: url(../images/move.png); }
529 529 .icon-save { background-image: url(../images/save.png); }
530 530 .icon-cancel { background-image: url(../images/cancel.png); }
531 531 .icon-file { background-image: url(../images/file.png); }
532 532 .icon-folder { background-image: url(../images/folder.png); }
533 533 .open .icon-folder { background-image: url(../images/folder_open.png); }
534 534 .icon-package { background-image: url(../images/package.png); }
535 535 .icon-home { background-image: url(../images/home.png); }
536 536 .icon-user { background-image: url(../images/user.png); }
537 537 .icon-mypage { background-image: url(../images/user_page.png); }
538 538 .icon-admin { background-image: url(../images/admin.png); }
539 539 .icon-projects { background-image: url(../images/projects.png); }
540 540 .icon-logout { background-image: url(../images/logout.png); }
541 541 .icon-help { background-image: url(../images/help.png); }
542 542 .icon-attachment { background-image: url(../images/attachment.png); }
543 543 .icon-index { background-image: url(../images/index.png); }
544 544 .icon-history { background-image: url(../images/history.png); }
545 545 .icon-time { background-image: url(../images/time.png); }
546 546 .icon-stats { background-image: url(../images/stats.png); }
547 547 .icon-warning { background-image: url(../images/warning.png); }
548 548 .icon-fav { background-image: url(../images/fav.png); }
549 549 .icon-fav-off { background-image: url(../images/fav_off.png); }
550 550 .icon-reload { background-image: url(../images/reload.png); }
551 551 .icon-lock { background-image: url(../images/locked.png); }
552 552 .icon-unlock { background-image: url(../images/unlock.png); }
553 553 .icon-checked { background-image: url(../images/true.png); }
554 554 .icon-details { background-image: url(../images/zoom_in.png); }
555 555 .icon-report { background-image: url(../images/report.png); }
556 556
557 557 .icon22-projects { background-image: url(../images/22x22/projects.png); }
558 558 .icon22-users { background-image: url(../images/22x22/users.png); }
559 559 .icon22-tracker { background-image: url(../images/22x22/tracker.png); }
560 560 .icon22-role { background-image: url(../images/22x22/role.png); }
561 561 .icon22-workflow { background-image: url(../images/22x22/workflow.png); }
562 562 .icon22-options { background-image: url(../images/22x22/options.png); }
563 563 .icon22-notifications { background-image: url(../images/22x22/notifications.png); }
564 564 .icon22-authent { background-image: url(../images/22x22/authent.png); }
565 565 .icon22-info { background-image: url(../images/22x22/info.png); }
566 566 .icon22-comment { background-image: url(../images/22x22/comment.png); }
567 567 .icon22-package { background-image: url(../images/22x22/package.png); }
568 568 .icon22-settings { background-image: url(../images/22x22/settings.png); }
569 569 .icon22-plugin { background-image: url(../images/22x22/plugin.png); }
570 570
571 571 /***** Media print specific styles *****/
572 572 @media print {
573 573 #top-menu, #header, #main-menu, #sidebar, #footer, .contextual { display:none; }
574 574 #main { background: #fff; }
575 575 #content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; }
576 576 }
General Comments 0
You need to be logged in to leave comments. Login now