mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 21:56:19 +10:00
Now it will work on any field inside that form, and it's easier to scope new behavior, which is what we're adding next!
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
- page_title "Edit", @blob.path, @ref
|
|
= render "header_title"
|
|
|
|
.file-editor
|
|
%ul.nav-links.no-bottom.js-edit-mode
|
|
%li.active
|
|
= link_to '#editor' do
|
|
= icon('edit')
|
|
Edit File
|
|
|
|
%li
|
|
= link_to '#preview', 'data-preview-url' => namespace_project_preview_blob_path(@project.namespace, @project, @id) do
|
|
= icon('eye')
|
|
= editing_preview_title(@blob.name)
|
|
|
|
= form_tag(namespace_project_update_blob_path(@project.namespace, @project, @id), method: :put, class: 'form-horizontal js-quick-submit js-requires-input js-edit-blob-form') 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', @last_commit
|
|
= hidden_field_tag 'content', '', id: "file-content"
|
|
= hidden_field_tag 'from_merge_request_id', params[:from_merge_request_id]
|
|
= render 'projects/commit_button', ref: @ref, cancel_path: namespace_project_blob_path(@project.namespace, @project, @id)
|
|
|
|
:javascript
|
|
blob = new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}")
|
|
new NewCommitForm($('.js-edit-blob-form'))
|