Commit bb0875a6 authored by Annabel Gray's avatar Annabel Gray

Merge branch 'jivl-fix-create-project-template-buttons' into 'master'

Fix use template buttons for creating a new project

Closes #47580

See merge request gitlab-org/gitlab-ce!19654
parents da6c3c4b 16361cea
...@@ -90,7 +90,7 @@ const bindEvents = () => { ...@@ -90,7 +90,7 @@ const bindEvents = () => {
function chooseTemplate() { function chooseTemplate() {
$('.template-option').hide(); $('.template-option').hide();
$projectFieldsForm.addClass('selected'); $projectFieldsForm.addClass('selected');
$selectedIcon.removeClass('active'); $selectedIcon.removeClass('d-block');
const value = $(this).val(); const value = $(this).val();
const templates = { const templates = {
rails: { rails: {
...@@ -109,7 +109,7 @@ const bindEvents = () => { ...@@ -109,7 +109,7 @@ const bindEvents = () => {
const selectedTemplate = templates[value]; const selectedTemplate = templates[value];
$selectedTemplateText.text(selectedTemplate.text); $selectedTemplateText.text(selectedTemplate.text);
$(selectedTemplate.icon).addClass('active'); $(selectedTemplate.icon).addClass('d-block');
$templateProjectNameInput.focus(); $templateProjectNameInput.focus();
} }
......
...@@ -293,3 +293,9 @@ input[type=color].form-control { ...@@ -293,3 +293,9 @@ input[type=color].form-control {
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
} }
} }
.project-templates-buttons {
.btn {
vertical-align: unset;
}
}
...@@ -497,6 +497,12 @@ ...@@ -497,6 +497,12 @@
&:not(:first-child) { &:not(:first-child) {
border-top: 1px solid $border-color; border-top: 1px solid $border-color;
} }
.btn-template-icon {
position: absolute;
left: $gl-padding;
top: $gl-padding;
}
} }
.template-title { .template-title {
...@@ -514,12 +520,6 @@ ...@@ -514,12 +520,6 @@
} }
} }
svg {
position: absolute;
left: $gl-padding;
top: $gl-padding;
}
.project-fields-form { .project-fields-form {
display: none; display: none;
...@@ -530,34 +530,23 @@ ...@@ -530,34 +530,23 @@
} }
.template-input-group { .template-input-group {
position: relative; .input-group-prepend {
@include media-breakpoint-up(sm) {
display: flex;
}
.input-group-prepend,
.input-group-append {
flex: 1; flex: 1;
text-align: left;
padding-left: ($gl-padding * 3);
background-color: $white-light;
} }
.selected-template { .input-group-text {
line-height: 20px; width: 100%;
background-color: $white-light;
} }
.selected-icon { .selected-icon {
padding-right: $gl-padding;
svg { svg {
display: none; display: none;
top: 7px; top: 7px;
height: 20px; height: 20px;
width: 20px; width: 20px;
&.active {
display: block;
}
} }
} }
} }
......
...@@ -10,16 +10,18 @@ ...@@ -10,16 +10,18 @@
%a.btn.btn-default{ href: template.preview, rel: 'noopener noreferrer', target: '_blank' } Preview %a.btn.btn-default{ href: template.preview, rel: 'noopener noreferrer', target: '_blank' } Preview
.project-fields-form .project-fields-form
.form-group .row
%label.label-light .form-group.col-sm-12
Template %label.label-light
.input-group.template-input-group Template
.input-group-prepend .input-group.template-input-group
.input-group-text .input-group-prepend
.selected-icon .input-group-text
- Gitlab::ProjectTemplate.all.each do |template| .selected-icon
= custom_icon(template.logo) - Gitlab::ProjectTemplate.all.each do |template|
.selected-template = custom_icon(template.logo)
%button.btn.btn-default.change-template{ type: "button" } Change template .selected-template
.input-group-append
%button.btn.btn-default.change-template{ type: "button" } Change template
= render 'new_project_fields', f: f, project_name_id: "template-project-name" = render 'new_project_fields', f: f, project_name_id: "template-project-name"
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