2023-03-18 11:35:52 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-09 21:37:33 -05:00
|
|
|
class StageManager
|
2023-03-18 11:35:52 -04:00
|
|
|
# Controller to handle top-level pages
|
2023-03-09 21:37:33 -05:00
|
|
|
class IndexController
|
2023-03-02 13:24:24 -05:00
|
|
|
|
2023-03-09 21:37:33 -05:00
|
|
|
get '/' do
|
|
|
|
channels = Channel.reverse(:updated_at).limit(10).all()
|
|
|
|
videos = Video.reverse(:updated_at).limit(10).all()
|
2023-03-13 22:23:34 -04:00
|
|
|
active_projects = Video.where(starred: true).reverse(:updated_at).limit($conf.get('stgm.max_stars'))
|
2023-03-18 11:35:52 -04:00
|
|
|
erb :index, locals: {
|
|
|
|
title: 'Dashboard',
|
|
|
|
channels: channels,
|
|
|
|
videos: videos,
|
|
|
|
active_projects: active_projects
|
2023-03-09 21:37:33 -05:00
|
|
|
}
|
|
|
|
end
|
2023-03-02 13:24:24 -05:00
|
|
|
|
2023-03-09 21:37:33 -05:00
|
|
|
end
|
2023-03-02 13:24:24 -05:00
|
|
|
end
|