From 91e112ffe2a2c16b3b5e2cd4ce032cb9fa769660 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 13 Sep 2013 10:12:42 +0200 Subject: [PATCH] Replace remote url on selection. --- app/assets/javascripts/project.js.coffee | 1 + app/views/projects/empty.html.haml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee index 780292daa11..83236b34814 100644 --- a/app/assets/javascripts/project.js.coffee +++ b/app/assets/javascripts/project.js.coffee @@ -35,6 +35,7 @@ $ -> $('a, button', scope).removeClass 'active' $(@).addClass 'active' $('#project_clone', scope).val $(@).data 'clone' + $(".clone").text("").append 'git remote add origin ' + $(@).data 'clone' # Ref switcher $('.project-refs-select').on 'change', -> diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 99e334cc6b8..001857cefda 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -29,7 +29,8 @@ touch README git add README git commit -m 'first commit' - git remote add origin #{@project.url_to_repo} + %span.clone= "git remote add origin #{@project.url_to_repo}" + :preserve git push -u origin master %fieldset @@ -37,7 +38,8 @@ %pre.dark :preserve cd existing_git_repo - git remote add origin #{@project.url_to_repo} + %span.clone= "git remote add origin #{@project.url_to_repo}" + :preserve git push -u origin master - if can? current_user, :remove_project, @project