From d5947ada4493335d49368ec193f4b9b801582deb Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 26 Jun 2015 15:45:45 +0200 Subject: Simplify set of assignee, milestone and label to admin_issue rule Signed-off-by: Dmitriy Zaporozhets --- app/views/shared/issuable/_context.html.haml | 4 ++-- app/views/shared/issuable/_filter.html.haml | 5 ++--- app/views/shared/issuable/_form.html.haml | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'app/views/shared/issuable') diff --git a/app/views/shared/issuable/_context.html.haml b/app/views/shared/issuable/_context.html.haml index 5fb6c5155cb..46990895d33 100644 --- a/app/views/shared/issuable/_context.html.haml +++ b/app/views/shared/issuable/_context.html.haml @@ -8,7 +8,7 @@ - else none .issuable-context-selectbox - - if can?(current_user, :set_assignee, @project) + - if can?(current_user, :admin_issue, @project) = users_select_tag("#{issuable.class.table_name.singularize}[assignee_id]", placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: issuable.assignee_id, project: @target_project, null_user: true) %div.prepend-top-20.clearfix @@ -24,7 +24,7 @@ - else none .issuable-context-selectbox - - if can?(current_user, :set_milestone, @project) + - if can?(current_user, :admin_issue, @project) = f.select(:milestone_id, milestone_options(issuable), { include_blank: 'Select milestone' }, {class: 'select2 select2-compact js-select2 js-milestone'}) = hidden_field_tag :issuable_context = f.submit class: 'btn hide' diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml index c03a34de446..a829782fc4f 100644 --- a/app/views/shared/issuable/_filter.html.haml +++ b/app/views/shared/issuable/_filter.html.haml @@ -29,11 +29,10 @@ .issues-details-filters = form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name]), method: :get, class: 'filter-form' do - - if controller.controller_name == 'issues' + - if controller.controller_name == 'issues' && can?(current_user, :admin_issue, @project) .check-all-holder = check_box_tag "check_all_issues", nil, false, - class: "check_all_issues left", - disabled: !can?(current_user, :modify_issue, @project) + class: "check_all_issues left" .issues-other-filters .filter-item.inline = users_select_tag(:assignee_id, selected: params[:assignee_id], diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 7095402bf05..e434e1b6b98 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -38,7 +38,7 @@ .clearfix .error-alert %hr -- if can?(current_user, :set_assignee, @project) +- if can?(current_user, :admin_issue, @project) .form-group .issue-assignee = f.label :assignee_id, class: 'control-label' do @@ -50,7 +50,6 @@ selected: issuable.assignee_id, project: @target_project || @project)   = link_to 'Assign to me', '#', class: 'btn assign-to-me-link' -- if can?(current_user, :set_milestone, @project) .form-group .issue-milestone = f.label :milestone_id, class: 'control-label' do @@ -66,7 +65,6 @@   - if can? current_user, :admin_milestone, issuable.project = link_to 'Create new milestone', new_namespace_project_milestone_path(issuable.project.namespace, issuable.project), target: :blank -- if can?(current_user, :set_label, @project) .form-group = f.label :label_ids, class: 'control-label' do %i.fa.fa-tag -- cgit v1.2.1