Commit c9caccd9 authored by Rubén Dávila's avatar Rubén Dávila Committed by Bob Van Landuyt

Refactor setting view to reuse code

parent 1f3c96f0
......@@ -48,6 +48,7 @@ class License < ActiveRecord::Base
service_desk
variable_environment_scope
reject_unsigned_commits
commit_author_check
].freeze
EEU_FEATURES = EEP_FEATURES
......
- return unless push_rule.available?(:commit_author_check)
- form = local_assigns.fetch(:form)
- push_rule = local_assigns.fetch(:push_rule)
.form-group
= form.check_box :commit_author_check, class: "pull-left", disabled: !can_change_push_rule?(f.object, :commit_author_check)
.prepend-left-20
= form.label :commit_author_check, class: "label-light append-bottom-0" do
Author restriction
%p.light.append-bottom-0
= commit_author_check_description(f.object)
= render 'shared/push_rules/reject_unsigned_commits_setting', form: f, push_rule: f.object
= render 'shared/push_rules/commit_author_check_setting', form: f, push_rule: f.object
.form-group
= f.check_box :commit_author_check, class: "pull-left", disabled: !can_change_push_rule?(f.object, :commit_author_check)
.prepend-left-20
= f.label :commit_author_check, class: "label-light append-bottom-0" do
Author restriction
%p.light.append-bottom-0
= commit_author_check_description(f.object)
= render 'shared/push_rules/reject_unsigned_commits_setting', form: f, push_rule: f.object
.form-group
= f.check_box :deny_delete_tag, class: "pull-left"
......
......@@ -4,7 +4,7 @@
- push_rule = local_assigns.fetch(:push_rule)
.form-group
= form.check_box :reject_unsigned_commits, class: "pull-left", disabled: !can_change_reject_unsigned_commits?(push_rule)
= form.check_box :reject_unsigned_commits, class: "pull-left", disabled: !can_change_push_rule?(f.object, :reject_unsigned_commits)
.prepend-left-20
= form.label :reject_unsigned_commits, class: "label-light append-bottom-0" do
Reject unsigned commits
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment