summaryrefslogtreecommitdiff
path: root/app/views/projects/blob/edit.html.haml
blob: 8378ce2c7e5697bfdb2f17906abf0beaaa4e3bb6 (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
28
29
30
- breadcrumb_title _("Repository")
- page_title _("Edit"), @blob.path, @ref
- content_for :prefetch_asset_tags do
  - webpack_preload_asset_tag('monaco')

- if @conflict
  .gl-alert.gl-alert-danger.gl-mb-5.gl-mt-5
    .gl-alert-container
      = sprite_icon('error', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title')
      .gl-alert-content
        .gl-alert-body
          Someone edited the file the same time you did. Please check out
          = link_to _('the file'), project_blob_path(@project, tree_join(@branch_name, @file_path)), target: "_blank", rel: 'noopener noreferrer', class: 'gl-link'
          and make sure your changes will not unintentionally remove theirs.

%h3.page-title.blob-edit-page-title
  Edit file
.file-editor
  = gl_tabs_nav({ class: 'js-edit-mode nav-links gl-border-0'}) do
    = gl_tab_link_to _('Write'), '#editor', { tab_class: 'active' }

    = gl_tab_link_to editing_preview_title(@blob.name), '#preview', { data: { 'preview-url': project_preview_blob_path(@project, @id) } }

  = form_tag(project_update_blob_path(@project, @id), method: :put, class: 'js-quick-submit js-requires-input js-edit-blob-form', data: blob_editor_paths(@project)) do
    = render 'projects/blob/editor', ref: @ref, path: @path, blob_data: @blob.data
    = render 'shared/new_commit_form', placeholder: "Update #{@blob.name}"
    = hidden_field_tag 'last_commit_sha', @last_commit_sha
    = hidden_field_tag 'content', '', id: "file-content"
    = hidden_field_tag 'from_merge_request_iid', params[:from_merge_request_iid]
    = render 'projects/commit_button', ref: @ref, cancel_path: project_blob_path(@project, @id)