[#98] common pull requests
This commit is contained in:
parent
942d5a669e
commit
dd6a319dfb
|
@ -24,10 +24,20 @@ class Users::UsersController < Users::BaseController
|
|||
end
|
||||
|
||||
def issues
|
||||
@created_issues = current_user.issues.without_pull_requests
|
||||
@assigned_issues = Issue.where(:assignee_id => current_user.id).without_pull_requests
|
||||
@created_issues = current_user.issues
|
||||
@assigned_issues = Issue.where(:assignee_id => current_user.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]
|
||||
when 'created'
|
||||
|
@ -52,6 +62,10 @@ class Users::UsersController < Users::BaseController
|
|||
render 'issues_index', :layout => request.xhr? ? 'with_sidebar' : 'application'
|
||||
end
|
||||
|
||||
def pull_requests
|
||||
issues
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def find_user_by_key
|
||||
|
|
|
@ -3,7 +3,3 @@
|
|||
%ul
|
||||
- (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
|
||||
= 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' : ''
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
%ul
|
||||
%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.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' : ''
|
|
@ -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')
|
||||
-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
|
||||
%table
|
||||
-%w[all assigned created].each do |filter|
|
||||
|
|
|
@ -19,7 +19,7 @@ en:
|
|||
no_one_is_assigned: No one is assigned
|
||||
assign_someone: Assign someone to this issue
|
||||
list: List
|
||||
all: All issues
|
||||
all: All
|
||||
assigned: Assigned to me
|
||||
created: Created by you
|
||||
edit: Edit
|
||||
|
|
|
@ -19,7 +19,7 @@ ru:
|
|||
no_one_is_assigned: Никто не назначен
|
||||
assign_someone: Назначить кого-либо на задачу
|
||||
list: Список
|
||||
all: Все задачи
|
||||
all: Все
|
||||
assigned: Назначенные мне
|
||||
created: Созданные мной
|
||||
edit: Редактировать
|
||||
|
|
|
@ -9,6 +9,8 @@ en:
|
|||
users:
|
||||
issues_index:
|
||||
title: 'Your Issues'
|
||||
pull_requests_index:
|
||||
title: 'Your Pull Requests'
|
||||
projects:
|
||||
build_lists:
|
||||
index:
|
||||
|
|
|
@ -9,6 +9,8 @@ ru:
|
|||
users:
|
||||
issues_index:
|
||||
title: 'Ваши задачи'
|
||||
pull_requests_index:
|
||||
title: 'Ваши пул реквесты'
|
||||
projects:
|
||||
build_lists:
|
||||
index:
|
||||
|
|
Loading…
Reference in New Issue