From 36a69b0a309e140cbf87e26422d22b6a634d12c0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 21 Oct 2013 13:07:16 +0300 Subject: [PATCH] Update git-clone js. Use new style on wiki git access too --- app/assets/javascripts/project.js.coffee | 6 +++--- app/views/projects/_clone_panel.html.haml | 56 -------------------------------------------------------- app/views/projects/wikis/git_access.html.haml | 54 +++++++++++++++++++++++++----------------------------- 3 files changed, 28 insertions(+), 88 deletions(-) delete mode 100644 app/views/projects/_clone_panel.html.haml diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee index 83236b3..bdb1857 100644 --- a/app/assets/javascripts/project.js.coffee +++ b/app/assets/javascripts/project.js.coffee @@ -6,10 +6,10 @@ class Project @initEvents() - + initEvents: -> disableButtonIfEmptyField '#project_name', '.project-submit' - + $('#project_issues_enabled').change -> if ($(this).is(':checked') == true) $('#project_issues_tracker').removeAttr('disabled') @@ -29,7 +29,7 @@ class Project $ -> # Git clone panel switcher - scope = $ '.project_clone_holder' + scope = $ '.git-clone-holder' if scope.length > 0 $('a, button', scope).click -> $('a, button', scope).removeClass 'active' diff --git a/app/views/projects/_clone_panel.html.haml b/app/views/projects/_clone_panel.html.haml deleted file mode 100644 index c2f85e8..0000000 --- a/app/views/projects/_clone_panel.html.haml +++ /dev/null @@ -1,56 +0,0 @@ -.project_clone_panel - .row - .span8 - .form-horizontal= render "shared/clone_panel" - .span3.pull-right - .pull-right - - unless @project.empty_repo? - - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace - - if current_user.already_forked?(@project) - = link_to project_path(current_user.fork_of(@project)), class: 'btn grouped disabled' do - %i.icon-code-fork - Forked - - else - = link_to fork_project_path(@project), title: "Fork", class: "btn grouped", method: "POST" do - %i.icon-code-fork - Fork - - if can? current_user, :download_code, @project - = link_to archive_project_repository_path(@project), class: "btn grouped" do - %i.icon-download-alt - %span.only-wide Download - - - if current_user - .dropdown.pull-right - %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} - %i.icon-plus-sign-alt - %span.only-wide New - %b.caret - %ul.dropdown-menu - - if @project.issues_enabled && can?(current_user, :write_issue, @project) - %li - = link_to url_for_new_issue, title: "New Issue" do - Issue - - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) - %li - = link_to new_project_merge_request_path(@project), title: "New Merge Request" do - Merge Request - - if @project.snippets_enabled && can?(current_user, :write_snippet, @project) - %li - = link_to new_project_snippet_path(@project), title: "New Snippet" do - Snippet - - if can? current_user, :push_code, @project - %li.divider - %li - = link_to new_project_branch_path(@project) do - %i.icon-code-fork - Git branch - %li - = link_to new_project_tag_path(@project) do - %i.icon-tag - Git tag - - - if can?(current_user, :admin_team_member, @project) - %li.divider - %li - = link_to new_project_team_member_path(@project), title: "New project member" do - Project member diff --git a/app/views/projects/wikis/git_access.html.haml b/app/views/projects/wikis/git_access.html.haml index 57ad4c9..692eda4 100644 --- a/app/views/projects/wikis/git_access.html.haml +++ b/app/views/projects/wikis/git_access.html.haml @@ -2,35 +2,31 @@ %h3.page-title Git access for %strong= @gollum_wiki.path_with_namespace - = render 'main_links' -.content - .project_clone_panel - .row - .span7 - .form-horizontal - .input-prepend.project_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 input-xxlarge", readonly: true - .git-empty - %fieldset - %legend Install Gollum: - %pre.dark - :preserve - gem install gollum + .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 input-xxlarge", readonly: true - %legend Clone Your Wiki: - %pre.dark - :preserve - git clone #{@gollum_wiki.ssh_url_to_repo} - cd #{@gollum_wiki.path} +.git-empty + %fieldset + %legend Install Gollum: + %pre.dark + :preserve + gem install gollum - %legend Start Gollum And Edit Locally: - %pre.dark - :preserve - gollum - == Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin - >> Thin web server (v1.5.0 codename Knife) - >> Maximum connections set to 1024 - >> Listening on 0.0.0.0:4567, CTRL+C to stop + %legend Clone Your Wiki: + %pre.dark + :preserve + git clone #{@gollum_wiki.ssh_url_to_repo} + cd #{@gollum_wiki.path} + + %legend Start Gollum And Edit Locally: + %pre.dark + :preserve + gollum + == Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin + >> Thin web server (v1.5.0 codename Knife) + >> Maximum connections set to 1024 + >> Listening on 0.0.0.0:4567, CTRL+C to stop -- libgit2 0.21.2