Merge pull request #1154 from maarten/#855-delete-files
Fixes #855 Adds file deletion fuctionality.
This commit is contained in:
@@ -221,6 +221,19 @@ module Precious
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
post '/deleteFile/*' do
|
||||||
|
forbid unless @allow_editing
|
||||||
|
wiki = wiki_new
|
||||||
|
filepath = params[:splat].first
|
||||||
|
unless filepath.nil?
|
||||||
|
commit = commit_message
|
||||||
|
commit[:message] = "Deleted #{filepath}"
|
||||||
|
wiki.delete_file(filepath, commit)
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect to('/fileview')
|
||||||
|
end
|
||||||
|
|
||||||
post '/rename/*' do
|
post '/rename/*' do
|
||||||
wikip = wiki_page(params[:splat].first)
|
wikip = wiki_page(params[:splat].first)
|
||||||
halt 500 if wikip.nil?
|
halt 500 if wikip.nil?
|
||||||
|
|||||||
@@ -85,6 +85,22 @@ ol.tree
|
|||||||
margin-right: 7px;
|
margin-right: 7px;
|
||||||
vertical-align: text-top;
|
vertical-align: text-top;
|
||||||
}
|
}
|
||||||
|
li.file form
|
||||||
|
{
|
||||||
|
vertical-align:middle;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
li.file form button
|
||||||
|
{
|
||||||
|
vertical-align:middle;
|
||||||
|
height: 20px;
|
||||||
|
padding-left: 36px;
|
||||||
|
padding-right: 10px;
|
||||||
|
border: 0px solid #000000;
|
||||||
|
background: url("../images/fileview/trashcan.png") no-repeat 16px center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
li.file a[href *= '.pdf'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
li.file a[href *= '.pdf'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
||||||
li.file a[href *= '.html'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
li.file a[href *= '.html'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
||||||
li.file a[href $= '.css'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
li.file a[href $= '.css'] span.icon { background: url(../images/fileview/document.png) 0 0 no-repeat; }
|
||||||
@@ -125,4 +141,3 @@ ol.tree
|
|||||||
}
|
}
|
||||||
li input:checked + ol > li { display: block; margin: 0 0 0.125em; /* 2px */}
|
li input:checked + ol > li { display: block; margin: 0 0 0.125em; /* 2px */}
|
||||||
li input:checked + ol > li:last-child { margin: 0 0 0.063em; /* 1px */ }
|
li input:checked + ol > li:last-child { margin: 0 0 0.063em; /* 1px */ }
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Reference in New Issue
Block a user