aureus 1.3.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -1
  3. data/Gemfile +9 -8
  4. data/Gemfile.lock +105 -104
  5. data/README.md +80 -0
  6. data/Rakefile +3 -16
  7. data/app/assets/javascripts/aureus/index.js +78 -20
  8. data/app/assets/stylesheets/aureus/index.scss +3 -35
  9. data/app/assets/stylesheets/aureus/skin/default.scss +52 -0
  10. data/app/assets/stylesheets/aureus/theme.scss +7 -0
  11. data/app/assets/stylesheets/aureus/theme/base.scss +19 -0
  12. data/app/assets/stylesheets/aureus/theme/content.scss +65 -0
  13. data/app/assets/stylesheets/aureus/{form.scss → theme/form.scss} +27 -27
  14. data/app/assets/stylesheets/aureus/theme/messages.scss +16 -0
  15. data/app/assets/stylesheets/aureus/theme/navigation.scss +42 -0
  16. data/app/assets/stylesheets/aureus/theme/table.scss +121 -0
  17. data/app/assets/stylesheets/aureus/theme/toolbar.scss +80 -0
  18. data/aureus.gemspec +21 -12
  19. data/config.ru +10 -0
  20. data/lib/aureus.rb +22 -18
  21. data/lib/aureus/components/box.rb +58 -0
  22. data/lib/aureus/components/content.rb +19 -0
  23. data/lib/aureus/components/data_table.rb +169 -0
  24. data/lib/aureus/components/listing.rb +43 -0
  25. data/lib/aureus/components/messages.rb +27 -0
  26. data/lib/aureus/components/navigation.rb +48 -0
  27. data/lib/aureus/components/row.rb +69 -0
  28. data/lib/aureus/components/simple_map.rb +21 -0
  29. data/lib/aureus/components/toolbar.rb +124 -0
  30. data/lib/aureus/engine.rb +8 -2
  31. data/lib/aureus/helper.rb +56 -55
  32. data/lib/aureus/renderable.rb +4 -12
  33. data/lib/aureus/version.rb +2 -2
  34. data/lib/generators/aureus/devise_i18n/devise_i18n_generator.rb +17 -12
  35. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_base.de.yml +0 -0
  36. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_base.en.yml +1 -1
  37. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_mail.de.yml +1 -1
  38. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_mail.en.yml +1 -1
  39. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_ui.de.yml +0 -0
  40. data/{config → lib/generators/aureus/devise_i18n}/locales/devise_ui.en.yml +0 -0
  41. data/lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb +25 -0
  42. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.de.yml +11 -0
  43. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_base.en.yml +11 -0
  44. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.de.yml +9 -0
  45. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_mail.en.yml +9 -0
  46. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.de.yml +12 -0
  47. data/lib/generators/aureus/devise_invitable_i18n/locales/devise_invitable_ui.en.yml +12 -0
  48. data/lib/generators/aureus/devise_invitable_views/devise_invitable_views_generator.rb +23 -0
  49. data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/edit.html.haml +9 -0
  50. data/lib/generators/aureus/devise_invitable_views/templates/devise/invitations/new.html.haml +8 -0
  51. data/lib/generators/aureus/devise_invitable_views/templates/devise/mailer/invitation_instructions.html.haml +5 -0
  52. data/lib/generators/aureus/devise_views/devise_views_generator.rb +17 -15
  53. data/lib/generators/aureus/devise_views/templates/devise/confirmations/new.html.haml +5 -5
  54. data/lib/generators/aureus/devise_views/templates/devise/mailer/confirmation_instructions.html.haml +3 -3
  55. data/lib/generators/aureus/devise_views/templates/devise/mailer/reset_password_instructions.html.haml +5 -5
  56. data/lib/generators/aureus/devise_views/templates/devise/mailer/unlock_instructions.html.haml +4 -4
  57. data/lib/generators/aureus/devise_views/templates/devise/passwords/edit.html.haml +7 -7
  58. data/lib/generators/aureus/devise_views/templates/devise/passwords/new.html.haml +5 -5
  59. data/lib/generators/aureus/devise_views/templates/devise/registrations/edit.html.haml +9 -9
  60. data/lib/generators/aureus/devise_views/templates/devise/registrations/new.html.haml +7 -7
  61. data/lib/generators/aureus/devise_views/templates/devise/sessions/new.html.haml +7 -7
  62. data/lib/generators/aureus/devise_views/templates/devise/shared/_links.html.haml +6 -6
  63. data/lib/generators/aureus/devise_views/templates/devise/unlocks/new.html.haml +5 -5
  64. data/lib/generators/aureus/layout/layout_generator.rb +10 -10
  65. data/lib/generators/aureus/layout/templates/layout.html.haml +8 -8
  66. data/lib/generators/aureus/views/templates/views/_form.html.haml +3 -3
  67. data/lib/generators/aureus/views/templates/views/_item.html.haml +2 -2
  68. data/lib/generators/aureus/views/templates/views/_list.html.haml +8 -8
  69. data/lib/generators/aureus/views/templates/views/edit.html.haml +4 -4
  70. data/lib/generators/aureus/views/templates/views/index.html.haml +3 -3
  71. data/lib/generators/aureus/views/templates/views/new.html.haml +4 -4
  72. data/lib/generators/aureus/views/templates/views/show.html.haml +4 -4
  73. data/lib/generators/aureus/views/views_generator.rb +70 -68
  74. data/spec/controllers/all_spec.rb +19 -0
  75. data/spec/internal/app/assets/javascripts/application.js +9 -0
  76. data/spec/internal/app/assets/stylesheets/application.scss +5 -0
  77. data/spec/internal/app/controllers/all_controller.rb +14 -0
  78. data/spec/internal/app/controllers/resources_controller.rb +2 -0
  79. data/spec/{lib/helper → internal/app/models}/resource.rb +0 -0
  80. data/spec/internal/app/views/all/centered.html.haml +5 -0
  81. data/spec/internal/app/views/all/index.html.haml +39 -0
  82. data/spec/internal/app/views/layouts/application.html.haml +24 -0
  83. data/spec/internal/app/views/layouts/naked.html.haml +10 -0
  84. data/spec/internal/config/database.yml +3 -0
  85. data/spec/internal/config/routes.rb +5 -0
  86. data/spec/internal/db/schema.rb +10 -0
  87. data/spec/internal/log/.gitignore +1 -0
  88. data/spec/internal/public/favicon.ico +0 -0
  89. data/spec/lib/generators/devise_i18n_spec.rb +19 -0
  90. data/spec/lib/generators/devise_invitable_i18n_spec.rb +19 -0
  91. data/spec/lib/generators/devise_invitable_views_spec.rb +19 -0
  92. data/spec/lib/generators/devise_views_spec.rb +25 -0
  93. data/spec/lib/generators/layout_spec.rb +17 -0
  94. data/spec/lib/generators/views_spec.rb +26 -0
  95. data/spec/requests/all_spec.rb +12 -0
  96. data/spec/spec_helper.rb +15 -0
  97. metadata +219 -78
  98. data/.rspec +0 -2
  99. data/Guardfile +0 -4
  100. data/Readme.md +0 -370
  101. data/TODO.md +0 -11
  102. data/app/assets/images/aureus/background.png +0 -0
  103. data/app/assets/images/aureus/topbar.png +0 -0
  104. data/app/assets/javascripts/aureus/defaults.js +0 -30
  105. data/app/assets/javascripts/aureus/extensions.js +0 -42
  106. data/app/assets/javascripts/aureus/functions.js +0 -67
  107. data/app/assets/javascripts/aureus/plugins/jquery-calendrical.js +0 -508
  108. data/app/assets/javascripts/aureus/plugins/jquery-datatables.js +0 -11838
  109. data/app/assets/javascripts/aureus/plugins/jquery-qtip.js +0 -15
  110. data/app/assets/stylesheets/aureus/base.scss +0 -48
  111. data/app/assets/stylesheets/aureus/content.scss +0 -100
  112. data/app/assets/stylesheets/aureus/mixins.scss +0 -43
  113. data/app/assets/stylesheets/aureus/navigation.scss +0 -43
  114. data/app/assets/stylesheets/aureus/reset.scss +0 -50
  115. data/app/assets/stylesheets/aureus/table.scss +0 -153
  116. data/app/assets/stylesheets/aureus/topbar.scss +0 -89
  117. data/app/assets/stylesheets/aureus/ui.scss +0 -98
  118. data/lib/aureus/box.rb +0 -54
  119. data/lib/aureus/content.rb +0 -15
  120. data/lib/aureus/data_table.rb +0 -148
  121. data/lib/aureus/listing.rb +0 -39
  122. data/lib/aureus/map.rb +0 -17
  123. data/lib/aureus/messages.rb +0 -23
  124. data/lib/aureus/navigation.rb +0 -42
  125. data/lib/aureus/row.rb +0 -65
  126. data/lib/aureus/toolbar.rb +0 -99
  127. data/spec/lib/helper/schema.rb +0 -6
  128. data/spec/lib/render_spec.rb +0 -16
  129. data/spec/lib/spec_helper.rb +0 -21
  130. data/spec/lib/views/box.haml +0 -14
  131. data/spec/lib/views/content.haml +0 -2
  132. data/spec/lib/views/datatable.haml +0 -11
  133. data/spec/lib/views/listing.haml +0 -5
  134. data/spec/lib/views/messages.haml +0 -2
  135. data/spec/lib/views/navigation.haml +0 -4
  136. data/spec/lib/views/row.haml +0 -28
  137. 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
@@ -1 +1,4 @@
1
- *.DS_Store
1
+ .DS_Store
2
+ tmp
3
+ spec/internal/tmp
4
+ *.gem
data/Gemfile CHANGED
@@ -1,11 +1,12 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :test do
5
- gem "guard-rspec"
6
- gem "rb-fsevent", "~> 0.9.1"
7
- gem "highline"
8
- gem "rails"
9
- gem "sqlite3"
10
- gem "haml"
11
- end
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.3.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
- actionmailer (3.2.9)
10
- actionpack (= 3.2.9)
11
- mail (~> 2.4.4)
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
- journey (~> 1.0.4)
18
- rack (~> 1.4.0)
19
- rack-cache (~> 1.2)
20
- rack-test (~> 0.6.1)
21
- sprockets (~> 2.2.1)
22
- activemodel (3.2.9)
23
- activesupport (= 3.2.9)
24
- builder (~> 3.0.0)
25
- activerecord (3.2.9)
26
- activemodel (= 3.2.9)
27
- activesupport (= 3.2.9)
28
- arel (~> 3.0.2)
29
- tzinfo (~> 0.3.29)
30
- activeresource (3.2.9)
31
- activemodel (= 3.2.9)
32
- activesupport (= 3.2.9)
33
- activesupport (3.2.9)
34
- i18n (~> 0.6)
35
- multi_json (~> 1.0)
36
- arel (3.0.2)
37
- builder (3.0.4)
38
- coderay (1.0.8)
39
- diff-lcs (1.1.3)
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
- guard-rspec (2.1.2)
47
- guard (>= 1.1)
48
- rspec (~> 2.11)
49
- haml (3.1.7)
50
- highline (1.6.15)
51
- hike (1.2.1)
52
- i18n (0.6.1)
53
- journey (1.0.4)
54
- json (1.7.5)
55
- listen (0.5.3)
56
- lumberjack (1.0.2)
57
- mail (2.4.4)
58
- i18n (>= 0.4.0)
59
- mime-types (~> 1.16)
60
- treetop (~> 1.4.8)
61
- method_source (0.8.1)
62
- mime-types (1.19)
63
- multi_json (1.3.7)
64
- polyglot (0.3.3)
65
- pry (0.9.10)
66
- coderay (~> 1.0.5)
67
- method_source (~> 0.8)
68
- slop (~> 3.3.1)
69
- rack (1.4.1)
70
- rack-cache (1.2)
71
- rack (>= 0.4)
72
- rack-ssl (1.3.2)
73
- rack
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
- rails (3.2.9)
77
- actionmailer (= 3.2.9)
78
- actionpack (= 3.2.9)
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
- rdoc (~> 3.4)
90
- thor (>= 0.14.6, < 2.0)
91
- rake (10.0.2)
92
- rb-fsevent (0.9.2)
93
- rdoc (3.12)
94
- json (~> 1.4)
95
- rspec (2.12.0)
96
- rspec-core (~> 2.12.0)
97
- rspec-expectations (~> 2.12.0)
98
- rspec-mocks (~> 2.12.0)
99
- rspec-core (2.12.0)
100
- rspec-expectations (2.12.0)
101
- diff-lcs (~> 1.1.3)
102
- rspec-mocks (2.12.0)
103
- slop (3.3.3)
104
- sprockets (2.2.1)
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
- sqlite3 (1.3.6)
110
- thor (0.16.0)
111
- tilt (1.3.3)
112
- treetop (1.4.12)
113
- polyglot
114
- polyglot (>= 0.3.1)
115
- tzinfo (0.3.35)
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
- guard-rspec
123
- haml
124
- highline
125
- rails
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 "rubygems"
2
- gem "highline"
1
+ require 'rspec/core/rake_task'
3
2
 
4
- desc "build and publish"
5
- task :build do
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
- //= require_directory ./plugins
2
- //= require ./extensions
3
- //= require ./defaults
4
- //= require ./functions
5
- //= require_self
6
-
7
- $(document).ready(function(){
8
-
9
- $("td.buttons a").wrapInner("<span/>");
10
-
11
- //$(".datepicker").datepicker(datepickerConfiguration);
12
-
13
- // Prevent Bug
14
- //$("div.ui-datepicker").hide();
15
-
16
- //$(".timepicker").calendricalTime(timepickerConfiguration);
17
-
18
- //$.fn.qtip.styles.single = tooltipConfiguration;
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
+ }