From 44c940391701c8ac6715a90a707db0c255e016d9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 13 Mar 2014 10:27:20 +0200 Subject: [PATCH] Hide retry import form for non masters --- app/views/projects/import.html.haml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/views/projects/import.html.haml b/app/views/projects/import.html.haml index c9fb6c5..d11372b 100644 --- a/app/views/projects/import.html.haml +++ b/app/views/projects/import.html.haml @@ -15,15 +15,16 @@ %h2 Import failed. Retry? %hr - = form_for @project, url: retry_import_project_path(@project), method: :put, html: { class: 'form-horizontal' } do |f| - .form-group.import-url-data - = f.label :import_url, class: 'control-label' do - %span Import existing repo - .col-sm-10 - = f.text_field :import_url, class: 'form-control', placeholder: 'https://github.com/randx/six.git' - .bs-callout.bs-callout-info - This url must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git. - %br - The import will time out after 2 minutes. For big repositories, use a clone/push combination. - .form-actions - = f.submit 'Retry import', class: "btn btn-create", tabindex: 4 + - if can?(current_user, :admin_project, @project) + = form_for @project, url: retry_import_project_path(@project), method: :put, html: { class: 'form-horizontal' } do |f| + .form-group.import-url-data + = f.label :import_url, class: 'control-label' do + %span Import existing repo + .col-sm-10 + = f.text_field :import_url, class: 'form-control', placeholder: 'https://github.com/randx/six.git' + .bs-callout.bs-callout-info + This url must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git. + %br + The import will time out after 2 minutes. For big repositories, use a clone/push combination. + .form-actions + = f.submit 'Retry import', class: "btn btn-create", tabindex: 4 -- libgit2 0.21.2