-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtiny_admin_settings.rb
More file actions
45 lines (42 loc) · 843 Bytes
/
tiny_admin_settings.rb
File metadata and controls
45 lines (42 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# frozen_string_literal: true
class SamplePage < TinyAdmin::Views::DefaultLayout
def view_template
super do
h1 { 'Sample page' }
p { 'This is a sample page' }
end
end
end
class SamplePage2 < TinyAdmin::Views::DefaultLayout
def view_template
super do
h1 { 'Sample page 2' }
p { 'This is another sample page' }
end
end
end
TinyAdmin.configure do |settings|
settings.root_path = '/admin'
settings.root = {
redirect: 'sample-page'
}
settings.sections = [
{
slug: 'sample-page',
name: 'Sample Page',
type: :page,
page: SamplePage
},
{
slug: 'sample-page-2',
name: 'Sample Page 2',
type: :page,
page: SamplePage2
}
]
settings.extra_styles = <<~CSS
.navbar {
background-color: var(--bs-cyan);
}
CSS
end