gitlabhq/app/views/tree/edit.html.haml

29 lines
956 B
Text
Raw Normal View History

2012-10-09 19:11:49 +02:00
.file-editor
2012-10-10 11:41:15 +02:00
= form_tag(project_tree_path(@project, @id), :method => :put) do
.file_holder
.file_title
%i.icon-file
%span.file_name
2012-10-16 23:13:37 +02:00
= "#{@tree.path.force_encoding('utf-8')} (#{@ref})"
2012-10-10 11:41:15 +02:00
.file_content.code
#editor= @tree.data
.editor-commit-comment
2012-10-11 23:15:24 +02:00
= label_tag 'commit_message' do
2012-10-10 11:41:15 +02:00
%p.slead Commit message
= text_area_tag 'commit_message', '', :required => true
2012-10-10 11:41:15 +02:00
.form-actions
2012-10-08 17:43:54 +02:00
= hidden_field_tag 'last_commit', @last_commit
2012-10-12 16:14:52 +02:00
= hidden_field_tag 'content', '', :id => :file_content
= button_tag "Commit", class: 'btn save-btn'
= link_to "Cancel", project_tree_path(@project, @id), class: "btn cancel-btn", confirm: "Are you sure?"
2012-10-09 19:11:49 +02:00
:javascript
var editor = ace.edit("editor");
editor.getSession().setMode("ace/mode/javascript");
2012-10-12 16:14:52 +02:00
$(".save-btn").click(function(){
$("#file_content").val(editor.getValue());
$(".form_editor form").submit();
});