From 53bf57f3acf00436ee16f93cda433670c08a2275 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Thu, 12 Apr 2018 17:55:40 -0500 Subject: [PATCH] [skip ci] input-group-btn's input-group-text should not create a new div --- app/views/import/_githubish_status.html.haml | 13 ++++---- app/views/import/bitbucket/status.html.haml | 13 ++++---- .../personal_access_tokens/index.html.haml | 3 +- .../projects/_issuable_by_email.html.haml | 15 ++++----- .../projects/_new_project_push_tip.html.haml | 3 +- .../projects/clusters/gcp/_show.html.haml | 9 ++---- .../projects/pages_domains/show.html.haml | 3 +- .../_detailed_help.html.haml | 21 ++++-------- .../slack_slash_commands/_help.html.haml | 15 +++------ app/views/shared/_clone_panel.html.haml | 32 +++++++++---------- 10 files changed, 52 insertions(+), 75 deletions(-) diff --git a/app/views/import/_githubish_status.html.haml b/app/views/import/_githubish_status.html.haml index a25e86c65c2..f7094375023 100644 --- a/app/views/import/_githubish_status.html.haml +++ b/app/views/import/_githubish_status.html.haml @@ -47,13 +47,12 @@ %fieldset.row .input-group .project-path.input-group-prepend - .input-group-text - - if current_user.can_select_namespace? - - selected = params[:namespace_id] || :current_user - - opts = current_user.can_create_group? ? { extra_group: Group.new(name: repo.owner.login, path: repo.owner.login) } : {} - = select_tag :namespace_id, namespaces_options(selected, opts.merge({ display_path: true })), { class: 'select2 js-select-namespace', tabindex: 1 } - - else - = text_field_tag :path, current_user.namespace_path, class: "input-large form-control", tabindex: 1, disabled: true + - if current_user.can_select_namespace? + - selected = params[:namespace_id] || :current_user + - opts = current_user.can_create_group? ? { extra_group: Group.new(name: repo.owner.login, path: repo.owner.login) } : {} + = select_tag :namespace_id, namespaces_options(selected, opts.merge({ display_path: true })), { class: 'input-group-text select2 js-select-namespace', tabindex: 1 } + - else + = text_field_tag :path, current_user.namespace_path, class: "input-group-text input-large form-control", tabindex: 1, disabled: true %span.input-group-prepend .input-group-text / = text_field_tag :path, repo.name, class: "input-mini form-control", tabindex: 2, autofocus: true, required: true diff --git a/app/views/import/bitbucket/status.html.haml b/app/views/import/bitbucket/status.html.haml index a5a5e94a301..45e354eddfe 100644 --- a/app/views/import/bitbucket/status.html.haml +++ b/app/views/import/bitbucket/status.html.haml @@ -55,13 +55,12 @@ %fieldset.row .input-group .project-path.input-group-prepend - .input-group-text - - if current_user.can_select_namespace? - - selected = params[:namespace_id] || :current_user - - opts = current_user.can_create_group? ? { extra_group: Group.new(name: repo.owner, path: repo.owner) } : {} - = select_tag :namespace_id, namespaces_options(selected, opts.merge({ display_path: true })), { class: 'select2 js-select-namespace', tabindex: 1 } - - else - = text_field_tag :path, current_user.namespace_path, class: "input-large form-control", tabindex: 1, disabled: true + - if current_user.can_select_namespace? + - selected = params[:namespace_id] || :current_user + - opts = current_user.can_create_group? ? { extra_group: Group.new(name: repo.owner, path: repo.owner) } : {} + = select_tag :namespace_id, namespaces_options(selected, opts.merge({ display_path: true })), { class: 'input-group-text select2 js-select-namespace', tabindex: 1 } + - else + = text_field_tag :path, current_user.namespace_path, class: "input-group-text input-large form-control", tabindex: 1, disabled: true %span.input-group-prepend .input-group-text / = text_field_tag :path, repo.name, class: "input-mini form-control", tabindex: 2, autofocus: true, required: true diff --git a/app/views/profiles/personal_access_tokens/index.html.haml b/app/views/profiles/personal_access_tokens/index.html.haml index 4b02bcce9ed..d253e8e456e 100644 --- a/app/views/profiles/personal_access_tokens/index.html.haml +++ b/app/views/profiles/personal_access_tokens/index.html.haml @@ -21,8 +21,7 @@ .input-group = text_field_tag 'created-personal-access-token', @new_personal_access_token, readonly: true, class: "form-control js-select-on-focus", 'aria-describedby' => "created-personal-access-token-help-block" %span.input-group-append - .input-group-text - = clipboard_button(text: @new_personal_access_token, title: "Copy personal access token to clipboard", placement: "left", class: "btn-default btn-clipboard") + = clipboard_button(text: @new_personal_access_token, title: "Copy personal access token to clipboard", placement: "left", class: "input-group-text btn-default btn-clipboard") %span#created-personal-access-token-help-block.form-text.text-muted.text-danger Make sure you save it - you won't be able to access it again. %hr diff --git a/app/views/projects/_issuable_by_email.html.haml b/app/views/projects/_issuable_by_email.html.haml index 1704b52ef6c..e3dc0677bd6 100644 --- a/app/views/projects/_issuable_by_email.html.haml +++ b/app/views/projects/_issuable_by_email.html.haml @@ -18,14 +18,13 @@ .email-modal-input-group.input-group = text_field_tag :issuable_email, email, class: "monospace js-select-on-focus form-control", readonly: true .input-group-append - .input-group-text - = clipboard_button(target: '#issuable_email', class: 'btn btn-clipboard btn-transparent d-none d-sm-block') - = mail_to email, class: 'btn btn-clipboard btn-transparent', - subject: _("Enter the #{name} title"), - body: _("Enter the #{name} description"), - title: _('Send email'), - data: { toggle: 'tooltip', placement: 'bottom' } do - = sprite_icon('mail') + = clipboard_button(target: '#issuable_email', class: 'btn btn-clipboard input-group-text btn-transparent d-none d-sm-block') + = mail_to email, class: 'btn btn-clipboard btn-transparent', + subject: _("Enter the #{name} title"), + body: _("Enter the #{name} description"), + title: _('Send email'), + data: { toggle: 'tooltip', placement: 'bottom' } do + = sprite_icon('mail') %p = render 'by_email_description' diff --git a/app/views/projects/_new_project_push_tip.html.haml b/app/views/projects/_new_project_push_tip.html.haml index 00d2d3df082..22e9522c0e7 100644 --- a/app/views/projects/_new_project_push_tip.html.haml +++ b/app/views/projects/_new_project_push_tip.html.haml @@ -6,7 +6,6 @@ %span = text_field_tag :push_to_create_tip, push_to_create_project_command, class: "js-select-on-focus form-control monospace", readonly: true, aria: { label: _("Push project from command line") } %span.input-group-append - .input-group-text - = clipboard_button(text: push_to_create_project_command, title: _("Copy command to clipboard"), placement: "right") + = clipboard_button(text: push_to_create_project_command, title: _("Copy command to clipboard"), class: 'input-group-text', placement: "right") %p = link_to("What does this command do?", help_page_path("gitlab-basics/create-project", anchor: "push-to-create-a-new-project"), target: "_blank") diff --git a/app/views/projects/clusters/gcp/_show.html.haml b/app/views/projects/clusters/gcp/_show.html.haml index 47ab93d8ed2..4a84f900a2e 100644 --- a/app/views/projects/clusters/gcp/_show.html.haml +++ b/app/views/projects/clusters/gcp/_show.html.haml @@ -4,8 +4,7 @@ .input-group %input.form-control.cluster-name.js-select-on-focus{ value: @cluster.name, readonly: true } %span.input-group-append - .input-group-text - = clipboard_button(text: @cluster.name, title: s_('ClusterIntegration|Copy Kubernetes cluster name'), class: 'btn-secondary') + = clipboard_button(text: @cluster.name, title: s_('ClusterIntegration|Copy Kubernetes cluster name'), class: 'input-group-text btn-secondary') = form_for @cluster, url: namespace_project_cluster_path(@project.namespace, @project, @cluster), as: :cluster do |field| = form_errors(@cluster) @@ -16,16 +15,14 @@ .input-group = platform_kubernetes_field.text_field :api_url, class: 'form-control js-select-on-focus', placeholder: s_('ClusterIntegration|API URL'), readonly: true %span.input-group-append - .input-group-text - = clipboard_button(text: @cluster.platform_kubernetes.api_url, title: s_('ClusterIntegration|Copy API URL'), class: 'btn-secondary') + = clipboard_button(text: @cluster.platform_kubernetes.api_url, title: s_('ClusterIntegration|Copy API URL'), class: 'input-group-text btn-secondary') .form-group = platform_kubernetes_field.label :ca_cert, s_('ClusterIntegration|CA Certificate') .input-group = platform_kubernetes_field.text_area :ca_cert, class: 'form-control js-select-on-focus', placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'), readonly: true %span.input-group-append.clipboard-addon - .input-group-text - = clipboard_button(text: @cluster.platform_kubernetes.ca_cert, title: s_('ClusterIntegration|Copy CA Certificate'), class: 'btn-blank') + = clipboard_button(text: @cluster.platform_kubernetes.ca_cert, title: s_('ClusterIntegration|Copy CA Certificate'), class: 'input-group-text btn-blank') .form-group = platform_kubernetes_field.label :token, s_('ClusterIntegration|Token') diff --git a/app/views/projects/pages_domains/show.html.haml b/app/views/projects/pages_domains/show.html.haml index 1b604f21dce..ce27034a22d 100644 --- a/app/views/projects/pages_domains/show.html.haml +++ b/app/views/projects/pages_domains/show.html.haml @@ -31,8 +31,7 @@ .input-group = text_field_tag :domain_dns, dns_record , class: "monospace js-select-on-focus form-control", readonly: true .input-group-append - .input-group-text - = clipboard_button(target: '#domain_dns', class: 'btn-default d-none d-sm-block') + = clipboard_button(target: '#domain_dns', class: 'btn-default input-group-text d-none d-sm-block') %p.form-text.text-muted To access this domain create a new DNS record diff --git a/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml b/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml index aab9e12577e..209b9c71390 100644 --- a/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml +++ b/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml @@ -22,16 +22,14 @@ .col-sm-10.col-12.input-group = text_field_tag :display_name, "GitLab / #{@project.full_name}", class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#display_name') + = clipboard_button(target: '#display_name', class: 'input-group-text') .form-group = label_tag :description, 'Description', class: 'col-sm-2 col-12 col-form-label' .col-sm-10.col-12.input-group = text_field_tag :description, run_actions_text, class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#description') + = clipboard_button(target: '#description', class: 'input-group-text') .form-group = label_tag nil, 'Command trigger word', class: 'col-sm-2 col-12 col-form-label' @@ -48,8 +46,7 @@ .col-sm-10.col-12.input-group = text_field_tag :request_url, service_trigger_url(subject), class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#request_url') + = clipboard_button(target: '#request_url', class: 'input-group-text') .form-group = label_tag nil, 'Request method', class: 'col-sm-2 col-12 col-form-label' @@ -60,16 +57,14 @@ .col-sm-10.col-12.input-group = text_field_tag :response_username, 'GitLab', class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#response_username') + = clipboard_button(target: '#response_username', class: 'input-group-text') .form-group = label_tag :response_icon, 'Response icon', class: 'col-sm-2 col-12 col-form-label' .col-sm-10.col-12.input-group = text_field_tag :response_icon, asset_url('gitlab_logo.png'), class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#response_icon') + = clipboard_button(target: '#response_icon', class: 'input-group-text') .form-group = label_tag nil, 'Autocomplete', class: 'col-sm-2 col-12 col-form-label' @@ -80,16 +75,14 @@ .col-sm-10.col-12.input-group = text_field_tag :autocomplete_hint, '[help]', class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#autocomplete_hint') + = clipboard_button(target: '#autocomplete_hint', class: 'input-group-text') .form-group = label_tag :autocomplete_description, 'Autocomplete description', class: 'col-sm-2 col-12 col-form-label' .col-sm-10.col-12.input-group = text_field_tag :autocomplete_description, run_actions_text, class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#autocomplete_description') + = clipboard_button(target: '#autocomplete_description', class: 'input-group-text') %hr diff --git a/app/views/projects/services/slack_slash_commands/_help.html.haml b/app/views/projects/services/slack_slash_commands/_help.html.haml index 72ae69bd10d..0e0c1d11cd4 100644 --- a/app/views/projects/services/slack_slash_commands/_help.html.haml +++ b/app/views/projects/services/slack_slash_commands/_help.html.haml @@ -40,8 +40,7 @@ .col-sm-10.col-12.input-group = text_field_tag :url, service_trigger_url(subject), class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#url') + = clipboard_button(target: '#url', class: 'input-group-text') .form-group = label_tag nil, 'Method', class: 'col-sm-2 col-12 col-form-label' @@ -52,8 +51,7 @@ .col-sm-10.col-12.input-group = text_field_tag :customize_name, 'GitLab', class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#customize_name') + = clipboard_button(target: '#customize_name', class: 'input-group-text') .form-group = label_tag nil, 'Customize icon', class: 'col-sm-2 col-12 col-form-label' @@ -70,24 +68,21 @@ .col-sm-10.col-12.input-group = text_field_tag :autocomplete_description, run_actions_text, class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#autocomplete_description') + = clipboard_button(target: '#autocomplete_description', class: 'input-group-text') .form-group = label_tag :autocomplete_usage_hint, 'Autocomplete usage hint', class: 'col-sm-2 col-12 col-form-label' .col-sm-10.col-12.input-group = text_field_tag :autocomplete_usage_hint, '[help]', class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#autocomplete_usage_hint') + = clipboard_button(target: '#autocomplete_usage_hint', class: 'input-group-text') .form-group = label_tag :descriptive_label, 'Descriptive label', class: 'col-sm-2 col-12 col-form-label' .col-sm-10.col-12.input-group = text_field_tag :descriptive_label, 'Perform common operations on GitLab project', class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append - .input-group-text - = clipboard_button(target: '#descriptive_label') + = clipboard_button(target: '#descriptive_label', class: 'input-group-text') %hr diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index 09ed9004d97..691f0020be6 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -2,23 +2,21 @@ .git-clone-holder.input-group .input-group-prepend - .input-group-text - - if allowed_protocols_present? - .clone-dropdown-btn.btn - %span - = enabled_project_button(project, enabled_protocol) - - else - %a#clone-dropdown.btn.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } } - %span - = default_clone_protocol.upcase - = icon('caret-down') - %ul.dropdown-menu.dropdown-menu-selectable.dropdown-menu-right.clone-options-dropdown - %li - = ssh_clone_button(project) - %li - = http_clone_button(project) + - if allowed_protocols_present? + .input-group-text.clone-dropdown-btn.btn + %span + = enabled_project_button(project, enabled_protocol) + - else + %a#clone-dropdown.input-group-text.btn.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } } + %span + = default_clone_protocol.upcase + = icon('caret-down') + %ul.dropdown-menu.dropdown-menu-selectable.dropdown-menu-right.clone-options-dropdown + %li + = ssh_clone_button(project) + %li + = http_clone_button(project) = text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: 'Project clone URL' } .input-group-append - .input-group-text - = clipboard_button(target: '#project_clone', title: _("Copy URL to clipboard"), class: "btn-secondary btn-clipboard") + = clipboard_button(target: '#project_clone', title: _("Copy URL to clipboard"), class: "input-group-text btn-secondary btn-clipboard")