mirror of
https://github.com/neocities/neocities.git
synced 2025-07-20 17:46:05 +02:00
following button on site
This commit is contained in:
parent
51a85a0b03
commit
0a29a496d7
5 changed files with 62 additions and 18 deletions
7
app.rb
7
app.rb
|
@ -205,6 +205,13 @@ get '/site/:username/tip' do |username|
|
|||
erb :'tip'
|
||||
end
|
||||
|
||||
post '/site/:site_id/toggle_follow' do |site_id|
|
||||
require_login
|
||||
content_type :json
|
||||
site = Site[id: site_id]
|
||||
{result: (current_site.toggle_follow(site) ? 'followed' : 'unfollowed')}.to_json
|
||||
end
|
||||
|
||||
get '/browse' do
|
||||
@current_page = params[:current_page]
|
||||
@current_page = @current_page.to_i
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue