Merge branch 'pre_trustie_server' into trustie_server
This commit is contained in:
commit
58354dc944
|
@ -1,12 +1,12 @@
|
||||||
class IssuesController < ApplicationController
|
class IssuesController < ApplicationController
|
||||||
before_action :require_login, except: [:index, :show, :index_chosen]
|
before_action :require_login, except: [:index, :show, :index_chosen, :index_to_name]
|
||||||
before_action :require_profile_completed, only: [:create]
|
before_action :require_profile_completed, only: [:create]
|
||||||
before_action :load_project
|
before_action :load_project
|
||||||
before_action :set_user
|
before_action :set_user
|
||||||
before_action :check_menu_authorize, except: [:index_chosen]
|
before_action :check_menu_authorize, except: [:index_chosen]
|
||||||
before_action :check_issue_permission
|
before_action :check_issue_permission
|
||||||
before_action :operate_issue_permission, only:[:create, :update, :destroy, :clean, :series_update, :copy]
|
before_action :operate_issue_permission, only:[:create, :update, :destroy, :clean, :series_update, :copy]
|
||||||
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue]
|
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue, :index_to_name]
|
||||||
|
|
||||||
before_action :set_issue, only: [:edit, :update, :destroy, :show, :copy, :close_issue, :lock_issue]
|
before_action :set_issue, only: [:edit, :update, :destroy, :show, :copy, :close_issue, :lock_issue]
|
||||||
before_action :check_token_enough, :find_atme_receivers, only: [:create, :update]
|
before_action :check_token_enough, :find_atme_receivers, only: [:create, :update]
|
||||||
|
@ -49,6 +49,27 @@ class IssuesController < ApplicationController
|
||||||
@issue_chosen = issue_left_chosen(@project, nil)
|
@issue_chosen = issue_left_chosen(@project, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def index_to_name
|
||||||
|
issues_index = params[:index].map(&:to_i)
|
||||||
|
exit_index = []
|
||||||
|
issues_result = @project.issues.where(project_issues_index:issues_index).map{ |e|
|
||||||
|
exit_index << e.project_issues_index
|
||||||
|
{
|
||||||
|
id:e.id,
|
||||||
|
project_issues_index:e.project_issues_index,
|
||||||
|
subject:e.subject
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
not_exit = issues_index - exit_index
|
||||||
|
not_exit.map{|e|
|
||||||
|
issues_result << {id: nil,
|
||||||
|
project_issues_index:e,
|
||||||
|
subject: nil}
|
||||||
|
}
|
||||||
|
render json: issues_result
|
||||||
|
end
|
||||||
|
|
||||||
def commit_issues
|
def commit_issues
|
||||||
issues = @project.issues.issue_issue.includes(:user,:tracker)
|
issues = @project.issues.issue_issue.includes(:user,:tracker)
|
||||||
issues = issues.where(is_private: false) unless current_user.present? && (current_user.admin? || @project.member?(current_user))
|
issues = issues.where(is_private: false) unless current_user.present? && (current_user.admin? || @project.member?(current_user))
|
||||||
|
|
|
@ -574,6 +574,7 @@ Rails.application.routes.draw do
|
||||||
get :index_chosen
|
get :index_chosen
|
||||||
post :clean
|
post :clean
|
||||||
post :series_update
|
post :series_update
|
||||||
|
get :index_to_name
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
post :copy
|
post :copy
|
||||||
|
|
Loading…
Reference in New Issue