@@ -1,16 +1,16 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 |
# Copyright (C) 2006-20 |
|
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. | |
@@ -31,8 +31,8 class MyController < ApplicationController | |||||
31 | 'timelog' => :label_spent_time |
|
31 | 'timelog' => :label_spent_time | |
32 | }.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze |
|
32 | }.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze | |
33 |
|
33 | |||
34 |
DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'], |
|
34 | DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'], | |
35 |
'right' => ['issuesreportedbyme'] |
|
35 | 'right' => ['issuesreportedbyme'] | |
36 | }.freeze |
|
36 | }.freeze | |
37 |
|
37 | |||
38 | verify :xhr => true, |
|
38 | verify :xhr => true, | |
@@ -88,7 +88,7 class MyController < ApplicationController | |||||
88 | end |
|
88 | end | |
89 | end |
|
89 | end | |
90 | end |
|
90 | end | |
91 |
|
91 | |||
92 | # Create a new feeds key |
|
92 | # Create a new feeds key | |
93 | def reset_rss_key |
|
93 | def reset_rss_key | |
94 | if request.post? |
|
94 | if request.post? | |
@@ -122,7 +122,7 class MyController < ApplicationController | |||||
122 | @block_options = [] |
|
122 | @block_options = [] | |
123 | BLOCKS.each {|k, v| @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]} |
|
123 | BLOCKS.each {|k, v| @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]} | |
124 | end |
|
124 | end | |
125 |
|
125 | |||
126 | # Add a block to user's page |
|
126 | # Add a block to user's page | |
127 | # The block is added on top of the page |
|
127 | # The block is added on top of the page | |
128 | # params[:block] : id of the block to add |
|
128 | # params[:block] : id of the block to add | |
@@ -136,10 +136,10 class MyController < ApplicationController | |||||
136 | # add it on top |
|
136 | # add it on top | |
137 | layout['top'].unshift block |
|
137 | layout['top'].unshift block | |
138 | @user.pref[:my_page_layout] = layout |
|
138 | @user.pref[:my_page_layout] = layout | |
139 |
@user.pref.save |
|
139 | @user.pref.save | |
140 | render :partial => "block", :locals => {:user => @user, :block_name => block} |
|
140 | render :partial => "block", :locals => {:user => @user, :block_name => block} | |
141 | end |
|
141 | end | |
142 |
|
142 | |||
143 | # Remove a block to user's page |
|
143 | # Remove a block to user's page | |
144 | # params[:block] : id of the block to remove |
|
144 | # params[:block] : id of the block to remove | |
145 | def remove_block |
|
145 | def remove_block | |
@@ -149,7 +149,7 class MyController < ApplicationController | |||||
149 | layout = @user.pref[:my_page_layout] || {} |
|
149 | layout = @user.pref[:my_page_layout] || {} | |
150 | %w(top left right).each {|f| (layout[f] ||= []).delete block } |
|
150 | %w(top left right).each {|f| (layout[f] ||= []).delete block } | |
151 | @user.pref[:my_page_layout] = layout |
|
151 | @user.pref[:my_page_layout] = layout | |
152 |
@user.pref.save |
|
152 | @user.pref.save | |
153 | render :nothing => true |
|
153 | render :nothing => true | |
154 | end |
|
154 | end | |
155 |
|
155 | |||
@@ -169,7 +169,7 class MyController < ApplicationController | |||||
169 | } |
|
169 | } | |
170 | layout[group] = group_items |
|
170 | layout[group] = group_items | |
171 | @user.pref[:my_page_layout] = layout |
|
171 | @user.pref[:my_page_layout] = layout | |
172 |
@user.pref.save |
|
172 | @user.pref.save | |
173 | end |
|
173 | end | |
174 | end |
|
174 | end | |
175 | render :nothing => true |
|
175 | render :nothing => true |
General Comments 0
You need to be logged in to leave comments.
Login now