Show Issues tracker select only if one or more remote issue trackers available

This commit is contained in:
Andrew8xx8 2013-02-19 17:31:45 +04:00
parent 8caccae454
commit cff845784e
2 changed files with 14 additions and 12 deletions

View file

@ -31,13 +31,14 @@
= f.label :issues_enabled, "Issues" = f.label :issues_enabled, "Issues"
.input= f.check_box :issues_enabled .input= f.check_box :issues_enabled
.clearfix - if Project.issues_tracker.values.count > 1
= f.label :issues_tracker, "Issues tracker", class: 'control-label' .clearfix
.input= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled }) = f.label :issues_tracker, "Issues tracker", class: 'control-label'
.input= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled })
.clearfix .clearfix
= f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label' = f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label'
.input= f.text_field :issues_tracker_id, class: "xxlarge", disabled: !@project.can_have_issues_tracker_id? .input= f.text_field :issues_tracker_id, class: "xxlarge", disabled: !@project.can_have_issues_tracker_id?
.clearfix .clearfix
= f.label :merge_requests_enabled, "Merge Requests" = f.label :merge_requests_enabled, "Merge Requests"

View file

@ -24,13 +24,14 @@
= f.check_box :issues_enabled = f.check_box :issues_enabled
%span.descr Lightweight issue tracking system for this project %span.descr Lightweight issue tracking system for this project
.control-group - if Project.issues_tracker.values.count > 1
= f.label :issues_tracker, "Issues tracker", class: 'control-label' .control-group
.input= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled }) = f.label :issues_tracker, "Issues tracker", class: 'control-label'
.input= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled })
.clearfix .clearfix
= f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label' = f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label'
.input= f.text_field :issues_tracker_id, class: "xxlarge", disabled: !@project.can_have_issues_tracker_id? .input= f.text_field :issues_tracker_id, class: "xxlarge", disabled: !@project.can_have_issues_tracker_id?
.control-group .control-group
= f.label :merge_requests_enabled, "Merge Requests", class: 'control-label' = f.label :merge_requests_enabled, "Merge Requests", class: 'control-label'