提交 f6a8e694 编写于 作者: V Valeriy Sizov

WebEditor: base form

上级 83797265
......@@ -19,4 +19,12 @@ class TreeController < ProjectResourceController
format.js { no_cache_headers }
end
end
def edit
@last_commit = @project.commits(@ref, @path, 1).first.sha
end
def update
last_commit = @project.commits(@ref, @path, 1).first.sha
end
end
......@@ -8,6 +8,7 @@
= link_to "raw", project_blob_path(@project, @id), class: "btn very_small", target: "_blank"
= link_to "history", project_commits_path(@project, @id), class: "btn very_small"
= link_to "blame", project_blame_path(@project, @id), class: "btn very_small"
= link_to "Edit", edit_project_tree_path(@project, @id), class: "btn very_small"
- if tree_file.text?
- if gitlab_markdown?(tree_file.name)
.file_content.wiki
......
.file_holder
Edit file:
%span.file_name
= @tree.path.force_encoding('utf-8')
%br
= form_tag(project_tree_path(@project, @id), :method => :put) do
%textarea
= @tree.data
= hidden_field_tag 'last_commit', @last_commit
= submit_tag "Save"
......@@ -183,7 +183,7 @@ Gitlab::Application.routes.draw do
resources :compare, only: [:index, :create]
resources :blame, only: [:show], constraints: {id: /.+/}
resources :blob, only: [:show], constraints: {id: /.+/}
resources :tree, only: [:show], constraints: {id: /.+/}
resources :tree, only: [:show, :edit, :update], constraints: {id: /.+/}
match "/compare/:from...:to" => "compare#show", as: "compare",
:via => [:get, :post], constraints: {from: /.+/, to: /.+/}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册