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-10-16 23:13:37 +02:00
|
|
|
= "#{@tree.path.force_encoding('utf-8')} (#{@ref})"
|
2012-10-15 18:51:11 +02:00
|
|
|
%span.options
|
|
|
|
= link_to "cancel editing", project_tree_path(@project, @id), class: "btn very_small"
|
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
|
|
|
|
= button_tag "Save", class: 'btn save-btn'
|
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();
|
|
|
|
});
|