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
|
2012-10-15 18:51:11 +02:00
|
|
|
%span.file_name
|
2012-11-08 18:41:07 +01:00
|
|
|
= "#{@tree.path} (#{@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
|
2012-10-12 18:59:42 +02:00
|
|
|
= 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
|
2012-10-16 23:15:49 +02:00
|
|
|
= button_tag "Commit", class: 'btn save-btn'
|
2012-10-16 23:27:47 +02:00
|
|
|
= 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();
|
|
|
|
});
|