summaryrefslogtreecommitdiff
path: root/app/views/projects/blob/new.html.haml
blob: 071c3bb7da8d83c178cae5584fa969eebe85f77f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.gray-content-block.top-block
  Create a new file or
  = link_to 'upload', '#modal-upload-blob',
    { class: 'upload-link', 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'}
  an existing one

= render 'projects/blob/upload', title: 'Upload', placeholder: 'Upload new file', button_title: 'Upload file', form_path: namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post

.file-editor
  = form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal form-new-file js-requires-input') do
    = render 'projects/blob/editor', ref: @ref
    = render 'shared/commit_message_container', params: params,
             placeholder: 'Add new file'

    - unless @project.empty_repo?
      .form-group.branch
        = label_tag 'branch', class: 'control-label' do
          Branch
        .col-sm-10
          = text_field_tag 'new_branch', @ref, class: "form-control"

    = hidden_field_tag 'content', '', id: 'file-content'
    = render 'projects/commit_button', ref: @ref,
              cancel_path: namespace_project_tree_path(@project.namespace, @project, @id)

:javascript
  blob = new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null)