From b635a6b3c5492476b35225f839872a12637b3360 Mon Sep 17 00:00:00 2001 From: zhanghaitao <562681745@qq.com> Date: Fri, 22 Aug 2014 09:38:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E5=B7=A5=E4=BD=9C=E5=8F=B0?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E5=A4=84=E7=90=86=E6=93=8D=E4=BD=9C=202.?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E5=A4=84=E7=90=86=E8=B7=AF=E7=94=B1=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 4 +++ app/controllers/my_controller.rb | 27 ++++++++++++++++++- app/views/my/blocks/_assiagn_issue.html.erb | 26 ++++++++++++++++++ .../my/blocks/_issuesassignedtome.html.erb | 20 +++----------- app/views/my/page.js.erb | 1 + app/views/my/page2.js.erb | 1 + config/routes.rb | 2 ++ 7 files changed, 63 insertions(+), 18 deletions(-) create mode 100644 app/views/my/blocks/_assiagn_issue.html.erb create mode 100644 app/views/my/page.js.erb create mode 100644 app/views/my/page2.js.erb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 9d734db37..b522a09d6 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -83,6 +83,10 @@ class IssuesController < ApplicationController :limit => @limit) @issue_count_by_group = @query.issue_count_by_group + + + + respond_to do |format| format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young format.api { diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 91da700a1..14814ed32 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -37,16 +37,41 @@ class MyController < ApplicationController }.freeze def index + page render :action => 'page' - end + end # Show user's page def page @user = User.current + @Issues= Issue.visible.open. + where(:assigned_to_id => ([User.current.id] + User.current.group_ids)) + @limit = 10 + @feedback_count = @Issues.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @curse_attachments = @Issues[@offset, @limit] + @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT end + def page2 + @limit = 10 + @user = User.current + @Issues= Issue.visible.open. + where(:assigned_to_id => ([User.current.id] + User.current.group_ids)) + @feedback_count = @Issues.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @curse_attachments = @Issues[@offset, @limit] + @state = false + @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT + respond_to do |format| + format.js + end + end + # Edit user's account def account @user = User.current diff --git a/app/views/my/blocks/_assiagn_issue.html.erb b/app/views/my/blocks/_assiagn_issue.html.erb new file mode 100644 index 000000000..6e7df84fd --- /dev/null +++ b/app/views/my/blocks/_assiagn_issue.html.erb @@ -0,0 +1,26 @@ +<% assigned_issues = issuesassignedtome_items %> +<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %> +<% if assigned_issues.length > 0 %> + + +
<%= link_to l(:label_issue_view_all), :controller => 'issues', + :action => 'index', + :set_filter => 1, + :assigned_to_id => 'me', + :sort => 'priority:desc,updated_on:desc' %>
+<% end %> +<% content_for :header_tags do %> +<%= auto_discovery_link_tag(:atom, + {:controller => 'issues', :action => 'index', :set_filter => 1, + :assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key}, + {:title => l(:label_assigned_to_me_issues)}) %> + +<% end %> \ No newline at end of file diff --git a/app/views/my/blocks/_issuesassignedtome.html.erb b/app/views/my/blocks/_issuesassignedtome.html.erb index 02d8c9aa6..0b20dd4e5 100644 --- a/app/views/my/blocks/_issuesassignedtome.html.erb +++ b/app/views/my/blocks/_issuesassignedtome.html.erb @@ -1,18 +1,4 @@<%= link_to l(:label_issue_view_all), :controller => 'issues', - :action => 'index', - :set_filter => 1, - :assigned_to_id => 'me', - :sort => 'priority:desc,updated_on:desc' %>
-<% end %> - -<% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, - {:controller => 'issues', :action => 'index', :set_filter => 1, - :assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key}, - {:title => l(:label_assigned_to_me_issues)}) %> -<% end %> +