From 7400cfc11484b35945cefe8bd42ea02f2675b775 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 15 Jun 2015 18:48:54 -0400 Subject: [PATCH 1/4] Bootlint: Use offset grid classes instead of empty divs --- app/views/admin/groups/_form.html.haml | 3 +-- app/views/admin/projects/show.html.haml | 3 +-- app/views/groups/edit.html.haml | 3 +-- app/views/groups/new.html.haml | 3 +-- app/views/profiles/show.html.haml | 3 +-- app/views/projects/_issuable_form.html.haml | 2 +- app/views/projects/blob/_remove.html.haml | 3 +-- app/views/projects/edit.html.haml | 3 +-- app/views/projects/labels/_form.html.haml | 2 +- app/views/projects/wikis/_form.html.haml | 3 +-- 10 files changed, 10 insertions(+), 18 deletions(-) diff --git a/app/views/admin/groups/_form.html.haml b/app/views/admin/groups/_form.html.haml index 9e7751830a4..8de2ba74a79 100644 --- a/app/views/admin/groups/_form.html.haml +++ b/app/views/admin/groups/_form.html.haml @@ -12,8 +12,7 @@ - if @group.new_record? .form-group - .col-sm-2 - .col-sm-10 + .col-sm-offset-2.col-sm-10 .alert.alert-info = render 'shared/group_tips' .form-actions diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index 4c2865ac3f2..5260eadf95b 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -92,8 +92,7 @@ = namespace_select_tag :new_namespace_id, selected: params[:namespace_id], class: 'input-large' .form-group - .col-sm-2 - .col-sm-10 + .col-sm-offset-2.col-sm-10 = f.submit 'Transfer', class: 'btn btn-primary' .col-md-6 diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index 85179d4c4a2..aa13ed85b53 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -11,8 +11,7 @@ = render 'shared/group_form', f: f .form-group - .col-sm-2 - .col-sm-10 + .col-sm-offset-2.col-sm-10 = image_tag group_icon(@group), alt: '', class: 'avatar group-avatar s160' %p.light - if @group.avatar? diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index edb882bea19..0665cdf387a 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -13,8 +13,7 @@ = render 'shared/choose_group_avatar_button', f: f .form-group - .col-sm-2 - .col-sm-10 + .col-sm-offset-2.col-sm-10 = render 'shared/group_tips' .form-actions diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 6534afb0e89..37a3952635e 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -109,6 +109,5 @@ .row .col-md-7 .form-group - .col-sm-2   - .col-sm-10 + .col-sm-offset-2.col-sm-10 = f.submit 'Save changes', class: "btn btn-success" diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml index 491e2107da4..4d93c89c93a 100644 --- a/app/views/projects/_issuable_form.html.haml +++ b/app/views/projects/_issuable_form.html.haml @@ -1,6 +1,6 @@ - if issuable.errors.any? .row - .col-sm-10.col-sm-offset-2 + .col-sm-offset-2.col-sm-10 .alert.alert-danger - issuable.errors.full_messages.each do |msg| %span= msg diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml index 09559a4967b..fb6be0e089f 100644 --- a/app/views/projects/blob/_remove.html.haml +++ b/app/views/projects/blob/_remove.html.haml @@ -13,8 +13,7 @@ = render 'shared/commit_message_container', params: params, placeholder: 'Removed this file because...' .form-group - .col-sm-2 - .col-sm-10 + .col-sm-offset-2.col-sm-10 = button_tag 'Remove file', class: 'btn btn-remove btn-remove-file' = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal" diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 2765f63c6bc..3fecd25c324 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -80,8 +80,7 @@ %legend Project avatar: .form-group - .col-sm-2 - .col-sm-10 + .col-sm-offset-2.col-sm-10 - if @project.avatar? = project_icon("#{@project.namespace.to_param}/#{@project.to_param}", alt: '', class: 'avatar project-avatar s160') %p.light diff --git a/app/views/projects/labels/_form.html.haml b/app/views/projects/labels/_form.html.haml index 261d52dedc1..d791ed3410c 100644 --- a/app/views/projects/labels/_form.html.haml +++ b/app/views/projects/labels/_form.html.haml @@ -1,7 +1,7 @@ = form_for [@project.namespace.becomes(Namespace), @project, @label], html: { class: 'form-horizontal label-form' } do |f| -if @label.errors.any? .row - .col-sm-10.col-sm-offset-2 + .col-sm-offset-2.col-sm-10 .alert.alert-danger - @label.errors.full_messages.each do |msg| %span= msg diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 2a8ceaa2844..904600499ae 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -12,8 +12,7 @@ = f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: "form-control" .row - .col-sm-2 - .col-sm-10 + .col-sm-offset-2.col-sm-10 %p.cgray To link to a (new) page you can just type %code [Link Title](page-slug) From e3c1818a3e57fc1aee3cacc3123099f1deefe8a2 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 15 Jun 2015 18:53:06 -0400 Subject: [PATCH 2/4] Bootlint: Modals no longer need a '.hide' class --- app/views/help/_shortcuts.html.haml | 2 +- app/views/projects/_bitbucket_import_modal.html.haml | 2 +- app/views/projects/_github_import_modal.html.haml | 2 +- app/views/projects/_gitlab_import_modal.html.haml | 2 +- app/views/projects/blob/_remove.html.haml | 2 +- app/views/projects/merge_requests/show/_how_to_merge.html.haml | 2 +- app/views/projects/wikis/_new.html.haml | 2 +- app/views/shared/_confirm_modal.html.haml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/help/_shortcuts.html.haml b/app/views/help/_shortcuts.html.haml index ae072bacfb1..825acb0ae3e 100644 --- a/app/views/help/_shortcuts.html.haml +++ b/app/views/help/_shortcuts.html.haml @@ -1,4 +1,4 @@ -#modal-shortcuts.modal.hide{tabindex: -1} +#modal-shortcuts.modal{tabindex: -1} .modal-dialog .modal-content .modal-header diff --git a/app/views/projects/_bitbucket_import_modal.html.haml b/app/views/projects/_bitbucket_import_modal.html.haml index 07d4d602769..745163e79a7 100644 --- a/app/views/projects/_bitbucket_import_modal.html.haml +++ b/app/views/projects/_bitbucket_import_modal.html.haml @@ -1,4 +1,4 @@ -%div#bitbucket_import_modal.modal.hide +%div#bitbucket_import_modal.modal .modal-dialog .modal-content .modal-header diff --git a/app/views/projects/_github_import_modal.html.haml b/app/views/projects/_github_import_modal.html.haml index e88a0f7d689..de58b27df23 100644 --- a/app/views/projects/_github_import_modal.html.haml +++ b/app/views/projects/_github_import_modal.html.haml @@ -1,4 +1,4 @@ -%div#github_import_modal.modal.hide +%div#github_import_modal.modal .modal-dialog .modal-content .modal-header diff --git a/app/views/projects/_gitlab_import_modal.html.haml b/app/views/projects/_gitlab_import_modal.html.haml index 52212b6ae02..ae6c25f9371 100644 --- a/app/views/projects/_gitlab_import_modal.html.haml +++ b/app/views/projects/_gitlab_import_modal.html.haml @@ -1,4 +1,4 @@ -%div#gitlab_import_modal.modal.hide +%div#gitlab_import_modal.modal .modal-dialog .modal-content .modal-header diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml index fb6be0e089f..b8d8451880a 100644 --- a/app/views/projects/blob/_remove.html.haml +++ b/app/views/projects/blob/_remove.html.haml @@ -1,4 +1,4 @@ -#modal-remove-blob.modal.hide +#modal-remove-blob.modal .modal-dialog .modal-content .modal-header diff --git a/app/views/projects/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml index 6474d32ac08..22f601ac99e 100644 --- a/app/views/projects/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/projects/merge_requests/show/_how_to_merge.html.haml @@ -1,4 +1,4 @@ -%div#modal_merge_info.modal.hide +%div#modal_merge_info.modal .modal-dialog .modal-content .modal-header diff --git a/app/views/projects/wikis/_new.html.haml b/app/views/projects/wikis/_new.html.haml index b2c085f34b1..dace172438c 100644 --- a/app/views/projects/wikis/_new.html.haml +++ b/app/views/projects/wikis/_new.html.haml @@ -1,4 +1,4 @@ -%div#modal-new-wiki.modal.hide +%div#modal-new-wiki.modal .modal-dialog .modal-content .modal-header diff --git a/app/views/shared/_confirm_modal.html.haml b/app/views/shared/_confirm_modal.html.haml index 30ba361c860..5f51b0d450f 100644 --- a/app/views/shared/_confirm_modal.html.haml +++ b/app/views/shared/_confirm_modal.html.haml @@ -1,4 +1,4 @@ -#modal-confirm-danger.modal.hide{tabindex: -1} +#modal-confirm-danger.modal{tabindex: -1} .modal-dialog .modal-content .modal-header From 09b4e11d26d056ed2489baff65f319fc33143570 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 15 Jun 2015 18:53:50 -0400 Subject: [PATCH 3/4] Bootlint: Add missing `type` attribute for buttons --- app/views/layouts/header/_default.html.haml | 2 +- app/views/shared/_clone_panel.html.haml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 4ec50f35890..1403b86f377 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -5,7 +5,7 @@ = brand_header_logo %h3 GitLab .header-content - %button.navbar-toggle + %button.navbar-toggle{type: 'button'} %span.sr-only Toggle navigation = icon('bars') diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index 3f489a04e71..6de2aed29ed 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -3,6 +3,7 @@ .input-group-addon.git-protocols .input-group-btn %button{ | + type: 'button', | class: "btn btn-sm #{ 'active' if default_clone_protocol == 'ssh' }#{ ' has_tooltip' if current_user && current_user.require_ssh_key? }", | :"data-clone" => project.ssh_url_to_repo, | :"data-title" => "Add an SSH key to your profile
to pull or push via SSH", @@ -11,6 +12,7 @@ SSH .input-group-btn %button{ | + type: 'button', | class: "btn btn-sm #{ 'active' if default_clone_protocol == 'http' }#{ ' has_tooltip' if current_user && current_user.require_password? }", | :"data-clone" => project.http_url_to_repo, | :"data-title" => "Set a password on your account
to pull or push via #{gitlab_config.protocol.upcase}", From 0d7a0675ac7a14b4209fc617f578b83008981fd0 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 15 Jun 2015 18:58:58 -0400 Subject: [PATCH 4/4] Bootlint: Fix incorrectly nested `form-group` element --- app/views/shared/snippets/_form.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shared/snippets/_form.html.haml b/app/views/shared/snippets/_form.html.haml index 2feeeecc48b..fe25133abb0 100644 --- a/app/views/shared/snippets/_form.html.haml +++ b/app/views/shared/snippets/_form.html.haml @@ -12,8 +12,8 @@ = render 'shared/visibility_level', f: f, visibility_level: visibility_level, can_change_visibility_level: true, form_model: @snippet - .form-group - .file-editor + .file-editor + .form-group = f.label :file_name, "File", class: 'control-label' .col-sm-10 .file-holder.snippet