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

31 lines
988 B
Plaintext
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
= @tree.path.force_encoding('utf-8')
%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
= 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.setTheme("ace/theme/twilight");
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();
});