34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
%h3= t("layout.projects.files_in_project")
|
|
.files
|
|
.l= render 'whereami'
|
|
= render 'fork'
|
|
.both
|
|
|
|
= form_tag edit_blob_path(@project, @treeish, @path), :name => 'blob-editor', :method => :put do
|
|
.file-editor= text_area_tag :content, @blob.data, :id => 'code'
|
|
|
|
.both
|
|
= t("layout.enter_commit_message")
|
|
= text_area_tag :message, "Updated #{@blob.name}", :class => 'commit-message'
|
|
|
|
%br
|
|
%br
|
|
= submit_tag t("layout.save"), :title => t("layout.save")
|
|
= t("layout.or")
|
|
= link_to t("layout.cancel"), blob_path(@project, @treeish, @path), :class => 'button'
|
|
|
|
:javascript
|
|
$(function() {
|
|
var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
|
|
lineNumbers: true,
|
|
mode: '#{@blob.raw_mime_type.content_type}'
|
|
});
|
|
$(".CodeMirror").resizable({
|
|
stop: function() { editor.refresh(); },
|
|
resize: function() {
|
|
$(".CodeMirror-scroll").height($(this).height());
|
|
$(".CodeMirror-scroll").width($(this).width());
|
|
editor.refresh();
|
|
}
|
|
});
|
|
}); |