Commit f6a8e694 authored by Valeriy Sizov's avatar Valeriy Sizov

WebEditor: base form

parent 83797265
...@@ -19,4 +19,12 @@ class TreeController < ProjectResourceController ...@@ -19,4 +19,12 @@ class TreeController < ProjectResourceController
format.js { no_cache_headers } format.js { no_cache_headers }
end end
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 end
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
= link_to "raw", project_blob_path(@project, @id), class: "btn very_small", target: "_blank" = 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 "history", project_commits_path(@project, @id), class: "btn very_small"
= link_to "blame", project_blame_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 tree_file.text?
- if gitlab_markdown?(tree_file.name) - if gitlab_markdown?(tree_file.name)
.file_content.wiki .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 ...@@ -183,7 +183,7 @@ Gitlab::Application.routes.draw do
resources :compare, only: [:index, :create] resources :compare, only: [:index, :create]
resources :blame, only: [:show], constraints: {id: /.+/} resources :blame, only: [:show], constraints: {id: /.+/}
resources :blob, 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", match "/compare/:from...:to" => "compare#show", as: "compare",
:via => [:get, :post], constraints: {from: /.+/, to: /.+/} :via => [:get, :post], constraints: {from: /.+/, to: /.+/}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment