mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Download files
This commit is contained in:
parent
8b57348bdd
commit
9ed826486d
2 changed files with 8 additions and 1 deletions
4
app.rb
4
app.rb
|
@ -148,6 +148,10 @@ post '/site_files/delete' do
|
|||
redirect '/dashboard'
|
||||
end
|
||||
|
||||
get '/site_files/download/:filename' do |filename|
|
||||
send_file File.join(site_base_path(current_site.username), filename), filename: filename, type: 'Application/octet-stream'
|
||||
end
|
||||
|
||||
get '/site_files/text_editor/:filename' do |filename|
|
||||
@file_data = File.read File.join(site_base_path(current_site.username), filename)
|
||||
slim :'site_files/text_editor'
|
||||
|
|
|
@ -34,7 +34,10 @@ javascript:
|
|||
a href="/site_files/text_editor/#{file.filename}" Edit with text editor <br>
|
||||
span
|
||||
i class="icon-edit"
|
||||
span Edit with visual editor <small>(not implemented yet.. coming soon)</small> <br>
|
||||
span Edit with visual editor <small>(coming soon)</small> <br>
|
||||
span
|
||||
i class="icon-edit"
|
||||
span: a href="/site_files/download/#{file.filename}" Download <br>
|
||||
span
|
||||
i class="icon-trash"
|
||||
a href="#" onclick="confirmFileDelete('#{file.filename}')" Delete
|
||||
|
|
Loading…
Add table
Reference in a new issue