Commit 07c7edd3 authored by Eric Eastwood's avatar Eric Eastwood

Update variable rows to be full width with extra button

See https://gitlab.slack.com/archives/C5XGWBRJA/p1499355359953774
parent 8a950baf
...@@ -153,6 +153,7 @@ $code_line_height: 1.6; ...@@ -153,6 +153,7 @@ $code_line_height: 1.6;
* Padding * Padding
*/ */
$gl-padding: 16px; $gl-padding: 16px;
$gl-col-padding: 15px;
$gl-btn-padding: 10px; $gl-btn-padding: 10px;
$gl-input-padding: 10px; $gl-input-padding: 10px;
$gl-vert-padding: 6px; $gl-vert-padding: 6px;
...@@ -443,6 +444,7 @@ $logs-p-color: #333; ...@@ -443,6 +444,7 @@ $logs-p-color: #333;
/* /*
* Forms * Forms
*/ */
$input-height: 34px;
$input-danger-bg: #f2dede; $input-danger-bg: #f2dede;
$input-danger-border: $red-400; $input-danger-border: $red-400;
$input-group-addon-bg: #f7f8fa; $input-group-addon-bg: #f7f8fa;
......
...@@ -79,42 +79,60 @@ ...@@ -79,42 +79,60 @@
margin-left: 0; margin-left: 0;
margin-bottom: 0; margin-bottom: 0;
padding-left: 0; padding-left: 0;
list-style: none;
clear: both;
} }
.pipeline-variable-row { .pipeline-variable-row {
display: flex; display: flex;
align-items: flex-end;
&:not(:last-child) { &:not(:last-child) {
margin-bottom: $gl-btn-padding; margin-bottom: $gl-btn-padding;
} }
@media (max-width: $screen-xs-max) { @media (max-width: $screen-sm-max) {
flex-wrap: wrap; padding-right: $gl-col-padding;
} }
&:last-child { &:last-child {
& > .pipeline-variable-row-remove-button { & .pipeline-variable-row-remove-button {
display: none; display: none;
} }
& > .pipeline-variable-value-input { @media (max-width: $screen-sm-max) {
margin-right: $pipeline-variable-remove-button-width; & .pipeline-variable-value-input {
margin-right: $pipeline-variable-remove-button-width;
}
}
@media (max-width: $screen-xs-max) {
.pipeline-variable-row-body {
margin-right: $pipeline-variable-remove-button-width;
}
} }
} }
} }
.pipeline-variable-key-input { .pipeline-variable-row-body {
margin-right: $gl-btn-padding; display: flex;
width: calc(75% - #{$gl-col-padding});
padding-left: $gl-col-padding;
@media (max-width: $screen-sm-max) {
width: 100%;
}
@media (max-width: $screen-xs-max) { @media (max-width: $screen-xs-max) {
margin-right: $pipeline-variable-remove-button-width; display: block;
margin-bottom: $gl-btn-padding;
} }
} }
.pipeline-variable-value-input { .pipeline-variable-key-input {
margin-right: $gl-btn-padding;
@media (max-width: $screen-xs-max) { @media (max-width: $screen-xs-max) {
flex: 1; margin-bottom: $gl-btn-padding;
} }
} }
...@@ -124,6 +142,7 @@ ...@@ -124,6 +142,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: $pipeline-variable-remove-button-width; width: $pipeline-variable-remove-button-width;
height: $input-height;
padding: 0; padding: 0;
background: transparent; background: transparent;
border: 0; border: 0;
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
.col-md-9 .col-md-9
%label.label-light %label.label-light
#{ s_('PipelineSchedules|Variables') } #{ s_('PipelineSchedules|Variables') }
%ul.js-pipeline-variable-list.pipeline-variable-list %ul.js-pipeline-variable-list.pipeline-variable-list
- @schedule.variables.each do |variable| - @schedule.variables.each do |variable|
= render 'variable_row', id: variable.id, key: variable.key, value: variable.value = render 'variable_row', id: variable.id, key: variable.key, value: variable.value
= render 'variable_row' = render 'variable_row'
.form-group .form-group
.col-md-9 .col-md-9
= f.label :active, s_('PipelineSchedules|Activated'), class: 'label-light' = f.label :active, s_('PipelineSchedules|Activated'), class: 'label-light'
......
...@@ -2,15 +2,16 @@ ...@@ -2,15 +2,16 @@
- key = local_assigns.fetch(:key, "") - key = local_assigns.fetch(:key, "")
- value = local_assigns.fetch(:value, "") - value = local_assigns.fetch(:value, "")
%li.js-row.pipeline-variable-row{ data: { is_persisted: "#{!id.nil?}" } } %li.js-row.pipeline-variable-row{ data: { is_persisted: "#{!id.nil?}" } }
%input{ type: "hidden", name: "schedule[variables_attributes][][id]", value: id } .pipeline-variable-row-body
%input.js-destroy-input{ type: "hidden", name: "schedule[variables_attributes][][_destroy]" } %input{ type: "hidden", name: "schedule[variables_attributes][][id]", value: id }
%input.js-user-input.pipeline-variable-key-input.form-control{ type: "text", %input.js-destroy-input{ type: "hidden", name: "schedule[variables_attributes][][_destroy]" }
name: "schedule[variables_attributes][][key]", %input.js-user-input.pipeline-variable-key-input.form-control{ type: "text",
value: key, name: "schedule[variables_attributes][][key]",
placeholder: s_('PipelineSchedules|Input variable key') } value: key,
%textarea.js-user-input.pipeline-variable-value-input.form-control{ rows: 1, placeholder: s_('PipelineSchedules|Input variable key') }
name: "schedule[variables_attributes][][value]", %textarea.js-user-input.pipeline-variable-value-input.form-control{ rows: 1,
placeholder: s_('PipelineSchedules|Input variable value') } name: "schedule[variables_attributes][][value]",
= value placeholder: s_('PipelineSchedules|Input variable value') }
= value
%button.js-row-remove-button.pipeline-variable-row-remove-button{ 'aria-label': s_('PipelineSchedules|Remove variable row') } %button.js-row-remove-button.pipeline-variable-row-remove-button{ 'aria-label': s_('PipelineSchedules|Remove variable row') }
%i.fa.fa-minus-circle{ 'aria-hidden': "true" } %i.fa.fa-minus-circle{ 'aria-hidden': "true" }
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