empty.html.haml 1.6 KB
Newer Older
1
- if current_user.require_ssh_key?
D
Dmitriy Zaporozhets 已提交
2 3
  .alert-message.block-message.error
    %ul
4
      %li You have no ssh keys added to your profile.
5 6
      %li You wont be able to pull/push repository.
      %li Visit profile → keys and add public key of every machine you want to use for work with gitlabhq.
7

D
Dmitriy Zaporozhets 已提交
8
.alert-message.block-message.error
9
  %ul.unstyled.alert_holder
D
Dmitriy Zaporozhets 已提交
10
    %li You should push repository to proceed.
11
    %li After push you will be able to browse code, commits etc.
12 13 14 15

- bash_lexer = Pygments::Lexer[:bash]
%div.git-empty
  %h3 Git global setup:
16
  - setup_str = ["git config --global user.name \"#{current_user.name}\"",
17
    "git config --global user.email  \"#{current_user.email}\""].join("\n")
18
  = preserve do
19
    = raw bash_lexer.highlight(setup_str, lexer: 'bash', options: {encoding: 'utf-8'})
20 21 22 23 24 25

  %br
  %br
  %h3 Create Repository
  - repo_setup_str = ["mkdir #{@project.path}",
    "cd #{@project.path}",
26
    "git init",
27 28 29 30 31 32
    "touch README",
    "git add README",
    "git commit -m 'first commit'",
    "git remote add origin #{@project.url_to_repo}",
    "git push -u origin master"].join("\n")

33 34
  = preserve do
    = raw bash_lexer.highlight(repo_setup_str)
35 36 37 38 39 40 41

  %br
  %br
  %h3 Existing Git Repo?
  - exist_repo_setup_str = ["cd existing_git_repo",
    "git remote add origin #{@project.url_to_repo}",
    "git push -u origin master"].join("\n")
42 43
  = preserve do
    = raw bash_lexer.highlight(exist_repo_setup_str)
44 45 46

  - if can? current_user, :admin_project, @project
    .alert-message.block-message.error.prepend-top-20
47
      = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger"