mirror of
https://github.com/neocities/neocities.git
synced 2025-08-03 08:11:56 +02:00
fix for new page create with directories
This commit is contained in:
parent
b446160d6b
commit
20bdd2ac55
4 changed files with 6 additions and 3 deletions
4
app.rb
4
app.rb
|
@ -1037,6 +1037,8 @@ post '/site_files/create_page' do
|
|||
|
||||
name = "#{params[:pagefilename]}.html"
|
||||
|
||||
name = "#{params[:dir]}/#{name}" if params[:dir]
|
||||
|
||||
if current_site.file_exists?(name)
|
||||
@errors << %{Web page "#{name}" already exists! Choose another name.}
|
||||
halt erb(:'site_files/new_page')
|
||||
|
@ -1046,7 +1048,7 @@ post '/site_files/create_page' do
|
|||
|
||||
flash[:success] = %{#{name} was created! <a style="color: #FFFFFF; text-decoration: underline" href="/site_files/text_editor/#{name}">Click here to edit it</a>.}
|
||||
|
||||
redirect '/dashboard'
|
||||
redirect params[:dir] ? "/dashboard?dir=#{Rack::Utils.escape params[:dir]}" : '/dashboard'
|
||||
end
|
||||
|
||||
get '/site_files/new' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue