aureus 1.3.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -1
- data/Gemfile +9 -8
- data/Gemfile.lock +105 -104
- data/README.md +80 -0
- data/Rakefile +3 -16
- data/app/assets/javascripts/aureus/index.js +78 -20
- data/app/assets/stylesheets/aureus/index.scss +3 -35
- data/app/assets/stylesheets/aureus/skin/default.scss +52 -0
- data/app/assets/stylesheets/aureus/theme.scss +7 -0
- data/app/assets/stylesheets/aureus/theme/base.scss +19 -0
- data/app/assets/stylesheets/aureus/theme/content.scss +65 -0
- data/app/assets/stylesheets/aureus/{form.scss → theme/form.scss} +27 -27
- data/app/assets/stylesheets/aureus/theme/messages.scss +16 -0
- data/app/assets/stylesheets/aureus/theme/navigation.scss +42 -0
- data/app/assets/stylesheets/aureus/theme/table.scss +121 -0
- data/app/assets/stylesheets/aureus/theme/toolbar.scss +80 -0
- data/aureus.gemspec +21 -12
- data/config.ru +10 -0
- data/lib/aureus.rb +22 -18
- data/lib/aureus/components/box.rb +58 -0
- data/lib/aureus/components/content.rb +19 -0
- data/lib/aureus/components/data_table.rb +169 -0
- data/lib/aureus/components/listing.rb +43 -0
- data/lib/aureus/components/messages.rb +27 -0
- data/lib/aureus/components/navigation.rb +48 -0
- data/lib/aureus/components/row.rb +69 -0
- data/lib/aureus/components/simple_map.rb +21 -0
- data/lib/aureus/components/toolbar.rb +124 -0
- data/lib/aureus/engine.rb +8 -2
- data/lib/aureus/helper.rb +56 -55
- data/lib/aureus/renderable.rb +4 -12
- data/lib/aureus/version.rb +2 -2
- data/lib/generators/aureus/devise_i18n/devise_i18n_generator.rb +17 -12
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_base.de.yml +0 -0
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_base.en.yml +1 -1
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_mail.de.yml +1 -1
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_mail.en.yml +1 -1
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_ui.de.yml +0 -0
- data/{config → lib/generators/aureus/devise_i18n}/locales/devise_ui.en.yml +0 -0
- data/lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb +25 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.de.yml +11 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.en.yml +11 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.de.yml +9 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.en.yml +9 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.de.yml +12 -0
- data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.en.yml +12 -0
- data/lib/generators/aureus/devise_invitable_views/devise_invitable_views_generator.rb +23 -0
- data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/edit.html.haml +9 -0
- data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/new.html.haml +8 -0
- data/lib/generators/aureus/devise_invitable_views/templates/devise/mailer/invitation_instructions.html.haml +5 -0
- data/lib/generators/aureus/devise_views/devise_views_generator.rb +17 -15
- data/lib/generators/aureus/devise_views/templates/devise/confirmations/new.html.haml +5 -5
- data/lib/generators/aureus/devise_views/templates/devise/mailer/confirmation_instructions.html.haml +3 -3
- data/lib/generators/aureus/devise_views/templates/devise/mailer/reset_password_instructions.html.haml +5 -5
- data/lib/generators/aureus/devise_views/templates/devise/mailer/unlock_instructions.html.haml +4 -4
- data/lib/generators/aureus/devise_views/templates/devise/passwords/edit.html.haml +7 -7
- data/lib/generators/aureus/devise_views/templates/devise/passwords/new.html.haml +5 -5
- data/lib/generators/aureus/devise_views/templates/devise/registrations/edit.html.haml +9 -9
- data/lib/generators/aureus/devise_views/templates/devise/registrations/new.html.haml +7 -7
- data/lib/generators/aureus/devise_views/templates/devise/sessions/new.html.haml +7 -7
- data/lib/generators/aureus/devise_views/templates/devise/shared/_links.html.haml +6 -6
- data/lib/generators/aureus/devise_views/templates/devise/unlocks/new.html.haml +5 -5
- data/lib/generators/aureus/layout/layout_generator.rb +10 -10
- data/lib/generators/aureus/layout/templates/layout.html.haml +8 -8
- data/lib/generators/aureus/views/templates/views/_form.html.haml +3 -3
- data/lib/generators/aureus/views/templates/views/_item.html.haml +2 -2
- data/lib/generators/aureus/views/templates/views/_list.html.haml +8 -8
- data/lib/generators/aureus/views/templates/views/edit.html.haml +4 -4
- data/lib/generators/aureus/views/templates/views/index.html.haml +3 -3
- data/lib/generators/aureus/views/templates/views/new.html.haml +4 -4
- data/lib/generators/aureus/views/templates/views/show.html.haml +4 -4
- data/lib/generators/aureus/views/views_generator.rb +70 -68
- data/spec/controllers/all_spec.rb +19 -0
- data/spec/internal/app/assets/javascripts/application.js +9 -0
- data/spec/internal/app/assets/stylesheets/application.scss +5 -0
- data/spec/internal/app/controllers/all_controller.rb +14 -0
- data/spec/internal/app/controllers/resources_controller.rb +2 -0
- data/spec/{lib/helper → internal/app/models}/resource.rb +0 -0
- data/spec/internal/app/views/all/centered.html.haml +5 -0
- data/spec/internal/app/views/all/index.html.haml +39 -0
- data/spec/internal/app/views/layouts/application.html.haml +24 -0
- data/spec/internal/app/views/layouts/naked.html.haml +10 -0
- data/spec/internal/config/database.yml +3 -0
- data/spec/internal/config/routes.rb +5 -0
- data/spec/internal/db/schema.rb +10 -0
- data/spec/internal/log/.gitignore +1 -0
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/lib/generators/devise_i18n_spec.rb +19 -0
- data/spec/lib/generators/devise_invitable_i18n_spec.rb +19 -0
- data/spec/lib/generators/devise_invitable_views_spec.rb +19 -0
- data/spec/lib/generators/devise_views_spec.rb +25 -0
- data/spec/lib/generators/layout_spec.rb +17 -0
- data/spec/lib/generators/views_spec.rb +26 -0
- data/spec/requests/all_spec.rb +12 -0
- data/spec/spec_helper.rb +15 -0
- metadata +219 -78
- data/.rspec +0 -2
- data/Guardfile +0 -4
- data/Readme.md +0 -370
- data/TODO.md +0 -11
- data/app/assets/images/aureus/background.png +0 -0
- data/app/assets/images/aureus/topbar.png +0 -0
- data/app/assets/javascripts/aureus/defaults.js +0 -30
- data/app/assets/javascripts/aureus/extensions.js +0 -42
- data/app/assets/javascripts/aureus/functions.js +0 -67
- data/app/assets/javascripts/aureus/plugins/jquery-calendrical.js +0 -508
- data/app/assets/javascripts/aureus/plugins/jquery-datatables.js +0 -11838
- data/app/assets/javascripts/aureus/plugins/jquery-qtip.js +0 -15
- data/app/assets/stylesheets/aureus/base.scss +0 -48
- data/app/assets/stylesheets/aureus/content.scss +0 -100
- data/app/assets/stylesheets/aureus/mixins.scss +0 -43
- data/app/assets/stylesheets/aureus/navigation.scss +0 -43
- data/app/assets/stylesheets/aureus/reset.scss +0 -50
- data/app/assets/stylesheets/aureus/table.scss +0 -153
- data/app/assets/stylesheets/aureus/topbar.scss +0 -89
- data/app/assets/stylesheets/aureus/ui.scss +0 -98
- data/lib/aureus/box.rb +0 -54
- data/lib/aureus/content.rb +0 -15
- data/lib/aureus/data_table.rb +0 -148
- data/lib/aureus/listing.rb +0 -39
- data/lib/aureus/map.rb +0 -17
- data/lib/aureus/messages.rb +0 -23
- data/lib/aureus/navigation.rb +0 -42
- data/lib/aureus/row.rb +0 -65
- data/lib/aureus/toolbar.rb +0 -99
- data/spec/lib/helper/schema.rb +0 -6
- data/spec/lib/render_spec.rb +0 -16
- data/spec/lib/spec_helper.rb +0 -21
- data/spec/lib/views/box.haml +0 -14
- data/spec/lib/views/content.haml +0 -2
- data/spec/lib/views/datatable.haml +0 -11
- data/spec/lib/views/listing.haml +0 -5
- data/spec/lib/views/messages.haml +0 -2
- data/spec/lib/views/navigation.haml +0 -4
- data/spec/lib/views/row.haml +0 -28
- data/spec/lib/views/toolbar.haml +0 -11
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dce55313974fe349cc5900b58af1aa45451c9f77
|
4
|
+
data.tar.gz: eb8031c5d2e8a8a61c21c96eaacf263e1cde8a95
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fa6699583cd40d57855eead81b0cfd93f74b2a9fed36fe9ff82ec8770b45e32c55babb05336a242b48bbb0d10f859a08370e5298f8250ffd3ab8efeb3e185d0a
|
7
|
+
data.tar.gz: 5583d253734d4939344ddaf1f4d00c1e529d814b05e20ce6c3b03d396caba02e0272ef6ae4cf5d5fac42a0477594f05b6a7516029e940f5be093a5edebc48c4e
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
gemspec
|
3
3
|
|
4
4
|
group :test do
|
5
|
-
gem
|
6
|
-
gem
|
7
|
-
gem
|
8
|
-
gem
|
9
|
-
gem
|
10
|
-
gem
|
11
|
-
|
5
|
+
gem 'rspec-rails'
|
6
|
+
gem 'combustion'
|
7
|
+
gem 'actionpack'
|
8
|
+
gem 'activerecord'
|
9
|
+
gem 'sqlite3'
|
10
|
+
gem 'sprockets'
|
11
|
+
gem 'generator_spec'
|
12
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,127 +1,128 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
aureus (1.
|
4
|
+
aureus (2.1.0)
|
5
|
+
formtastic (= 2.3.0.rc2)
|
6
|
+
haml-rails
|
7
|
+
jquery-datatables-rails
|
8
|
+
jquery-rails
|
9
|
+
jquery-ui-rails
|
10
|
+
leaflet-rails
|
11
|
+
mapbox-rails
|
12
|
+
normalize-rails
|
13
|
+
sass-rails
|
5
14
|
|
6
15
|
GEM
|
7
16
|
remote: http://rubygems.org/
|
8
17
|
specs:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
actionpack (3.2.9)
|
13
|
-
activemodel (= 3.2.9)
|
14
|
-
activesupport (= 3.2.9)
|
15
|
-
builder (~> 3.0.0)
|
18
|
+
actionpack (4.0.2)
|
19
|
+
activesupport (= 4.0.2)
|
20
|
+
builder (~> 3.1.0)
|
16
21
|
erubis (~> 2.7.0)
|
17
|
-
|
18
|
-
rack (~>
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
erubis (2.7.0)
|
41
|
-
guard (1.5.4)
|
42
|
-
listen (>= 0.4.2)
|
43
|
-
lumberjack (>= 1.0.2)
|
44
|
-
pry (>= 0.9.10)
|
22
|
+
rack (~> 1.5.2)
|
23
|
+
rack-test (~> 0.6.2)
|
24
|
+
activemodel (4.0.2)
|
25
|
+
activesupport (= 4.0.2)
|
26
|
+
builder (~> 3.1.0)
|
27
|
+
activerecord (4.0.2)
|
28
|
+
activemodel (= 4.0.2)
|
29
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
30
|
+
activesupport (= 4.0.2)
|
31
|
+
arel (~> 4.0.0)
|
32
|
+
activerecord-deprecated_finders (1.0.3)
|
33
|
+
activesupport (4.0.2)
|
34
|
+
i18n (~> 0.6, >= 0.6.4)
|
35
|
+
minitest (~> 4.2)
|
36
|
+
multi_json (~> 1.3)
|
37
|
+
thread_safe (~> 0.1)
|
38
|
+
tzinfo (~> 0.3.37)
|
39
|
+
arel (4.0.1)
|
40
|
+
atomic (1.1.14)
|
41
|
+
builder (3.1.4)
|
42
|
+
combustion (0.5.1)
|
43
|
+
activesupport (>= 3.0.0)
|
44
|
+
railties (>= 3.0.0)
|
45
45
|
thor (>= 0.14.6)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
46
|
+
diff-lcs (1.2.5)
|
47
|
+
erubis (2.7.0)
|
48
|
+
formtastic (2.3.0.rc2)
|
49
|
+
actionpack (>= 3.0)
|
50
|
+
generator_spec (0.9.2)
|
51
|
+
activesupport (>= 3.0.0)
|
52
|
+
railties (>= 3.0.0)
|
53
|
+
haml (4.0.5)
|
54
|
+
tilt
|
55
|
+
haml-rails (0.5.3)
|
56
|
+
actionpack (>= 4.0.1)
|
57
|
+
activesupport (>= 4.0.1)
|
58
|
+
haml (>= 3.1, < 5.0)
|
59
|
+
railties (>= 4.0.1)
|
60
|
+
hike (1.2.3)
|
61
|
+
i18n (0.6.9)
|
62
|
+
jquery-datatables-rails (1.12.2)
|
63
|
+
jquery-rails
|
64
|
+
jquery-rails (3.1.0)
|
65
|
+
railties (>= 3.0, < 5.0)
|
66
|
+
thor (>= 0.14, < 2.0)
|
67
|
+
jquery-ui-rails (4.2.0)
|
68
|
+
railties (>= 3.2.16)
|
69
|
+
leaflet-rails (0.7.2)
|
70
|
+
mapbox-rails (1.6.1.1)
|
71
|
+
minitest (4.7.5)
|
72
|
+
multi_json (1.8.2)
|
73
|
+
normalize-rails (3.0)
|
74
|
+
rack (1.5.2)
|
74
75
|
rack-test (0.6.2)
|
75
76
|
rack (>= 1.0)
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
activerecord (= 3.2.9)
|
80
|
-
activeresource (= 3.2.9)
|
81
|
-
activesupport (= 3.2.9)
|
82
|
-
bundler (~> 1.0)
|
83
|
-
railties (= 3.2.9)
|
84
|
-
railties (3.2.9)
|
85
|
-
actionpack (= 3.2.9)
|
86
|
-
activesupport (= 3.2.9)
|
87
|
-
rack-ssl (~> 1.3.2)
|
77
|
+
railties (4.0.2)
|
78
|
+
actionpack (= 4.0.2)
|
79
|
+
activesupport (= 4.0.2)
|
88
80
|
rake (>= 0.8.7)
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
rspec (2.
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
81
|
+
thor (>= 0.18.1, < 2.0)
|
82
|
+
rake (10.1.0)
|
83
|
+
rspec-core (2.14.8)
|
84
|
+
rspec-expectations (2.14.5)
|
85
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
86
|
+
rspec-mocks (2.14.6)
|
87
|
+
rspec-rails (2.14.1)
|
88
|
+
actionpack (>= 3.0)
|
89
|
+
activemodel (>= 3.0)
|
90
|
+
activesupport (>= 3.0)
|
91
|
+
railties (>= 3.0)
|
92
|
+
rspec-core (~> 2.14.0)
|
93
|
+
rspec-expectations (~> 2.14.0)
|
94
|
+
rspec-mocks (~> 2.14.0)
|
95
|
+
sass (3.2.15)
|
96
|
+
sass-rails (4.0.2)
|
97
|
+
railties (>= 4.0.0, < 5.0)
|
98
|
+
sass (~> 3.2.0)
|
99
|
+
sprockets (~> 2.8, <= 2.11.0)
|
100
|
+
sprockets-rails (~> 2.0.0)
|
101
|
+
sprockets (2.10.1)
|
105
102
|
hike (~> 1.2)
|
106
103
|
multi_json (~> 1.0)
|
107
104
|
rack (~> 1.0)
|
108
105
|
tilt (~> 1.1, != 1.3.0)
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
106
|
+
sprockets-rails (2.0.1)
|
107
|
+
actionpack (>= 3.0)
|
108
|
+
activesupport (>= 3.0)
|
109
|
+
sprockets (~> 2.8)
|
110
|
+
sqlite3 (1.3.8)
|
111
|
+
thor (0.18.1)
|
112
|
+
thread_safe (0.1.3)
|
113
|
+
atomic
|
114
|
+
tilt (1.4.1)
|
115
|
+
tzinfo (0.3.38)
|
116
116
|
|
117
117
|
PLATFORMS
|
118
118
|
ruby
|
119
119
|
|
120
120
|
DEPENDENCIES
|
121
|
+
actionpack
|
122
|
+
activerecord
|
121
123
|
aureus!
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
rb-fsevent (~> 0.9.1)
|
124
|
+
combustion
|
125
|
+
generator_spec
|
126
|
+
rspec-rails
|
127
|
+
sprockets
|
127
128
|
sqlite3
|
data/README.md
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# aureus
|
2
|
+
|
3
|
+
**a framework for rails admin interfaces**
|
4
|
+
|
5
|
+
Aureus is a tool to quickly generate admin interfaces for a rails app.
|
6
|
+
It's between scaffolding and tools like ActiveAdmin.
|
7
|
+
|
8
|
+
## General Concept
|
9
|
+
|
10
|
+
The idea behind aureus is to abstract as much as possible of GUI rendering by still giving enough freedom for customization.
|
11
|
+
A typical aureus driven view would look like this:
|
12
|
+
|
13
|
+
```haml
|
14
|
+
= aureus_row do |r|
|
15
|
+
= aureus_box 'Datatable' do
|
16
|
+
= aureus_datatable Resource.all do |t|
|
17
|
+
- t.head do |h|
|
18
|
+
- h.text 'Title'
|
19
|
+
- h.text 'Text'
|
20
|
+
- t.row do |r,res|
|
21
|
+
- r.identifier res.id
|
22
|
+
- r.cell res.title
|
23
|
+
- r.cell res.text
|
24
|
+
- r.button :show, 'url'
|
25
|
+
- r.button :edit, 'url'
|
26
|
+
- r.button :destroy, 'url', confirm: 'Delete user?'
|
27
|
+
```
|
28
|
+
|
29
|
+
## Installation
|
30
|
+
|
31
|
+
To use **aureus** simply require the gem:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
gem 'aureus'
|
35
|
+
```
|
36
|
+
|
37
|
+
### Asset Pipeline
|
38
|
+
|
39
|
+
Aureus uses the rails asset pipeline to load and override the style and behavior.
|
40
|
+
|
41
|
+
Change your `application.scss` to match the following:
|
42
|
+
|
43
|
+
```scss
|
44
|
+
//= require aureus
|
45
|
+
//= require_self
|
46
|
+
|
47
|
+
@import 'aureus/skin/default';
|
48
|
+
@import 'aureus/theme';
|
49
|
+
```
|
50
|
+
|
51
|
+
Change your `application.js` to match the following:
|
52
|
+
|
53
|
+
```javascript
|
54
|
+
//= require aureus
|
55
|
+
//= require_self
|
56
|
+
|
57
|
+
$(function(){
|
58
|
+
aureus({
|
59
|
+
remove_messages_after: 2
|
60
|
+
});
|
61
|
+
});
|
62
|
+
```
|
63
|
+
|
64
|
+
You can now use the aureus framework to rapidly build awesome interfaces!
|
65
|
+
|
66
|
+
## Generators
|
67
|
+
|
68
|
+
Aureus has a bunch of generators built-in to easily generate a complete interface.
|
69
|
+
|
70
|
+
### Layout & Views
|
71
|
+
|
72
|
+
* Run `rails g aureus:layout application` to generate a typical aureus layout.
|
73
|
+
* Run `rails g aureus:views Resource ResourcesController` to generate aureus views for a model and controller.
|
74
|
+
|
75
|
+
### Devise
|
76
|
+
|
77
|
+
* Run `rails g aureus:devise_views devise` to generate views using aureus helpers.
|
78
|
+
* Run `rails g aureus:devise_i18n devise` to generate the i18n file used by the views.
|
79
|
+
* Run `rails g aureus:devise_invitable_views devise` to generate views using aureus helpers.
|
80
|
+
* Run `rails g aureus:devise_invitable_i18n devise` to generate the i18n file used by the views.
|
data/Rakefile
CHANGED
@@ -1,17 +1,4 @@
|
|
1
|
-
require
|
2
|
-
gem "highline"
|
1
|
+
require 'rspec/core/rake_task'
|
3
2
|
|
4
|
-
|
5
|
-
task :
|
6
|
-
require "highline/import"
|
7
|
-
puts "build gem..."
|
8
|
-
`gem build aureus.gemspec`
|
9
|
-
Dir["*.gem"].each do |file|
|
10
|
-
if agree "publish gem: #{file}? (y,n)"
|
11
|
-
puts "publishing gem..."
|
12
|
-
`gem push #{file}`
|
13
|
-
end
|
14
|
-
end
|
15
|
-
puts "remove gem..."
|
16
|
-
`rm *.gem`
|
17
|
-
end
|
3
|
+
RSpec::Core::RakeTask.new :spec
|
4
|
+
task :default => :spec
|
@@ -1,20 +1,78 @@
|
|
1
|
-
//=
|
2
|
-
//= require
|
3
|
-
//= require
|
4
|
-
//= require
|
5
|
-
//=
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
//= require jquery
|
2
|
+
//= require jquery_ujs
|
3
|
+
//= require leaflet
|
4
|
+
//= require mapbox
|
5
|
+
//= require dataTables/jquery.dataTables
|
6
|
+
|
7
|
+
var aureus_default_options = {
|
8
|
+
mapbox_id: 'the_id'
|
9
|
+
};
|
10
|
+
|
11
|
+
function aureus(options) {
|
12
|
+
window.aureus = { options: jQuery.extend({}, aureus_default_options, options || {}) };
|
13
|
+
_aureus_remove_messages_after(window.aureus.options.remove_messages_after);
|
14
|
+
_aureus_datatables_decorate();
|
15
|
+
_aureus_simple_map();
|
16
|
+
_aureus_dropdown();
|
17
|
+
}
|
18
|
+
|
19
|
+
function aureus_trigger_form(selector) {
|
20
|
+
$(selector).submit();
|
21
|
+
}
|
22
|
+
|
23
|
+
function _aureus_remove_messages_after(seconds) {
|
24
|
+
setTimeout(function() {
|
25
|
+
$('.aureus-messages p').fadeOut();
|
26
|
+
}, seconds*1000);
|
27
|
+
}
|
28
|
+
|
29
|
+
function _aureus_datatables_decorate() {
|
30
|
+
$.fn.dataTableExt.oStdClasses.sWrapper = 'datatable-wrapper';
|
31
|
+
$('.datatable').each(function(){
|
32
|
+
$(this).dataTable({
|
33
|
+
sDom: 't',
|
34
|
+
oLanguage: _aureus_datatable_translation($(this)),
|
35
|
+
bPaginate: false,
|
36
|
+
aoColumns: _aureus_datatables_column_configurator($(this))
|
37
|
+
});
|
38
|
+
});
|
39
|
+
}
|
40
|
+
|
41
|
+
function _aureus_datatable_translation(table) {
|
42
|
+
return {
|
43
|
+
sSearch : table.data('i18n_sSearch'),
|
44
|
+
sLengthMenu: table.data('i18n_sLengthMenu'),
|
45
|
+
sZeroRecords: table.data('i18n_sZeroRecords'),
|
46
|
+
sInfo: table.data('i18n_sInfo'),
|
47
|
+
sInfoEmpty: table.data('i18n_sInfoEmpty'),
|
48
|
+
sInfoFiltered: table.data('i18n_sInfoFiltere')
|
49
|
+
};
|
50
|
+
}
|
51
|
+
|
52
|
+
function _aureus_datatables_column_configurator(table) {
|
53
|
+
var ret = [];
|
54
|
+
table.find('thead tr th').each(function(){
|
55
|
+
if($(this).hasClass('no-sorting')) {
|
56
|
+
ret.push({ bSortable: false });
|
57
|
+
} else {
|
58
|
+
ret.push(null);
|
59
|
+
}
|
60
|
+
});
|
61
|
+
return ret;
|
62
|
+
}
|
63
|
+
|
64
|
+
function _aureus_simple_map() {
|
65
|
+
$('.aureus-simple-map').each(function(){
|
66
|
+
var el = $(this);
|
67
|
+
el.height(el.data('height'));
|
68
|
+
var pos = [el.data('latitude'), el.data('longitude')];
|
69
|
+
var lmap = L.mapbox.map(this, window.aureus.options['mapbox_id'],{attributionControl: false}).setView(pos, el.data('zoom'));
|
70
|
+
L.marker(pos).addTo(lmap);
|
71
|
+
});
|
72
|
+
}
|
73
|
+
|
74
|
+
function _aureus_dropdown() {
|
75
|
+
$('.dropdown-accessor').click(function(){
|
76
|
+
$(this).parent().toggleClass('active');
|
77
|
+
});
|
78
|
+
}
|