WebEditor: base form
This commit is contained in:
parent
837972650c
commit
f6a8e69449
4 changed files with 20 additions and 1 deletions
|
@ -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
|
||||
|
|
10
app/views/tree/edit.html.haml
Normal file
10
app/views/tree/edit.html.haml
Normal file
|
@ -0,0 +1,10 @@
|
|||
.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: /.+/}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue