Add settings page
This commit is contained in:
parent
2178a07ced
commit
169082c07a
2 changed files with 29 additions and 1 deletions
15
server.rb
15
server.rb
|
@ -11,7 +11,8 @@ DB = Sequel.connect('sqlite://database.db')
|
|||
set :port, 8091
|
||||
set :nav, [
|
||||
{ title: 'Χρήστες', href: '/users' },
|
||||
{ title: 'Συνέλευση', href: '/input' }
|
||||
{ title: 'Συνέλευση', href: '/input' },
|
||||
{ title: 'Ρυθμίσεις', href: '/settings' }
|
||||
]
|
||||
|
||||
get '/users' do
|
||||
|
@ -72,3 +73,15 @@ post '/save' do
|
|||
)
|
||||
redirect '/input'
|
||||
end
|
||||
|
||||
get '/settings' do
|
||||
l = {}
|
||||
l[:user_settings] = DB[:settings].first
|
||||
slim :settings, locals: l
|
||||
end
|
||||
|
||||
post '/settings' do
|
||||
DB[:settings].update(max_apousies: params['max_apousies'],
|
||||
prova_cost: params['prova_cost'])
|
||||
redirect '/settings'
|
||||
end
|
||||
|
|
Reference in a new issue