diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-18 12:44:12 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-24 13:59:41 +0200 |
commit | aeed6b5a34e2c1c98a374e6c6178d84e07779531 (patch) | |
tree | c9b169862980a0e651d66a9669d20eb1e558ce06 /app/views/projects/empty.html.haml | |
parent | a544f6ec58ba5f9cfbff6b59b50bc92bc2274bdb (diff) | |
download | gitlab-ce-aeed6b5a34e2c1c98a374e6c6178d84e07779531.tar.gz |
Only show push-to-master authorized users
Hide the push to master instructions for users that are not allowed to
do that.
Also hide buttons that would direct them to commit directly in master
Diffstat (limited to 'app/views/projects/empty.html.haml')
-rw-r--r-- | app/views/projects/empty.html.haml | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 2f69da593cd..a066f9f4cca 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -58,7 +58,9 @@ touch README.md git add README.md git commit -m "add README" - git push -u origin master + - if @project.can_current_user_push_to_default_branch? + %span>< + git push -u origin master %fieldset %h5 Existing folder @@ -69,7 +71,9 @@ git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')} git add . git commit -m "Initial commit" - git push -u origin master + - if @project.can_current_user_push_to_default_branch? + %span>< + git push -u origin master %fieldset %h5 Existing Git repository @@ -78,8 +82,10 @@ cd existing_repo git remote rename origin old-origin git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')} - git push -u origin --all - git push -u origin --tags + - if @project.can_current_user_push_to_default_branch? + %span>< + git push -u origin --all + git push -u origin --tags - if can? current_user, :remove_project, @project .prepend-top-20 |