diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-01-10 04:47:25 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-01-10 04:47:25 -0800 |
commit | 9f73388fd297a7ad73ae555847720d07ae62d132 (patch) | |
tree | 99f31a888ff23bb4a789733f0e925b45cfce20f8 /app | |
parent | 95e6a5dcd380d738fbf9d959111f049d15ca8d11 (diff) | |
parent | 04baf0b569a84430cb8c366594b82a72a4ff73b6 (diff) | |
download | gitlab-ce-9f73388fd297a7ad73ae555847720d07ae62d132.tar.gz |
Merge pull request #6002 from jhollingsworth/feature/clone-panel-twbs3
Update clone panel to use input group.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/project.js.coffee | 2 | ||||
-rw-r--r-- | app/assets/stylesheets/sections/projects.scss | 28 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 5 | ||||
-rw-r--r-- | app/views/projects/_home_panel.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/empty.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/wikis/git_access.html.haml | 17 | ||||
-rw-r--r-- | app/views/shared/_clone_panel.html.haml | 12 |
7 files changed, 29 insertions, 44 deletions
diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee index 9a41ec7a0be..4262418fd5e 100644 --- a/app/assets/javascripts/project.js.coffee +++ b/app/assets/javascripts/project.js.coffee @@ -35,7 +35,7 @@ $ -> $('a, button', scope).removeClass 'active' $(@).addClass 'active' $('#project_clone', scope).val $(@).data 'clone' - $(".clone").text("").append 'git remote add origin ' + $(@).data 'clone' + $(".clone").text("").append $(@).data 'clone' # Ref switcher $('.project-refs-select').on 'change', -> diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index 48defc4377d..7c1c8122fa7 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -72,45 +72,33 @@ } .git-clone-holder { - margin-right: 45px; - border: 1px solid #E1E1E1; - @include border-radius(4px); - - input[type="text"], - .btn { - border: none; - @include border-radius(0px); - border-left: 1px solid #E1E1E1; + .project-home-dropdown + & { + margin-right: 45px; + } + + .btn, + .form-control { + border: 1px solid #E1E1E1; box-shadow: none; padding: 6px 9px; } .btn { - float: left; background: none; color: #29b; - &:first-child { - @include border-radius-left(4px); - border-left: 0px; - } - &.active { color: #333; font-weight: bold; } } - input[type="text"] { + .form-control { cursor: auto; @extend .monospace; background: #FAFAFA; width: 100%; } - - .protocol-clone { - overflow: hidden; - } } .project-visibility-level-holder { diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index d3c69bdc620..ba1e0633901 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -180,8 +180,9 @@ module ProjectsHelper title end - def default_url_to_repo - current_user ? @project.url_to_repo : @project.http_url_to_repo + def default_url_to_repo(project = nil) + project = project || @project + current_user ? project.url_to_repo : project.http_url_to_repo end def default_clone_protocol diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 56af6722dc3..48e6ea91d94 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -11,8 +11,7 @@ - unless empty_repo .project-home-dropdown = render "dropdown" - .form-horizontal - = render "shared/clone_panel" + = render "shared/clone_panel" .project-home-extra.row .col-md-8 diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 15cf150460f..eae4949fcd3 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -29,8 +29,7 @@ touch README git add README git commit -m 'first commit' - %span.clone= "git remote add origin #{default_url_to_repo}" - :preserve + git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')} git push -u origin master %fieldset @@ -38,8 +37,7 @@ %pre.dark :preserve cd existing_git_repo - %span.clone= "git remote add origin #{default_url_to_repo}" - :preserve + git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')} git push -u origin master - if can? current_user, :remove_project, @project diff --git a/app/views/projects/wikis/git_access.html.haml b/app/views/projects/wikis/git_access.html.haml index 55fb6d5bf7b..b62c4975416 100644 --- a/app/views/projects/wikis/git_access.html.haml +++ b/app/views/projects/wikis/git_access.html.haml @@ -1,13 +1,12 @@ = render 'nav' -%h3.page-title - Git access for - %strong= @gollum_wiki.path_with_namespace +.row + .col-sm-6 + %h3.page-title + Git access for + %strong= @gollum_wiki.path_with_namespace - .form-horizontal.pull-right - .git-clone-holder - %button{class: "btn active", :"data-clone" => @gollum_wiki.ssh_url_to_repo} SSH - %button{class: "btn", :"data-clone" => @gollum_wiki.http_url_to_repo}= gitlab_config.protocol.upcase - = text_field_tag :project_clone, @gollum_wiki.url_to_repo, class: "one_click_select form-control", readonly: true + .col-sm-6 + = render "shared/clone_panel", project: @gollum_wiki .git-empty %fieldset @@ -19,7 +18,7 @@ %legend Clone Your Wiki: %pre.dark :preserve - git clone #{@gollum_wiki.ssh_url_to_repo} + git clone #{ content_tag(:span, default_url_to_repo(@gollum_wiki), class: 'clone')} cd #{@gollum_wiki.path} %legend Start Gollum And Edit Locally: diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index be71236c52c..8cd426c71e6 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -1,6 +1,6 @@ -.git-clone-holder - .protocol-btns - %button{class: "btn #{ 'active' if default_clone_protocol == 'ssh' }", :"data-clone" => @project.ssh_url_to_repo} SSH - %button{class: "btn #{ 'active' if default_clone_protocol == 'http' }", :"data-clone" => @project.http_url_to_repo}= gitlab_config.protocol.upcase - .protocol-clone - = text_field_tag :project_clone, default_url_to_repo, class: "one_click_select span4", readonly: true +- project = project || @project +.git-clone-holder.input-group + .input-group-btn + %button{class: "btn #{ 'active' if default_clone_protocol == 'ssh' }", :"data-clone" => project.ssh_url_to_repo} SSH + %button{class: "btn #{ 'active' if default_clone_protocol == 'http' }", :"data-clone" => project.http_url_to_repo}= gitlab_config.protocol.upcase + = text_field_tag :project_clone, default_url_to_repo(project), class: "one_click_select form-control", readonly: true |