aureus 2.1.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/Gemfile.lock +39 -40
- data/README.md +56 -64
- data/app/assets/javascripts/aureus/index.js +0 -41
- data/app/assets/javascripts/aureus/layout.js.erb +9 -0
- data/{spec/internal/app/assets/stylesheets/application.scss → app/assets/stylesheets/aureus/layout.scss.erb} +1 -1
- data/app/assets/stylesheets/aureus/skin/default.scss +0 -4
- data/app/assets/stylesheets/aureus/theme/content.scss +0 -4
- data/app/assets/stylesheets/aureus/theme/table.scss +1 -16
- data/app/assets/stylesheets/aureus/theme.scss +8 -0
- data/app/controllers/aureus/resources_controller.rb +52 -0
- data/app/controllers/aureus_controller.rb +2 -0
- data/app/views/aureus/resources/_form.html.haml +8 -0
- data/app/views/aureus/resources/_item.html.haml +7 -0
- data/app/views/aureus/resources/_navigation.html.haml +5 -0
- data/app/views/aureus/resources/_table.html.haml +11 -0
- data/app/views/aureus/resources/edit.html.haml +2 -0
- data/app/views/aureus/resources/index.html.haml +2 -0
- data/app/views/aureus/resources/new.html.haml +2 -0
- data/app/views/aureus/resources/show.html.haml +2 -0
- data/app/views/layouts/aureus.html.haml +14 -0
- data/aureus.gemspec +0 -1
- data/config.ru +1 -1
- data/lib/aureus/components/box.rb +8 -26
- data/lib/aureus/components/data_table.rb +15 -49
- data/lib/aureus/components/listing.rb +7 -14
- data/lib/aureus/components/messages.rb +2 -8
- data/lib/aureus/components/navigation.rb +5 -18
- data/lib/aureus/components/row.rb +4 -11
- data/lib/aureus/components/simple_map.rb +2 -8
- data/lib/aureus/components/toolbar.rb +14 -29
- data/lib/aureus/engine.rb +0 -3
- data/lib/aureus/helper.rb +18 -41
- data/lib/aureus/renderable.rb +6 -9
- data/lib/aureus/version.rb +1 -1
- data/lib/aureus.rb +10 -2
- data/lib/generators/aureus/copy/copy_generator.rb +13 -0
- data/lib/generators/aureus/setup/setup_generator.rb +12 -0
- data/spec/internal/app/controllers/all_controller.rb +0 -2
- data/spec/internal/app/controllers/application_controller.rb +2 -0
- data/spec/internal/app/controllers/resources_controller.rb +50 -1
- data/spec/internal/app/views/layouts/application.html.haml +6 -4
- data/spec/internal/app/views/layouts/naked.html.haml +4 -4
- data/spec/internal/config/initializers/aureus.rb +7 -0
- data/spec/internal/config/routes.rb +1 -1
- data/spec/lib/generators/copy_spec.rb +17 -0
- data/spec/lib/generators/setup_spec.rb +16 -0
- data/spec/requests/all_spec.rb +4 -3
- data/spec/requests/resources_spec.rb +23 -0
- metadata +27 -82
- data/app/assets/images/aureus/icon-sort-abc-asc.png +0 -0
- data/app/assets/images/aureus/icon-sort-abc-desc.png +0 -0
- data/app/assets/images/aureus/icon-sort.png +0 -0
- data/config/locales/aureus.de.yml +0 -9
- data/config/locales/aureus.en.yml +0 -9
- data/lib/aureus/components/content.rb +0 -19
- data/lib/generators/aureus/devise_i18n/devise_i18n_generator.rb +0 -25
- data/lib/generators/aureus/devise_i18n/locales/devise_base.de.yml +0 -55
- data/lib/generators/aureus/devise_i18n/locales/devise_base.en.yml +0 -55
- data/lib/generators/aureus/devise_i18n/locales/devise_mail.de.yml +0 -18
- data/lib/generators/aureus/devise_i18n/locales/devise_mail.en.yml +0 -18
- data/lib/generators/aureus/devise_i18n/locales/devise_ui.de.yml +0 -54
- data/lib/generators/aureus/devise_i18n/locales/devise_ui.en.yml +0 -54
- data/lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb +0 -25
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.de.yml +0 -11
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.en.yml +0 -11
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.de.yml +0 -9
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.en.yml +0 -9
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.de.yml +0 -12
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.en.yml +0 -12
- data/lib/generators/aureus/devise_invitable_views/devise_invitable_views_generator.rb +0 -23
- data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/edit.html.haml +0 -9
- data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/new.html.haml +0 -8
- data/lib/generators/aureus/devise_invitable_views/templates/devise/mailer/invitation_instructions.html.haml +0 -5
- data/lib/generators/aureus/devise_views/devise_views_generator.rb +0 -25
- data/lib/generators/aureus/devise_views/templates/devise/confirmations/new.html.haml +0 -7
- data/lib/generators/aureus/devise_views/templates/devise/mailer/confirmation_instructions.html.haml +0 -3
- data/lib/generators/aureus/devise_views/templates/devise/mailer/reset_password_instructions.html.haml +0 -5
- data/lib/generators/aureus/devise_views/templates/devise/mailer/unlock_instructions.html.haml +0 -4
- data/lib/generators/aureus/devise_views/templates/devise/passwords/edit.html.haml +0 -9
- data/lib/generators/aureus/devise_views/templates/devise/passwords/new.html.haml +0 -7
- data/lib/generators/aureus/devise_views/templates/devise/registrations/edit.html.haml +0 -11
- data/lib/generators/aureus/devise_views/templates/devise/registrations/new.html.haml +0 -9
- data/lib/generators/aureus/devise_views/templates/devise/sessions/new.html.haml +0 -9
- data/lib/generators/aureus/devise_views/templates/devise/shared/_links.html.haml +0 -19
- data/lib/generators/aureus/devise_views/templates/devise/unlocks/new.html.haml +0 -7
- data/lib/generators/aureus/layout/layout_generator.rb +0 -19
- data/lib/generators/aureus/layout/templates/layout.html.haml +0 -17
- data/lib/generators/aureus/views/templates/views/_form.html.haml +0 -6
- data/lib/generators/aureus/views/templates/views/_item.html.haml +0 -6
- data/lib/generators/aureus/views/templates/views/_list.html.haml +0 -10
- data/lib/generators/aureus/views/templates/views/edit.html.haml +0 -7
- data/lib/generators/aureus/views/templates/views/index.html.haml +0 -6
- data/lib/generators/aureus/views/templates/views/new.html.haml +0 -7
- data/lib/generators/aureus/views/templates/views/show.html.haml +0 -7
- data/lib/generators/aureus/views/views_generator.rb +0 -81
- data/spec/controllers/all_spec.rb +0 -19
- data/spec/internal/app/assets/javascripts/application.js +0 -9
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/lib/generators/devise_i18n_spec.rb +0 -19
- data/spec/lib/generators/devise_invitable_i18n_spec.rb +0 -19
- data/spec/lib/generators/devise_invitable_views_spec.rb +0 -19
- data/spec/lib/generators/devise_views_spec.rb +0 -25
- data/spec/lib/generators/layout_spec.rb +0 -17
- data/spec/lib/generators/views_spec.rb +0 -26
@@ -1,14 +1,13 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
module Components
|
4
|
-
|
5
3
|
class DataTable < Renderable
|
6
4
|
include ActionView::Helpers::JavaScriptHelper
|
7
5
|
|
8
|
-
def initialize
|
6
|
+
def initialize(resource, &block)
|
9
7
|
@resource = resource
|
10
8
|
@head = DataTableHead.new
|
11
9
|
@rows = Array.new
|
10
|
+
yield(self)
|
12
11
|
end
|
13
12
|
|
14
13
|
def head
|
@@ -23,67 +22,41 @@ module Aureus
|
|
23
22
|
end
|
24
23
|
end
|
25
24
|
|
26
|
-
def data
|
27
|
-
{
|
28
|
-
i18n_sSearch: I18n.t('aureus.datatables.search'),
|
29
|
-
i18n_sLengthMenu: I18n.t('aureus.datatables.length_menu'),
|
30
|
-
i18n_sZeroRecords: I18n.t('aureus.datatables.zero_records'),
|
31
|
-
i18n_sInfo: I18n.t('aureus.datatables.info'),
|
32
|
-
i18n_sInfoEmpty: I18n.t('aureus.datatables.info_empty'),
|
33
|
-
i18n_sInfoFiltered: I18n.t('aureus.datatables.info_filtered')
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
25
|
def render
|
38
|
-
content_tag 'table', id: @resource.class.name.downcase, class: 'datatable'
|
26
|
+
content_tag 'table', id: @resource.class.name.downcase, class: 'aureus-datatable' do
|
39
27
|
compact @head.render, content_tag('tbody',compact_render(*@rows))
|
40
28
|
end
|
41
29
|
end
|
42
|
-
|
43
30
|
end
|
44
31
|
|
45
32
|
class DataTableHead < Renderable
|
46
|
-
|
47
33
|
def initialize
|
48
34
|
@columns = Array.new
|
49
35
|
end
|
50
36
|
|
51
|
-
def text
|
52
|
-
@columns << DataTableHeadColumn.new(name
|
53
|
-
end
|
54
|
-
|
55
|
-
def date name
|
56
|
-
@columns << DataTableHeadColumn.new(name,'date-sorting')
|
57
|
-
end
|
58
|
-
|
59
|
-
def raw name
|
60
|
-
@columns << DataTableHeadColumn.new(name,'no-sorting')
|
37
|
+
def text(name)
|
38
|
+
@columns << DataTableHeadColumn.new(name)
|
61
39
|
end
|
62
40
|
|
63
41
|
def render
|
64
|
-
|
42
|
+
text '' # actions
|
65
43
|
content_tag 'thead' do
|
66
44
|
content_tag 'tr', compact_render(*@columns)
|
67
45
|
end
|
68
46
|
end
|
69
|
-
|
70
47
|
end
|
71
48
|
|
72
49
|
class DataTableHeadColumn < Renderable
|
73
|
-
|
74
|
-
def initialize name, sorting
|
50
|
+
def initialize(name)
|
75
51
|
@name = name
|
76
|
-
@sorting = sorting
|
77
52
|
end
|
78
53
|
|
79
54
|
def render
|
80
|
-
content_tag 'th', @name
|
55
|
+
content_tag 'th', @name
|
81
56
|
end
|
82
|
-
|
83
57
|
end
|
84
58
|
|
85
59
|
class DataTableRow < Renderable
|
86
|
-
|
87
60
|
def initialize
|
88
61
|
init_haml_helpers
|
89
62
|
@cells = Array.new
|
@@ -91,19 +64,19 @@ module Aureus
|
|
91
64
|
@identifier = ''
|
92
65
|
end
|
93
66
|
|
94
|
-
def identifier
|
67
|
+
def identifier(value)
|
95
68
|
@identifier = value
|
96
69
|
end
|
97
70
|
|
98
|
-
def cell
|
99
|
-
if
|
71
|
+
def cell(data='', &block)
|
72
|
+
if block
|
100
73
|
@cells << DataTableRowCell.new(capture_haml(&block))
|
101
74
|
else
|
102
75
|
@cells << DataTableRowCell.new(data)
|
103
76
|
end
|
104
77
|
end
|
105
78
|
|
106
|
-
def button
|
79
|
+
def button(type_or_title, url, *args)
|
107
80
|
if type_or_title.is_a? Symbol
|
108
81
|
@buttons << DataTableRowButton.new(type_or_title,type_or_title.to_s,url,args)
|
109
82
|
else
|
@@ -111,31 +84,27 @@ module Aureus
|
|
111
84
|
end
|
112
85
|
end
|
113
86
|
|
114
|
-
def button_raw
|
87
|
+
def button_raw(content)
|
115
88
|
@buttons << Renderable.new(content)
|
116
89
|
end
|
117
90
|
|
118
91
|
def render
|
119
92
|
content_tag 'tr', compact_render(*@cells)+content_tag('td',compact_render(*@buttons),class: 'buttons'), id: @identifier
|
120
93
|
end
|
121
|
-
|
122
94
|
end
|
123
95
|
|
124
96
|
class DataTableRowCell < Renderable
|
125
|
-
|
126
|
-
def initialize data
|
97
|
+
def initialize(data)
|
127
98
|
@data = data
|
128
99
|
end
|
129
100
|
|
130
101
|
def render
|
131
102
|
content_tag 'td', @data
|
132
103
|
end
|
133
|
-
|
134
104
|
end
|
135
105
|
|
136
106
|
class DataTableRowButton < Renderable
|
137
|
-
|
138
|
-
def initialize type, text, url, options
|
107
|
+
def initialize(type, text, url, options)
|
139
108
|
init options, remote: true, confirm: 'Delete resource?'
|
140
109
|
@type = type
|
141
110
|
@text = text
|
@@ -161,9 +130,6 @@ module Aureus
|
|
161
130
|
end
|
162
131
|
end
|
163
132
|
end
|
164
|
-
|
165
133
|
end
|
166
|
-
|
167
134
|
end
|
168
|
-
|
169
135
|
end
|
@@ -1,43 +1,36 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
module Components
|
4
|
-
|
5
3
|
class Listing < Renderable
|
6
|
-
|
7
4
|
def initialize
|
8
5
|
@entries = Array.new
|
6
|
+
yield(self)
|
9
7
|
end
|
10
8
|
|
11
|
-
def entry
|
9
|
+
def entry(head, body = nil, &block)
|
12
10
|
init_haml_helpers
|
13
11
|
if block_given?
|
14
|
-
@entries << ListingEntry.new(head,capture_haml(&block))
|
12
|
+
@entries << ListingEntry.new(head, capture_haml(&block))
|
15
13
|
else
|
16
|
-
@entries << ListingEntry.new(head,body)
|
14
|
+
@entries << ListingEntry.new(head, body)
|
17
15
|
end
|
18
16
|
end
|
19
17
|
|
20
18
|
def render
|
21
|
-
content_tag 'table', compact_render(*@entries), class: 'simple-table'
|
19
|
+
content_tag 'table', compact_render(*@entries), class: 'aureus-simple-table'
|
22
20
|
end
|
23
|
-
|
24
21
|
end
|
25
22
|
|
26
23
|
class ListingEntry < Renderable
|
27
|
-
|
28
|
-
def initialize head, body
|
24
|
+
def initialize(head, body)
|
29
25
|
@head = head
|
30
26
|
@body = body
|
31
27
|
end
|
32
28
|
|
33
29
|
def render
|
34
30
|
content_tag 'tr' do
|
35
|
-
compact content_tag('th'
|
31
|
+
compact content_tag('th', @head), content_tag('td', @body)
|
36
32
|
end
|
37
33
|
end
|
38
|
-
|
39
34
|
end
|
40
|
-
|
41
35
|
end
|
42
|
-
|
43
36
|
end
|
@@ -1,17 +1,14 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
module Components
|
4
|
-
|
5
3
|
class Messages < Renderable
|
6
|
-
|
7
|
-
def initialize flash
|
4
|
+
def initialize(flash)
|
8
5
|
@flash = flash
|
9
6
|
end
|
10
7
|
|
11
8
|
def render
|
12
9
|
content_tag 'div', class: 'aureus-messages' do
|
13
10
|
out = Array.new
|
14
|
-
[:notice
|
11
|
+
[:notice, :error, :alert].each do |i|
|
15
12
|
if @flash[i]
|
16
13
|
out << content_tag('p', @flash[i], class: i.to_s)
|
17
14
|
end
|
@@ -19,9 +16,6 @@ module Aureus
|
|
19
16
|
compact *out
|
20
17
|
end
|
21
18
|
end
|
22
|
-
|
23
19
|
end
|
24
|
-
|
25
20
|
end
|
26
|
-
|
27
21
|
end
|
@@ -1,48 +1,35 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
module Components
|
4
|
-
|
5
3
|
class Navigation < Renderable
|
6
|
-
|
7
4
|
def initialize
|
8
5
|
@title = ''
|
9
6
|
@buttons = Array.new
|
7
|
+
yield(self)
|
10
8
|
end
|
11
9
|
|
12
|
-
def title
|
10
|
+
def title(title)
|
13
11
|
@title = title
|
14
12
|
end
|
15
13
|
|
16
|
-
def button
|
14
|
+
def button(content)
|
17
15
|
@buttons << NavigationButton.new(content)
|
18
16
|
end
|
19
17
|
|
20
|
-
def submit_form_button resource, text
|
21
|
-
form_class = resource.is_a?(String) ? resource : resource.class.name.underscore
|
22
|
-
tag = content_tag 'a', text, onclick: "aureus_trigger_form('form.#{form_class}')", class: 'submit_form_button'
|
23
|
-
@buttons << NavigationButton.new(tag)
|
24
|
-
end
|
25
|
-
|
26
18
|
def render
|
27
19
|
content_tag 'div', class: 'aureus-navigation' do
|
28
|
-
compact content_tag('h2', content_tag('span'
|
20
|
+
compact content_tag('h2', content_tag('span', @title)), content_tag('ul', compact_render(*@buttons), id: 'quicklinks')
|
29
21
|
end
|
30
22
|
end
|
31
|
-
|
32
23
|
end
|
33
24
|
|
34
25
|
class NavigationButton < Renderable
|
35
|
-
|
36
|
-
def initialize content
|
26
|
+
def initialize(content)
|
37
27
|
@content = content
|
38
28
|
end
|
39
29
|
|
40
30
|
def render
|
41
31
|
content_tag 'li', @content
|
42
32
|
end
|
43
|
-
|
44
33
|
end
|
45
|
-
|
46
34
|
end
|
47
|
-
|
48
35
|
end
|
@@ -1,17 +1,14 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
module Components
|
4
|
-
|
5
3
|
class Row < Renderable
|
6
|
-
|
7
|
-
def initialize &block
|
4
|
+
def initialize(&block)
|
8
5
|
init_haml_helpers
|
9
6
|
@columns = Array.new
|
10
7
|
@content = capture_haml self, &block
|
11
8
|
end
|
12
9
|
|
13
|
-
def column
|
14
|
-
@columns << RowColumn.new(width,capture_haml(&block))
|
10
|
+
def column(width, &block)
|
11
|
+
@columns << RowColumn.new(width, capture_haml(&block))
|
15
12
|
end
|
16
13
|
|
17
14
|
def space width
|
@@ -54,16 +51,12 @@ module Aureus
|
|
54
51
|
end
|
55
52
|
|
56
53
|
class RowColumn < Renderable
|
57
|
-
|
58
54
|
attr_reader :width, :content
|
59
55
|
|
60
|
-
def initialize
|
56
|
+
def initialize(width, content)
|
61
57
|
@width = width
|
62
58
|
@content = content
|
63
59
|
end
|
64
|
-
|
65
60
|
end
|
66
|
-
|
67
61
|
end
|
68
|
-
|
69
62
|
end
|
@@ -1,21 +1,15 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
module Components
|
4
|
-
|
5
3
|
class SimpleMap < Renderable
|
6
|
-
|
7
|
-
def initialize args
|
4
|
+
def initialize(args)
|
8
5
|
init args, { height: 300, zoom: 13 }
|
9
6
|
end
|
10
7
|
|
11
8
|
def render
|
12
9
|
if @options[:longitude] and @options[:latitude]
|
13
|
-
content_tag('div',nil, class: 'aureus-simple-map', data: @options )
|
10
|
+
content_tag('div', nil, class: 'aureus-simple-map', data: @options )
|
14
11
|
end
|
15
12
|
end
|
16
|
-
|
17
13
|
end
|
18
|
-
|
19
14
|
end
|
20
|
-
|
21
15
|
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
module Components
|
4
|
-
|
5
3
|
class Toolbar < Renderable
|
6
|
-
|
7
|
-
def initialize title
|
4
|
+
def initialize(title)
|
8
5
|
@title = title
|
9
6
|
@left = ToolbarSection.new 'left'
|
10
7
|
@right = ToolbarSection.new 'right'
|
8
|
+
yield(self)
|
11
9
|
end
|
12
10
|
|
13
11
|
def left
|
@@ -20,42 +18,38 @@ module Aureus
|
|
20
18
|
|
21
19
|
def render
|
22
20
|
content_tag 'div', { class: 'aureus-toolbar' } do
|
23
|
-
compact content_tag('h1'
|
21
|
+
compact content_tag('h1', @title), @left.render, @right.render
|
24
22
|
end
|
25
23
|
end
|
26
|
-
|
27
24
|
end
|
28
25
|
|
29
26
|
class ToolbarSection < Renderable
|
30
|
-
|
31
|
-
def initialize position
|
27
|
+
def initialize(position)
|
32
28
|
@items = Array.new
|
33
29
|
@position = position
|
34
30
|
end
|
35
31
|
|
36
|
-
def link_to
|
37
|
-
@items << ToolbarButton.new(text,0,url,args)
|
32
|
+
def link_to(text, url, *args)
|
33
|
+
@items << ToolbarButton.new(text, 0, url, args)
|
38
34
|
end
|
39
35
|
|
40
|
-
def dropdown
|
36
|
+
def dropdown(title)
|
41
37
|
toolbar = ToolbarDropdown.new(title)
|
42
38
|
yield toolbar
|
43
39
|
@items << toolbar
|
44
40
|
end
|
45
41
|
|
46
|
-
def info
|
42
|
+
def info(text)
|
47
43
|
@items << ToolbarInfo.new(text,0)
|
48
44
|
end
|
49
45
|
|
50
46
|
def render
|
51
47
|
content_tag 'ul', compact_render(*@items), class: @position
|
52
48
|
end
|
53
|
-
|
54
49
|
end
|
55
50
|
|
56
51
|
class ToolbarButton < Renderable
|
57
|
-
|
58
|
-
def initialize text, level, url, args
|
52
|
+
def initialize(text, level, url, args)
|
59
53
|
@text = text
|
60
54
|
@level = level
|
61
55
|
@url = url
|
@@ -63,14 +57,12 @@ module Aureus
|
|
63
57
|
end
|
64
58
|
|
65
59
|
def render
|
66
|
-
content_tag 'li', link_to(@text
|
60
|
+
content_tag 'li', link_to(@text, @url, *@args), class: "level-#{@level}"
|
67
61
|
end
|
68
|
-
|
69
62
|
end
|
70
63
|
|
71
64
|
class ToolbarInfo < Renderable
|
72
|
-
|
73
|
-
def initialize text, level
|
65
|
+
def initialize(text, level)
|
74
66
|
@text = text
|
75
67
|
@level = level
|
76
68
|
end
|
@@ -78,32 +70,28 @@ module Aureus
|
|
78
70
|
def render
|
79
71
|
content_tag 'li', content_tag('span', @text, class: :info), class: "level-#{@level}"
|
80
72
|
end
|
81
|
-
|
82
73
|
end
|
83
74
|
|
84
75
|
class ToolbarDivider < Renderable
|
85
|
-
|
86
76
|
def initialize
|
87
77
|
end
|
88
78
|
|
89
79
|
def render
|
90
80
|
content_tag 'div', '', class: :line
|
91
81
|
end
|
92
|
-
|
93
82
|
end
|
94
83
|
|
95
84
|
class ToolbarDropdown < Renderable
|
96
|
-
|
97
|
-
def initialize title
|
85
|
+
def initialize(title)
|
98
86
|
@title = title
|
99
87
|
@items = Array.new
|
100
88
|
end
|
101
89
|
|
102
|
-
def link_to
|
90
|
+
def link_to(text, url, *args)
|
103
91
|
@items << ToolbarButton.new(text,1,url,args)
|
104
92
|
end
|
105
93
|
|
106
|
-
def info
|
94
|
+
def info(text)
|
107
95
|
@items << ToolbarInfo.new(text,1)
|
108
96
|
end
|
109
97
|
|
@@ -116,9 +104,6 @@ module Aureus
|
|
116
104
|
list = content_tag 'ul', compact_render(*@items), class: 'dropdown-inner'
|
117
105
|
content_tag 'li', title+list, class: 'dropdown-outer'
|
118
106
|
end
|
119
|
-
|
120
107
|
end
|
121
|
-
|
122
108
|
end
|
123
|
-
|
124
109
|
end
|
data/lib/aureus/engine.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
class Engine < Rails::Engine
|
4
3
|
config.autoload_paths << File.expand_path('../../', __FILE__)
|
5
4
|
initializer 'aureus.configure_rails_initialization' do |app|
|
@@ -7,7 +6,5 @@ module Aureus
|
|
7
6
|
include Aureus::Helper
|
8
7
|
end
|
9
8
|
end
|
10
|
-
|
11
9
|
end
|
12
|
-
|
13
10
|
end
|
data/lib/aureus/helper.rb
CHANGED
@@ -1,62 +1,39 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
module Helper
|
3
|
+
include Formtastic::Helpers::FormHelper
|
4
4
|
|
5
|
-
def aureus_toolbar
|
6
|
-
|
7
|
-
yield toolbar
|
8
|
-
toolbar.render
|
9
|
-
end
|
10
|
-
|
11
|
-
def aureus_navigation
|
12
|
-
navigation = Components::Navigation.new
|
13
|
-
yield navigation
|
14
|
-
navigation.render
|
5
|
+
def aureus_toolbar(title, &block)
|
6
|
+
Components::Toolbar.new(title, &block).render
|
15
7
|
end
|
16
8
|
|
17
|
-
def
|
18
|
-
|
19
|
-
messages.render
|
9
|
+
def aureus_navigation(&block)
|
10
|
+
Components::Navigation.new(&block).render
|
20
11
|
end
|
21
12
|
|
22
|
-
def
|
23
|
-
|
24
|
-
content.render
|
13
|
+
def aureus_messages(flash)
|
14
|
+
Components::Messages.new(flash).render
|
25
15
|
end
|
26
16
|
|
27
|
-
def aureus_row
|
28
|
-
|
29
|
-
row.render
|
17
|
+
def aureus_row(&block)
|
18
|
+
Components::Row.new(&block).render
|
30
19
|
end
|
31
20
|
|
32
|
-
def aureus_box
|
33
|
-
|
34
|
-
box.render
|
21
|
+
def aureus_box(title, *args, &block)
|
22
|
+
Components::Box.new(title, args, &block).render
|
35
23
|
end
|
36
24
|
|
37
|
-
def aureus_datatable
|
38
|
-
|
39
|
-
yield table
|
40
|
-
table.render
|
25
|
+
def aureus_datatable(resource, &block)
|
26
|
+
Components::DataTable.new(resource, &block).render
|
41
27
|
end
|
42
28
|
|
43
|
-
|
44
|
-
semantic_form_for args do |f|
|
45
|
-
capture_haml f, &block
|
46
|
-
end
|
47
|
-
end
|
29
|
+
alias_method :aureus_form, :semantic_form_for
|
48
30
|
|
49
|
-
def aureus_listing
|
50
|
-
|
51
|
-
yield listing
|
52
|
-
listing.render
|
31
|
+
def aureus_listing(&block)
|
32
|
+
Components::Listing.new(&block).render
|
53
33
|
end
|
54
34
|
|
55
|
-
def aureus_simple_map
|
56
|
-
|
57
|
-
map.render
|
35
|
+
def aureus_simple_map(*args)
|
36
|
+
Components::SimpleMap.new(args).render
|
58
37
|
end
|
59
|
-
|
60
38
|
end
|
61
|
-
|
62
39
|
end
|
data/lib/aureus/renderable.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module Aureus
|
2
|
-
|
3
2
|
class Renderable
|
4
3
|
include ActionView::Context
|
5
4
|
include ActionView::Helpers::TagHelper
|
@@ -7,30 +6,28 @@ module Aureus
|
|
7
6
|
include ActionView::Helpers::UrlHelper
|
8
7
|
include Haml::Helpers
|
9
8
|
|
10
|
-
def initialize
|
9
|
+
def initialize(content)
|
11
10
|
@content = content
|
12
11
|
end
|
13
12
|
|
14
|
-
def init
|
13
|
+
def init(args, *defaults)
|
15
14
|
@options = defaults.extract_options!.merge(args.extract_options!)
|
16
15
|
end
|
17
16
|
|
18
|
-
def content_tag
|
19
|
-
super
|
17
|
+
def content_tag(name, content_or_options_with_block=nil, options=nil, escape=false, &block)
|
18
|
+
super(name, content_or_options_with_block, options, escape, &block)
|
20
19
|
end
|
21
20
|
|
22
|
-
def compact
|
21
|
+
def compact(*args)
|
23
22
|
args.join.html_safe
|
24
23
|
end
|
25
24
|
|
26
|
-
def compact_render
|
25
|
+
def compact_render(*args)
|
27
26
|
args.map{ |e| e.render }.join.html_safe
|
28
27
|
end
|
29
28
|
|
30
29
|
def render
|
31
30
|
@content
|
32
31
|
end
|
33
|
-
|
34
32
|
end
|
35
|
-
|
36
33
|
end
|
data/lib/aureus/version.rb
CHANGED
data/lib/aureus.rb
CHANGED
@@ -6,12 +6,20 @@ require 'jquery-rails'
|
|
6
6
|
require 'leaflet-rails'
|
7
7
|
require 'normalize-rails'
|
8
8
|
require 'mapbox-rails'
|
9
|
-
require 'jquery-datatables-rails'
|
10
9
|
|
11
10
|
module Aureus
|
11
|
+
mattr_accessor :site_title
|
12
|
+
mattr_accessor :parent_controller
|
13
|
+
mattr_accessor :skin
|
14
|
+
mattr_accessor :mapbox_id
|
15
|
+
mattr_accessor :messages_timeout
|
16
|
+
mattr_accessor :toolbar_title
|
17
|
+
mattr_accessor :toolbar_builder
|
18
|
+
|
19
|
+
self.toolbar_builder = lambda{ |t| }
|
20
|
+
|
12
21
|
module Components
|
13
22
|
autoload :Box, 'aureus/components/box'
|
14
|
-
autoload :Content, 'aureus/components/content'
|
15
23
|
autoload :DataTable, 'aureus/components/data_table'
|
16
24
|
autoload :Listing, 'aureus/components/listing'
|
17
25
|
autoload :Messages, 'aureus/components/messages'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Aureus
|
2
|
+
module Generators
|
3
|
+
class CopyGenerator < Rails::Generators::Base
|
4
|
+
desc 'copy aureus views and layout'
|
5
|
+
source_root File.expand_path('../../../../../app/views', __FILE__)
|
6
|
+
|
7
|
+
def generate
|
8
|
+
directory 'aureus', 'app/views/aureus'
|
9
|
+
copy_file 'layouts/aureus.html.haml', 'app/layouts/aureus.html.haml'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Aureus
|
2
|
+
module Generators
|
3
|
+
class SetupGenerator < Rails::Generators::Base
|
4
|
+
desc 'generate an aureus initializer file'
|
5
|
+
def generate
|
6
|
+
initializer 'aureus.rb' do
|
7
|
+
"Aureus.parent_controller = 'ApplicationController'"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|