2016-01-14 15:44:20 -05:00
- @no_container = true
2018-03-29 08:06:49 -04:00
- breadcrumb_title _("Details")
2016-01-14 15:44:20 -05:00
2017-06-29 07:43:01 -04:00
= render partial: 'flash_messages', locals: { project: @project }
2015-10-17 02:33:49 -04:00
2013-11-06 10:13:21 -05:00
= render "home_panel"
2012-09-04 12:05:08 -04:00
2018-02-02 16:50:09 -05:00
.project-empty-note-panel
%div{ class: [container_class, ("limit-container-width-sm" unless fluid_layout)] }
.prepend-top-20
%h4
= _('The repository for this project is empty')
2018-02-22 11:57:58 -05:00
- if @project.can_current_user_push_code?
2018-02-02 16:50:09 -05:00
%p
- link_to_cli = link_to _('command line instructions'), '#repo-command-line-instructions'
= _('If you already have files you can push them using the %{link_to_cli} below.').html_safe % { link_to_cli: link_to_cli }
%p
%em
- link_to_protected_branches = link_to _('Learn more about protected branches'), help_page_path('user/project/protected_branches')
= _('Note that the master branch is automatically protected. %{link_to_protected_branches}').html_safe % { link_to_protected_branches: link_to_protected_branches }
%hr
%p
2018-05-04 15:26:54 -04:00
- link_to_auto_devops_settings = link_to(s_('AutoDevOps|enable Auto DevOps'), project_settings_ci_cd_path(@project, anchor: 'autodevops-settings'))
2018-02-21 11:22:38 -05:00
- link_to_add_kubernetes_cluster = link_to(s_('AutoDevOps|add a Kubernetes cluster'), new_project_cluster_path(@project))
2018-02-02 16:50:09 -05:00
= s_('AutoDevOps|You can automatically build and test your application if you %{link_to_auto_devops_settings} for this project. You can automatically deploy it as well, if you %{link_to_add_kubernetes_cluster}.').html_safe % { link_to_auto_devops_settings: link_to_auto_devops_settings, link_to_add_kubernetes_cluster: link_to_add_kubernetes_cluster }
%hr
2017-10-16 12:16:42 -04:00
%p
2018-02-02 16:50:09 -05:00
= _('Otherwise it is recommended you start with one of the options below.')
.prepend-top-20
%nav.project-stats{ class: container_class }
2018-02-20 13:51:52 -05:00
= render 'stat_anchor_list', anchors: @project.empty_repo_statistics_anchors
= render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons
2017-10-16 12:16:42 -04:00
2016-02-22 12:37:26 -05:00
- if can?(current_user, :push_code, @project)
2018-02-02 16:50:09 -05:00
%div{ class: [container_class, ("limit-container-width-sm" unless fluid_layout)] }
2016-01-14 15:44:20 -05:00
.prepend-top-20
.empty_wrapper
2018-02-02 16:50:09 -05:00
%h3#repo-command-line-instructions.page-title-empty
2016-01-14 15:44:20 -05:00
Command line instructions
2016-12-23 04:37:12 -05:00
.git-empty
2016-01-14 15:44:20 -05:00
%fieldset
%h5 Git global setup
2018-04-13 16:51:54 -04:00
%pre.card.bg-light
2016-01-14 15:44:20 -05:00
:preserve
git config --global user.name "#{h git_user_name}"
git config --global user.email "#{h git_user_email}"
2012-01-17 18:19:57 -05:00
2016-01-14 15:44:20 -05:00
%fieldset
%h5 Create a new repository
2018-04-13 16:51:54 -04:00
%pre.card.bg-light
2016-01-14 15:44:20 -05:00
:preserve
git clone #{ content_tag(:span, default_url_to_repo, class: 'clone')}
cd #{h @project.path}
touch README.md
git add README.md
git commit -m "add README"
2018-04-18 06:44:12 -04:00
- if @project.can_current_user_push_to_default_branch?
%span><
git push -u origin master
2012-01-17 18:19:57 -05:00
2016-01-14 15:44:20 -05:00
%fieldset
2017-01-15 09:34:17 -05:00
%h5 Existing folder
2018-04-13 16:51:54 -04:00
%pre.card.bg-light
2016-01-14 15:44:20 -05:00
:preserve
cd existing_folder
git init
git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')}
git add .
2017-04-25 01:50:59 -04:00
git commit -m "Initial commit"
2018-04-18 06:44:12 -04:00
- if @project.can_current_user_push_to_default_branch?
%span><
git push -u origin master
2013-08-12 11:21:47 -04:00
2016-03-29 17:51:31 -04:00
%fieldset
%h5 Existing Git repository
2018-04-13 16:51:54 -04:00
%pre.card.bg-light
2016-03-29 17:51:31 -04:00
:preserve
cd existing_repo
2017-10-20 02:58:41 -04:00
git remote rename origin old-origin
2016-03-29 17:51:31 -04:00
git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')}
2018-04-18 06:44:12 -04:00
- if @project.can_current_user_push_to_default_branch?
%span><
git push -u origin --all
git push -u origin --tags
2016-03-29 17:51:31 -04:00
2016-01-14 15:44:20 -05:00
- if can? current_user, :remove_project, @project
.prepend-top-20
2018-04-09 13:42:45 -04:00
= link_to 'Remove project', [@project.namespace.becomes(Namespace), @project], data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-inverted btn-remove float-right"