summaryrefslogtreecommitdiff
path: root/app/views/projects/blob/new.html.haml
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-06-24 12:26:11 -0600
committerSean McGivern <sean@gitlab.com>2016-08-18 21:48:10 +0100
commit0baaf490e289adb36ef7145a57f75cdab05eb01c (patch)
tree9e322e443cc729a3c5d7f31877216d8cb74fc605 /app/views/projects/blob/new.html.haml
parentd97c83096a70ed102f993d4c484aff9c786ca831 (diff)
downloadgitlab-ce-0baaf490e289adb36ef7145a57f75cdab05eb01c.tar.gz
Only load Ace on Snippets and file edit pages.
Diffstat (limited to 'app/views/projects/blob/new.html.haml')
-rw-r--r--app/views/projects/blob/new.html.haml9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml
index c952bc7e5db..9c60131f6d1 100644
--- a/app/views/projects/blob/new.html.haml
+++ b/app/views/projects/blob/new.html.haml
@@ -1,17 +1,16 @@
- page_title "New File", @path.presence, @ref
+- content_for :page_specific_javascripts do
+ = page_specific_javascript_tag('lib/ace.js')
+ = page_specific_javascript_tag('blob_edit/blob_edit_bundle.js')
%h3.page-title
New File
.file-editor
- = form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal js-new-blob-form js-quick-submit js-requires-input') do
+ = form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal js-edit-blob-form js-new-blob-form js-quick-submit js-requires-input', data: {'relative-url-root' => "#{Rails.application.config.relative_url_root}", 'assets-prefix' => "#{Gitlab::Application.config.assets.prefix}" }) do
= render 'projects/blob/editor', ref: @ref
= render 'shared/new_commit_form', placeholder: "Add new file"
= 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 EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}")
- new NewCommitForm($('.js-new-blob-form'))