From d2362e2edf2b23318c6913535fe0ec3ea122d57e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 8 Jun 2016 11:38:19 +0100 Subject: Tests fix for ref switcher --- app/assets/stylesheets/framework/panels.scss | 4 ++++ app/controllers/projects_controller.rb | 2 +- app/views/projects/badges/index.html.haml | 2 +- app/views/shared/_ref_switcher.html.haml | 3 +-- 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/panels.scss b/app/assets/stylesheets/framework/panels.scss index ae7bdf14c40..874416e1007 100644 --- a/app/assets/stylesheets/framework/panels.scss +++ b/app/assets/stylesheets/framework/panels.scss @@ -9,6 +9,10 @@ margin-top: -2px; float: right; } + + .dropdown-menu-toggle { + line-height: 20px; + } } .panel-body { diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 0391d4a2442..aaa4e49eb42 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -261,7 +261,7 @@ class ProjectsController < Projects::ApplicationController # If reference is commit id - we should add it to branch/tag selectbox if @ref && !options.flatten.include?(@ref) && @ref =~ /\A[0-9a-zA-Z]{6,52}\z/ - options << {'Commits' => @ref} + options << { 'Commits' => @ref } end render json: options.to_json diff --git a/app/views/projects/badges/index.html.haml b/app/views/projects/badges/index.html.haml index ee63bc55a30..ac80951dd4f 100644 --- a/app/views/projects/badges/index.html.haml +++ b/app/views/projects/badges/index.html.haml @@ -7,7 +7,7 @@ %b Builds badge · = @build_badge.to_html .pull-right - = render 'shared/ref_switcher', destination: 'badges' + = render 'shared/ref_switcher', destination: 'badges', align_right: true .panel-body .row .col-md-2.text-center diff --git a/app/views/shared/_ref_switcher.html.haml b/app/views/shared/_ref_switcher.html.haml index a84e53ea642..b474ed00777 100644 --- a/app/views/shared/_ref_switcher.html.haml +++ b/app/views/shared/_ref_switcher.html.haml @@ -6,9 +6,8 @@ = hidden_field_tag key, value, id: nil .dropdown = dropdown_toggle @ref || @project.default_branch, { toggle: "dropdown", selected: @ref || @project.default_branch, refs_url: refs_namespace_project_path(@project.namespace, @project) }, { toggle_class: "js-project-refs-dropdown" } - .dropdown-menu.dropdown-menu-selectable + .dropdown-menu.dropdown-menu-selectable{ class: ("dropdown-menu-align-right" if local_assigns[:align_right]) } = dropdown_title "Switch branch/tag" = dropdown_filter "Search branches and tags" = dropdown_content = dropdown_loading - -# = select_tag "ref", grouped_options_refs, class: "project-refs-select select2 select2-sm" -- cgit v1.2.1