[#98] common pull requests

This commit is contained in:
Alexander Machehin 2013-05-13 23:15:23 +06:00
parent 942d5a669e
commit dd6a319dfb
8 changed files with 26 additions and 12 deletions

View File

@ -24,10 +24,20 @@ class Users::UsersController < Users::BaseController
end end
def issues def issues
@created_issues = current_user.issues.without_pull_requests @created_issues = current_user.issues
@assigned_issues = Issue.where(:assignee_id => current_user.id).without_pull_requests @assigned_issues = Issue.where(:assignee_id => current_user.id)
pr_ids = Project.accessible_by(current_ability, :membered).uniq.pluck(:id) pr_ids = Project.accessible_by(current_ability, :membered).uniq.pluck(:id)
@all_issues = Issue.where(:project_id => pr_ids).without_pull_requests @all_issues = Issue.where(:project_id => pr_ids)
@created_issues, @assigned_issues, @all_issues =
if action_name == 'issues'
[@created_issues.without_pull_requests,
@assigned_issues.without_pull_requests,
@all_issues.without_pull_requests]
else
[@created_issues.joins(:pull_request),
@assigned_issues.joins(:pull_request),
@all_issues.joins(:pull_request)]
end
case params[:filter] case params[:filter]
when 'created' when 'created'
@ -52,6 +62,10 @@ class Users::UsersController < Users::BaseController
render 'issues_index', :layout => request.xhr? ? 'with_sidebar' : 'application' render 'issues_index', :layout => request.xhr? ? 'with_sidebar' : 'application'
end end
def pull_requests
issues
end
protected protected
def find_user_by_key def find_user_by_key

View File

@ -3,7 +3,3 @@
%ul %ul
- (collection = t 'feed_menu').each do |base, title| - (collection = t 'feed_menu').each do |base, title|
%li= link_to title, root_path(:filter => base), :class => controller_name == 'activity_feeds' && @filter == base ? 'active' : '' %li= link_to title, root_path(:filter => base), :class => controller_name == 'activity_feeds' && @filter == base ? 'active' : ''
-#
%li
= image_tag 'menu-delimiter.png', :style => 'margin-bottom: -7px;'
%li=link_to t('users.users.issues_index.title'), issues_path, :class => controller_name== 'users' && action_name == 'issues' ? 'active' : ''

View File

@ -4,4 +4,4 @@
%ul %ul
%li= link_to t('activity_menu.activity_feed'), root_path, :class => controller_name == 'activity_feeds' ? 'active' : '' %li= link_to t('activity_menu.activity_feed'), root_path, :class => controller_name == 'activity_feeds' ? 'active' : ''
%li= link_to t('activity_menu.tracker'), issues_path, :class => controller_name == 'users' && action_name == 'issues' ? 'active' : '' %li= link_to t('activity_menu.tracker'), issues_path, :class => controller_name == 'users' && action_name == 'issues' ? 'active' : ''
%li= link_to t('activity_menu.pull_requests'), root_path, :class => controller_name == 'users' && action_name == 'pull_requests' ? 'active' : '' %li= link_to t('activity_menu.pull_requests'), pull_requests_path, :class => controller_name == 'users' && action_name == 'pull_requests' ? 'active' : ''

View File

@ -1,7 +1,7 @@
-set_meta_tags :title => t('.title') -set_meta_tags :title => t("users.users.#{action_name}_index.title")
-render('activity_feeds/top_menu') -render('activity_feeds/top_menu')
-content_for :sidebar do -content_for :sidebar do
=form_tag issues_path, :id => 'filter_issues', :method => :get do =form_tag send("#{action_name}_path"), :id => 'filter_issues', :method => :get do
.bordered .bordered
%table %table
-%w[all assigned created].each do |filter| -%w[all assigned created].each do |filter|

View File

@ -19,7 +19,7 @@ en:
no_one_is_assigned: No one is assigned no_one_is_assigned: No one is assigned
assign_someone: Assign someone to this issue assign_someone: Assign someone to this issue
list: List list: List
all: All issues all: All
assigned: Assigned to me assigned: Assigned to me
created: Created by you created: Created by you
edit: Edit edit: Edit

View File

@ -19,7 +19,7 @@ ru:
no_one_is_assigned: Никто не назначен no_one_is_assigned: Никто не назначен
assign_someone: Назначить кого-либо на задачу assign_someone: Назначить кого-либо на задачу
list: Список list: Список
all: Все задачи all: Все
assigned: Назначенные мне assigned: Назначенные мне
created: Созданные мной created: Созданные мной
edit: Редактировать edit: Редактировать

View File

@ -9,6 +9,8 @@ en:
users: users:
issues_index: issues_index:
title: 'Your Issues' title: 'Your Issues'
pull_requests_index:
title: 'Your Pull Requests'
projects: projects:
build_lists: build_lists:
index: index:

View File

@ -9,6 +9,8 @@ ru:
users: users:
issues_index: issues_index:
title: 'Ваши задачи' title: 'Ваши задачи'
pull_requests_index:
title: 'Ваши пул реквесты'
projects: projects:
build_lists: build_lists:
index: index: