diff --git a/app/assets/javascripts/projects.js b/app/assets/javascripts/projects.js index be1b75b9..6bbfbacc 100644 --- a/app/assets/javascripts/projects.js +++ b/app/assets/javascripts/projects.js @@ -14,3 +14,12 @@ function Projects() { disableButtonIfEmtpyField("#project_name", ".project-submit") } + +function initGitCloneSwitcher() { + var link_sel = ".project_clone_holder button"; + $(link_sel).bind("click", function(e) { + $(link_sel).removeClass("active"); + $(this).addClass("active"); + $("#project_clone").val($(this).attr("data-clone")); + }) +} diff --git a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss index 894cb304..70f7889f 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss @@ -1,6 +1,6 @@ /** * =================================== - * Contain 3 main UI block elements: + * Contain 3 main UI block elements: * .main_box - for show pages * .ui-box - for simple block & widgets * =================================== diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index 721b569d..92d0fc43 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -75,17 +75,21 @@ padding: 4px 7px; border: 1px solid #CCC; margin-bottom:5px; - input[type=text] { +} + +.project_clone_holder { + input[type="text"] { border: 1px solid #BBB; + box-shadow: none; } } -.save-project-loader { - img { +.save-project-loader { + img { margin-top:50px; margin-bottom:50px; } - h3 { + h3 { @extend .page_title; } diff --git a/app/views/projects/_clone_panel.html.haml b/app/views/projects/_clone_panel.html.haml index 839a98a0..76059f32 100644 --- a/app/views/projects/_clone_panel.html.haml +++ b/app/views/projects/_clone_panel.html.haml @@ -3,8 +3,8 @@ .span7 .form-horizontal .input-prepend.project_clone_holder - = link_to "SSH", "#", class: "btn small active", :"data-clone" => @project.ssh_url_to_repo - = link_to "HTTP", "#", class: "btn small", :"data-clone" => @project.http_url_to_repo + %button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH + %button{class: "btn small", :"data-clone" => @project.http_url_to_repo} HTTP = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5" .span4.right .right diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 77a0ef1a..de3e9cef 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -5,10 +5,5 @@ :javascript $(function(){ - var link_sel = ".project_clone_holder a"; - $(link_sel).bind("click", function() { - $(link_sel).removeClass("active"); - $(this).addClass("active"); - $("#project_clone").val($(this).attr("data-clone")); - }) + initGitCloneSwitcher(); }) diff --git a/app/views/refs/_head.html.haml b/app/views/refs/_head.html.haml index 8825493a..affd07cb 100644 --- a/app/views/refs/_head.html.haml +++ b/app/views/refs/_head.html.haml @@ -7,4 +7,13 @@ %li{class: "#{'active' if (controller.controller_name == "refs") }"} = link_to tree_project_ref_path(@project, @ref) do Source + %li.right + .input-prepend.project_clone_holder + %button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH + %button{class: "btn small", :"data-clone" => @project.http_url_to_repo} HTTP + = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5" +:javascript + $(function(){ + initGitCloneSwitcher(); + }) diff --git a/app/views/refs/tree.js.haml b/app/views/refs/tree.js.haml index 2eccf8c1..92e90579 100644 --- a/app/views/refs/tree.js.haml +++ b/app/views/refs/tree.js.haml @@ -6,5 +6,5 @@ // Load last commit log for each file in tree $('#tree-slider').waitForImages(function() { - ajaxGet('#{@logs_path}'); + ajaxGet('#{@logs_path}'); });