mirror of
https://github.com/neocities/neocities.git
synced 2025-08-06 01:24:56 +02:00
persist browse page search prefs, scrub not allowed chars for tag entry
This commit is contained in:
parent
2a76e75c6f
commit
321f8c6e29
3 changed files with 35 additions and 6 deletions
|
@ -2,6 +2,11 @@ get '/browse/?' do
|
|||
@page = params[:page]
|
||||
@page = 1 if @page.not_an_integer?
|
||||
|
||||
if params[:tag]
|
||||
params[:tag] = params[:tag].gsub(Tag::INVALID_TAG_REGEX, '').gsub(/\s+/, '').slice(0, Tag::NAME_LENGTH_MAX)
|
||||
@title = "Sites tagged #{params[:tag]}"
|
||||
end
|
||||
|
||||
if is_education?
|
||||
ds = education_sites_dataset
|
||||
else
|
||||
|
@ -20,10 +25,6 @@ get '/browse/?' do
|
|||
@site_tags[site_id] = tags.select {|t| t[:site_id] == site_id}.collect {|t| t[:name]}
|
||||
end
|
||||
|
||||
if params[:tag]
|
||||
@title = "Sites tagged #{params[:tag]}"
|
||||
end
|
||||
|
||||
erb :browse
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue