summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-13 18:47:46 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-13 18:47:46 +0300
commite261de255dfff71f5acc7d33f339a30a3cb32ab9 (patch)
tree4ca79cc4b78c50b732bf87564873e7d8c08a4565 /app
parent05fca6bfc2d045e7e144baec28a6596e618ecb4b (diff)
parent166c215a75b50ce62fd40297f52e366df7dc9103 (diff)
downloadgitlab-ce-e261de255dfff71f5acc7d33f339a30a3cb32ab9.tar.gz
Merge pull request #7942 from cirosantilli/commit-changes-uppercase
Make new and edit file submit more uniform
Diffstat (limited to 'app')
-rw-r--r--app/views/projects/_commit_button.html.haml9
-rw-r--r--app/views/projects/edit_tree/show.html.haml15
-rw-r--r--app/views/projects/new_tree/show.html.haml11
3 files changed, 17 insertions, 18 deletions
diff --git a/app/views/projects/_commit_button.html.haml b/app/views/projects/_commit_button.html.haml
new file mode 100644
index 00000000000..fd8320adb8d
--- /dev/null
+++ b/app/views/projects/_commit_button.html.haml
@@ -0,0 +1,9 @@
+.form-actions
+ .commit-button-annotation
+ = button_tag 'Commit Changes',
+ class: 'btn commit-btn js-commit-button btn-create'
+ .message
+ to branch
+ %strong= ref
+ = link_to 'Cancel', cancel_path,
+ class: 'btn btn-cancel', data: {confirm: leave_edit_message}
diff --git a/app/views/projects/edit_tree/show.html.haml b/app/views/projects/edit_tree/show.html.haml
index a863f7420a8..5ccde05063e 100644
--- a/app/views/projects/edit_tree/show.html.haml
+++ b/app/views/projects/edit_tree/show.html.haml
@@ -23,16 +23,11 @@
%i.fa.fa-spinner.fa-spin
= render 'shared/commit_message_container', params: params,
placeholder: "Update #{@blob.name}"
- .form-actions
- = 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]
- .commit-button-annotation
- = button_tag "Commit changes", class: 'btn commit-btn js-commit-button btn-primary'
- .message
- to branch
- %strong= @ref
- = link_to "Cancel", @after_edit_path, class: "btn btn-cancel", data: { confirm: leave_edit_message}
+ = 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: @after_edit_path
:javascript
ace.config.set("modePath", gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}/ace")
diff --git a/app/views/projects/new_tree/show.html.haml b/app/views/projects/new_tree/show.html.haml
index 49c504c104f..c47c0a3f642 100644
--- a/app/views/projects/new_tree/show.html.haml
+++ b/app/views/projects/new_tree/show.html.haml
@@ -27,14 +27,9 @@
.file-content.code
%pre#editor= params[:content]
- .form-actions
- = hidden_field_tag 'content', '', id: "file-content"
- .commit-button-annotation
- = button_tag "Commit changes", class: 'btn commit-btn js-commit-button btn-create'
- .message
- to branch
- %strong= @ref
- = link_to "Cancel", project_tree_path(@project, @id), class: "btn btn-cancel", data: { confirm: leave_edit_message}
+ = hidden_field_tag 'content', '', id: 'file-content'
+ = render 'projects/commit_button', ref: @ref,
+ cancel_path: project_tree_path(@project, @id)
:javascript
ace.config.set("modePath", gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}/ace-src-noconflict")