weeler 0.0.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.rspec +1 -1
  4. data/.travis.yml +7 -2
  5. data/CHANGELOG.md +149 -1
  6. data/LICENSE.txt +2 -2
  7. data/README.md +83 -1
  8. data/app/.DS_Store +0 -0
  9. data/app/assets/javascripts/weeler/init.js.coffee +13 -2
  10. data/app/assets/javascripts/weeler/lib/notify.js +18 -0
  11. data/app/assets/javascripts/weeler/lib/sortable.js +9 -0
  12. data/app/assets/stylesheets/weeler/init.css.erb +2 -1
  13. data/app/assets/stylesheets/weeler/style.css.scss +22 -0
  14. data/app/controllers/concerns/weeler/section_seo.rb +16 -0
  15. data/app/controllers/weeler/administration_controller.rb +11 -0
  16. data/app/controllers/weeler/application_controller.rb +5 -0
  17. data/app/controllers/weeler/base_controller.rb +16 -12
  18. data/app/controllers/weeler/configuration_controller.rb +9 -0
  19. data/app/controllers/weeler/content_controller.rb +12 -0
  20. data/app/controllers/weeler/home_controller.rb +5 -2
  21. data/app/controllers/weeler/seo_items_controller.rb +24 -0
  22. data/app/controllers/weeler/settings_controller.rb +21 -0
  23. data/app/controllers/weeler/static_sections_controller.rb +19 -0
  24. data/app/controllers/weeler/translations_controller.rb +36 -18
  25. data/app/models/concerns/weeler/seoable.rb +61 -0
  26. data/app/models/concerns/weeler/sluger.rb +32 -0
  27. data/app/models/settings.rb +2 -0
  28. data/app/models/weeler/seo.rb +9 -0
  29. data/app/views/kaminari/{_first_page.html.erb → weeler/_first_page.html.erb} +1 -1
  30. data/app/views/kaminari/{_gap.html.erb → weeler/_gap.html.erb} +1 -1
  31. data/app/views/kaminari/{_last_page.html.erb → weeler/_last_page.html.erb} +1 -1
  32. data/app/views/kaminari/{_next_page.html.erb → weeler/_next_page.html.erb} +1 -1
  33. data/app/views/kaminari/{_page.html.erb → weeler/_page.html.erb} +0 -0
  34. data/app/views/kaminari/{_paginator.html.erb → weeler/_paginator.html.erb} +1 -1
  35. data/app/views/kaminari/{_prev_page.html.erb → weeler/_prev_page.html.erb} +1 -1
  36. data/app/views/layouts/weeler/base.html.haml +22 -0
  37. data/{lib/generators/weeler/templates/views/weeler/example/index.html.erb → app/views/weeler/administration/_filter.html.haml} +0 -0
  38. data/app/views/weeler/administration/_header_row.html.haml +5 -0
  39. data/app/views/weeler/administration/_row.html.haml +5 -0
  40. data/app/views/weeler/administration/_side_navbar.html.haml +8 -0
  41. data/app/views/weeler/administration/index.html.haml +17 -0
  42. data/app/views/weeler/administration/welcome.html.haml +5 -0
  43. data/app/views/weeler/base/_flash.html.haml +3 -0
  44. data/app/views/weeler/base/_footer.html.haml +2 -0
  45. data/app/views/weeler/base/_header_navbar.html.haml +19 -0
  46. data/app/views/weeler/base/_side_navbar.html.haml +2 -0
  47. data/app/views/weeler/configuration/_side_navbar.html.haml +12 -0
  48. data/app/views/weeler/configuration/index.html.haml +3 -0
  49. data/app/views/weeler/content/_error_messages.html.haml +5 -0
  50. data/app/views/weeler/content/_form.html.haml +6 -0
  51. data/app/views/weeler/content/_list.html.haml +23 -0
  52. data/app/views/weeler/content/_object_seo.html.haml +31 -0
  53. data/app/views/weeler/content/_side_navbar.html.haml +17 -0
  54. data/app/views/weeler/content/_sortable_list.html.haml +24 -0
  55. data/app/views/weeler/content/edit.html.haml +2 -0
  56. data/app/views/weeler/content/index.html.haml +10 -0
  57. data/app/views/weeler/content/new.html.haml +2 -0
  58. data/app/views/weeler/content/welcome.html.haml +3 -0
  59. data/app/views/weeler/home/_side_navbar.html.haml +8 -0
  60. data/app/views/weeler/home/about.html.haml +15 -0
  61. data/app/views/weeler/home/index.html.haml +3 -0
  62. data/app/views/weeler/seo_items/edit.html.haml +28 -0
  63. data/app/views/weeler/seo_items/index.html.haml +15 -0
  64. data/app/views/weeler/settings/index.html.haml +19 -0
  65. data/app/views/weeler/static_sections/show.html.haml +26 -0
  66. data/app/views/weeler/translations/_form.html.haml +27 -0
  67. data/app/views/weeler/translations/_translation.html.haml +11 -0
  68. data/app/views/weeler/translations/edit.html.haml +14 -0
  69. data/app/views/weeler/translations/index.html.haml +76 -0
  70. data/app/views/weeler/translations/new.html.haml +13 -0
  71. data/lib/.DS_Store +0 -0
  72. data/lib/generators/weeler/.DS_Store +0 -0
  73. data/lib/generators/weeler/install_generator.rb +30 -26
  74. data/lib/generators/weeler/templates/assets/javascripts/weeler/app/index.js +2 -0
  75. data/lib/generators/weeler/templates/assets/stylesheets/weeler/app/index.css +4 -0
  76. data/lib/generators/weeler/templates/controllers/weeler/application_controller.rb +6 -0
  77. data/lib/generators/weeler/templates/initializers/weeler.rb +30 -2
  78. data/lib/generators/weeler/templates/migrations/create_weeler_seos.rb +14 -0
  79. data/lib/generators/weeler/templates/migrations/create_weeler_settings.rb +17 -0
  80. data/lib/generators/weeler/templates/migrations/translate_weeler_seos.rb +15 -0
  81. data/lib/generators/weeler/templates/views/weeler/.keep +0 -0
  82. data/lib/i18n/backend/weeler.rb +102 -22
  83. data/lib/i18n/backend/weeler/dedupe.rb +31 -0
  84. data/lib/i18n/backend/weeler/exporter.rb +67 -5
  85. data/lib/i18n/backend/weeler/html_checker.rb +41 -0
  86. data/lib/i18n/backend/weeler/importer.rb +30 -13
  87. data/lib/i18n/backend/weeler/translation.rb +12 -7
  88. data/lib/i18n/humanize_missing_translations.rb +1 -0
  89. data/lib/i18n/weeler.rb +8 -2
  90. data/lib/tasks/weeler.rake +8 -0
  91. data/lib/weeler.rb +80 -7
  92. data/lib/weeler/.DS_Store +0 -0
  93. data/lib/weeler/action_controller/acts/restful.rb +185 -0
  94. data/lib/weeler/action_dispatch/routing/mapper.rb +87 -0
  95. data/lib/weeler/action_view/helpers/form_helper.rb +13 -0
  96. data/lib/weeler/action_view/helpers/image_form_helper.rb +84 -0
  97. data/lib/weeler/action_view/helpers/translation_helper.rb +15 -0
  98. data/lib/weeler/deprecator.rb +9 -0
  99. data/lib/weeler/engine.rb +18 -4
  100. data/lib/weeler/version.rb +7 -1
  101. data/rspec.html +426 -147
  102. data/spec/.DS_Store +0 -0
  103. data/spec/controllers/translations_controller_spec.rb +76 -5
  104. data/spec/dummy/app/controllers/weeler/posts_controller.rb +3 -7
  105. data/spec/dummy/app/models/post.rb +17 -0
  106. data/spec/dummy/app/models/translation.rb +2 -0
  107. data/spec/dummy/config/locales/en.yml +4 -1
  108. data/spec/dummy/config/routes.rb +3 -3
  109. data/spec/dummy/db/development.sqlite3 +0 -0
  110. data/spec/dummy/db/migrate/20140123083704_create_weeler_seos.rb +14 -0
  111. data/spec/dummy/db/migrate/20140123083705_create_weeler_settings.rb +17 -0
  112. data/spec/dummy/db/migrate/{20131015144900_create_weeler_translations.rb → 20140123083706_create_weeler_translations.rb} +0 -0
  113. data/spec/dummy/db/migrate/20140123083707_translate_weeler_seos.rb +15 -0
  114. data/spec/dummy/db/migrate/20140718103237_create_posts.rb +12 -0
  115. data/spec/dummy/db/migrate/20140726151210_create_translations.rb +12 -0
  116. data/spec/dummy/db/schema.rb +59 -1
  117. data/spec/dummy/db/test.sqlite3 +0 -0
  118. data/spec/dummy/log/development.log +221 -0
  119. data/spec/factories/dummy_posts.rb +6 -0
  120. data/spec/fixtures/.DS_Store +0 -0
  121. data/spec/routing/routes_spec.rb +4 -4
  122. data/spec/spec_helper.rb +14 -3
  123. data/spec/weeler/action_controller/acts/restful_spec.rb +155 -0
  124. data/spec/weeler/action_view/helpers/form_helper_spec.rb +26 -0
  125. data/spec/weeler/action_view/helpers/translation_helper_spec.rb +16 -0
  126. data/spec/weeler/i18n/backend/weeler/dedupe_spec.rb +21 -0
  127. data/spec/weeler/i18n/backend/weeler/exporter_spec.rb +2 -4
  128. data/spec/weeler/i18n/backend/weeler/importer_spec.rb +5 -2
  129. data/spec/weeler/i18n/backend/weeler_spec.rb +121 -23
  130. data/weeler.gemspec +15 -7
  131. metadata +207 -85
  132. data/.DS_Store +0 -0
  133. data/app/assets/stylesheets/weeler/vendor/bootstrap.css +0 -6086
  134. data/app/views/layouts/weeler/base.html.erb +0 -40
  135. data/app/views/weeler/home/about.html.erb +0 -16
  136. data/app/views/weeler/home/index.html.erb +0 -4
  137. data/app/views/weeler/shared/_flash.html.erb +0 -17
  138. data/app/views/weeler/shared/_footer.html.erb +0 -3
  139. data/app/views/weeler/shared/_header_navbar.html.erb +0 -18
  140. data/app/views/weeler/shared/_side_navbar.html.erb +0 -14
  141. data/app/views/weeler/translations/_form.html.erb +0 -43
  142. data/app/views/weeler/translations/_translation.html.erb +0 -11
  143. data/app/views/weeler/translations/edit.html.erb +0 -19
  144. data/app/views/weeler/translations/index.html.erb +0 -103
  145. data/app/views/weeler/translations/new.html.erb +0 -19
  146. data/lib/generators/weeler/templates/controllers/weeler/example_controller.rb.example +0 -7
  147. data/lib/i18n/backend/weeler/exporter/active_record.rb +0 -37
  148. data/lib/i18n/backend/weeler/exporter/active_record_relation.rb +0 -38
  149. data/lib/i18n/backend/weeler/store_procs.rb +0 -39
  150. data/lib/weeler/route_mapper.rb +0 -41
  151. data/spec/dummy/db/production.sqlite3 +0 -0
  152. data/spec/dummy/log/test.log +0 -88454
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f125a52f99e3be0ecbc7bd79dcbcfd1d7a66e0d5
4
- data.tar.gz: e853a94bc834beb1c75aee9384c04d98e92c4262
3
+ metadata.gz: 1af4487ad746ad1a9edba4600540de518b902417
4
+ data.tar.gz: 4a01aa97572b6426a66802ac824f6cce32d5e566
5
5
  SHA512:
6
- metadata.gz: 6b50067fa6a4cc485e90284a7ec420650e4fa9352c97dd623693fc95495f43c71afe227a90b3acd4a89ce0de9c8ef968d04fb59a058a1287e8f4881d92a7bd88
7
- data.tar.gz: 95f657a3eb4d93311230b93da56a51b1fb98380bf36551060e0cc297d7533b67e8811d87ecefb7531403bf4c39db6702a6299a77655431341b67332074f17a2f
6
+ metadata.gz: 0f76fa7b4c441bc6ec0e2186467cfabad86cd52af8af928661893bff808f1028e63ec6a73235e07105f3daa29066bfc3d927090bbb9c906fd6be7605987941d5
7
+ data.tar.gz: 3e48a4e28d2d85db0568b0e733f2bd47a9a21025ee35d372cec66f3c7885af98d9f1d41f74153720dd63a52a55ab370854869e7b55d19288259837f836eb86f2
data/.gitignore CHANGED
@@ -15,4 +15,6 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
- .coveralls.yml
18
+ .coveralls.yml
19
+ .DS_Store
20
+ spec/dummy/log/test.log
data/.rspec CHANGED
@@ -1 +1 @@
1
- --color
1
+ --color
data/.travis.yml CHANGED
@@ -1,6 +1,11 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "1.9.3"
4
3
  - "2.0.0"
4
+ - "2.1.0"
5
+ - "2.1.1"
6
+ - "2.1.2"
7
+ - "2.1.3"
8
+ - "2.1.4"
9
+ - "2.1.5"
5
10
  # uncomment this line if your project needs to run something other than `rake`:
6
- script: bundle exec rspec spec
11
+ script: bundle exec rspec spec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,151 @@
1
+ ## 1.0.0
2
+
3
+ ### Features & Enhancements
4
+
5
+ * Refactored <tt>image_upload_field</tt>
6
+ * Tested on production apps.
7
+ * Add <tt>Weeler.translations</tt> method for accessing I18n translation model.
8
+
9
+ ### Contributors
10
+
11
+ * Arturs Braucs
12
+
13
+ ## 1.0.0.alpha3
14
+
15
+ ### Bug Fixes
16
+
17
+ * Fixed translation helper bug. No instance session (only fake one) in mailer templates.
18
+
19
+ ### Contributors
20
+
21
+ * Arturs Braucs
22
+
23
+ ## 1.0.0.alpha2
24
+
25
+ * Fixed a turbolinks bug
26
+
27
+ ### Contributors
28
+
29
+ * Artis Raugulis
30
+
31
+ ## 1.0.0.alpha1
32
+
33
+ Starting prepering for 1.0.0 version
34
+
35
+ ### Features & Enhancements
36
+ * Removed <tt>globalize_fields_for</tt> implementation
37
+ * Write tests for showint translaiton keys
38
+ * Improving documentation coverage.
39
+
40
+ ### Contributors
41
+
42
+ * Arturs Braucs
43
+
44
+ ## 0.2.5
45
+
46
+ * Option for showing translation keys, for easier translation key lookup
47
+
48
+ ### Contributors
49
+
50
+ * Arturs Braucs, Artis Raugulis
51
+
52
+ ## 0.2.4
53
+
54
+ * Fixed a bug when using two words in a model name caused a missing required param
55
+
56
+ ### Contributors
57
+
58
+ * Artis Raugulis
59
+
60
+ ## 0.2.3
61
+
62
+ * Support for multileve seo keys
63
+ * Order by in acts as restful
64
+ * Removed unused code
65
+ * Version indicator
66
+
67
+ ### Contributors
68
+
69
+ * Artis Raugulis
70
+
71
+ ## 0.2.2
72
+
73
+ ### Features & Enhancements
74
+
75
+ * 'acts_as_restful' - no more unpirmetted by default
76
+
77
+ ### Contributors
78
+
79
+ * Arturs Braucs
80
+
81
+ ## 0.2.1
82
+
83
+ ### Features & Enhancements
84
+
85
+ * Remove GlobilzeFormBuilder and add globalize_fields_for in ActionView FormBuilder. Also method is depricated and will be removed in 1.0.0 version.
86
+ * Refacture Weeler image_upload_field and add some tests.
87
+
88
+ ### Contributors
89
+
90
+ * Arturs Braucs
91
+
92
+ ## 0.2.0
93
+
94
+ ### Features & Enhancements
95
+
96
+ * Add administration section
97
+ * Refactured app section
98
+ * Create acts_as_restful
99
+ * Improve test covarage
100
+ * Refactured lib section
101
+ * Remove Newsletter section
102
+ * Weeler.menu_items -> Weeler.content_menu_items
103
+
104
+ ### Contributors
105
+
106
+ * Arturs Braucs
107
+
108
+ ## 0.1.2
109
+
110
+ ### Bug Fixes
111
+
112
+ * Fixed routing error for Rails 4.1
113
+
114
+ ### Contributors
115
+
116
+ * Arturs Braucs
117
+
118
+ ## 0.1.1
119
+
120
+ ### Features & Enhancements
121
+
122
+ * Cache weeler backend translations
123
+ * Exclude unused keys in translations
124
+ * Static sections
125
+ * SEO in seperate sections
126
+
127
+ ### Contributors
128
+
129
+ * Arturs Braucs
130
+
131
+ ## 0.1.0
132
+
133
+ ### Features & Enhancements
134
+
135
+ * Improve menu item routing. Now it is possible to add item with params, custom action or scope.
136
+ * Update menu structure. Add content and configurations section.
137
+ * Add SEO module for static and dynamic SEO content.
138
+ * Add slug generator module.
139
+ * Add dynamic sort feature.
140
+ * Add error_messages, list, sortable_list, section_seo templates (must extend content controller to use those).
141
+ * Improve install generator (add assets, migrations for SEO). Also add SEO generator.
142
+ * Append weeler assets to precompile path.
143
+ * Adds existing fallback backend translation data in database (I18n::Backend::Weeler)
144
+
145
+ ### Contributors
146
+
147
+ * Arturs Braucs
148
+
1
149
  ## 0.0.4
2
150
 
3
151
  ### Features & Enhancements
@@ -65,4 +213,4 @@ Translations not tested yet
65
213
 
66
214
  ### Contributors
67
215
 
68
- * Arturs Braucs
216
+ * Arturs Braucs
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Artūrs Braučs, Artis Raugulis
1
+ Copyright (c) 2014 Artūrs Braučs, Artis Raugulis
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -21,9 +21,91 @@ Or install it yourself as:
21
21
 
22
22
  $ gem install weeler
23
23
 
24
+
25
+ ## Setup
26
+
27
+ Run weeler generator:
28
+
29
+ $ rails g weeler:install
30
+
31
+ It will generate:
32
+ * weeler.rb setting file in config/initializers folder;
33
+ * migrations for translation, settings and object seos;
34
+ * application_controller.rb in weeler controller scope. It is the parent controller of all weeler controllers;
35
+ * assets in lib/assets for modify, append new javascript or style for weeler backend.
36
+
37
+ And then migrate database:
38
+
39
+ $ rake db:migrate
40
+
24
41
  ## Usage
25
42
 
26
- Documentation in progress.
43
+ ### Adding controllers and views
44
+
45
+ Create controllers and views in <tt>app/controller/weeler</tt> and <tt>app/view/weeler</tt> and then add routes in <tt>mount_weeler_at</tt> block in <tt>config/routes.rb</tt> file. There is no limitation or DCL for that. Also you need to extend at least <tt>Weeler::BaseController</tt> if you expect that weeler work as expected.
46
+
47
+ ### Menu
48
+
49
+ If you want your controller work under menu section, you should extend one of:
50
+ * <tt>Weeler::AdministrationController</tt> - for administration section;
51
+ * <tt>Weeler::ContentController</tt> - for content section;
52
+
53
+ Then you should append <tt>config.content_menu_items</tt> or <tt>config.administration_menu_items</tt> array with hash that contains: <tt>name</tt> for submenu name and <tt>weeler_path</tt> as string for relative weeler path. E.g.:
54
+
55
+ config.content_menu_items = [
56
+ {name: "Posts", weeler_path: "posts"},
57
+ {name: "Post comments", weeler_path: "comments"}
58
+ ]
59
+
60
+ ### acts_as_restful
61
+
62
+ Weeler action controller method.
63
+ It creates all restful actions for action controller. Create a controller for your
64
+ model (e.g. Post) what you want to administrate in weeler. Add method <tt>acts_as_restful Post</tt>
65
+ and permit params for your resource - option <tt>permit_params</tt>. Also you can paginate - add
66
+ option <tt>paginate</tt>
67
+ e.g.
68
+
69
+ class Weeler::PostController < Weeler::ContentController
70
+ acts_as_restful Post, permit_params: [:title, :body], paginate: 50
71
+ end
72
+
73
+ It will handle <tt>:index</tt>, <tt>:new</tt>, <tt>:edit</tt>, <tt>:update</tt>,
74
+ <tt>:destroy</tt>, <tt>:order</tt>, <tt>:activation</tt> and <tt>:remove_image</tt> actions
75
+
76
+ For permiting custom by role or permiting all params (permit!),
77
+ you must add block <tt>permit_params: -> (params) { params.require(:post).permit! }</tt>
78
+
79
+ You should implement form file with your own active record attributes.
80
+ To do that, create <tt>_form.html.haml</tt> in <tt>views/weeler/_YOUR_RESOURCE_/_form.html.haml</tt>
81
+ where <tt>_YOUR_RESOURCE_</tt> is name of your resource.
82
+
83
+ Also you can override all standart restful action view and implement, if you need,
84
+ <tt>_filter.html.haml</tt>
85
+
86
+ ### View partials for restful controllers:
87
+
88
+ Weeler have default views for index, new, edit actions. You should override <tt>_form.html.haml</tt> partial.
89
+
90
+ ### View helper image_upload_field :
91
+
92
+ Weeler action view helper method.
93
+ It creates file upload field with info and preview for image.
94
+
95
+ e.g.
96
+
97
+ <%= f.image_upload_field :image, size_info: "270x294" %>
98
+
99
+ It creates:
100
+
101
+ <div class="col-lg-10 col-md-10">
102
+ <label class="col-lg-2 col-md-2 control-label" for="object_image">Image</label><div class="col-lg-5 col-md-5"><div class="row"><div class="col-lg-12 col-md-12"><input class="form-control" id="object_image" name="object[image]" type="file"></div></div><div class="row"><div class="col-lg-12 col-md-12">Size should be 270x294</div></div></div><div class="col-lg-5 col-md-5"><div class="row"><div class="col-lg-12 col-md-12"><img alt="Name" src="/images/name.jpg" style="height: 80px;"></div></div></div>
103
+ </div>
104
+
105
+ If you use another image handler than Paperclip, you can also pass <tt>image_url_method</tt> for image preview.
106
+
107
+ Also with remove_image action in controller and route for that,
108
+ it removes only image from object.
27
109
 
28
110
  ## Contributing
29
111
 
data/app/.DS_Store CHANGED
Binary file
@@ -1,8 +1,19 @@
1
1
  #= require jquery
2
+ #= require jquery-ui
2
3
  #= require jquery_ujs
3
- #= require_tree "./vendor"
4
+ #= require turbolinks
5
+ #= require_tree ./vendor
6
+ #= require_tree ./lib
4
7
  #= require weeler/app
5
8
  #= require_self
6
9
 
10
+ app = {
11
+ boot: () ->
12
+ $('.weeler-file-inputs').bootstrapFileInput()
13
+ sortable.init()
14
+ $('[data-provide="rowlink"],[data-provides="rowlink"]').each () ->
15
+ $(this).rowlink($(this).data())
16
+ }
17
+
7
18
  $(document).ready () ->
8
- $('.weeler-file-inputs').bootstrapFileInput()
19
+ app.boot()
@@ -0,0 +1,18 @@
1
+ var notify = {
2
+ notice: null,
3
+ show: function(name, message) {
4
+ $(function(){
5
+ $.pnotify({
6
+ type: name, // 'notice', 'info', 'success', 'error'
7
+ title: name,
8
+ text: message,
9
+ styling: 'bootstrap',
10
+ shadow: false,
11
+ animation: 'fade',
12
+ closer: true,
13
+ history: false,
14
+ auto_display: true
15
+ })
16
+ });
17
+ }
18
+ }
@@ -0,0 +1,9 @@
1
+ var sortable = {
2
+ init: function() {
3
+ $( ".sortable" ).sortable({
4
+ update: function(event, ui){
5
+ $.post($(this).data("url"), { orders: $(this).sortable('serialize')});
6
+ }
7
+ });
8
+ }
9
+ }
@@ -1,5 +1,6 @@
1
1
  /*
2
+ *= require jquery-ui
2
3
  *= require_tree ./vendor
3
4
  *= require ./style
4
5
  *= require weeler/app
5
- */
6
+ */
@@ -56,4 +56,26 @@ footer {
56
56
  top: 0;
57
57
  width: 50%; /* 6 columns */
58
58
  }
59
+ }
60
+
61
+ /*
62
+ * List
63
+ * ----------
64
+ *
65
+ */
66
+ .sortable.list-group {
67
+ .list-group-item {
68
+ cursor: move;
69
+ min-height: 42px;
70
+ }
71
+ }
72
+
73
+ a.navbar-brand.weeler{
74
+ padding-bottom:3px;
75
+ color:#fff;
76
+ }
77
+ span.weeler_version{
78
+ vertical-align: super;
79
+ font-size:10px;
80
+ color:#C2C2C2;
59
81
  }
@@ -0,0 +1,16 @@
1
+ module Weeler
2
+ module SectionSeo
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ before_filter :initialize_seo_for_section
7
+ end
8
+
9
+ private
10
+
11
+ def initialize_seo_for_section
12
+ @seo = Weeler::Seo.find_or_create_by section: controller_name
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ module Weeler
2
+ class AdministrationController < ContentController
3
+ def index
4
+ render :welcome
5
+ end
6
+ private
7
+ def set_current_menu_item
8
+ @current_menu_item = "administration"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Weeler
2
+ class ApplicationController < ::ApplicationController
3
+ # Should override in application
4
+ end
5
+ end
@@ -1,16 +1,20 @@
1
- module Weeler
2
- class BaseController < ApplicationController
3
- before_filter :set_current_menu_item
4
- before_filter :run_weeler_required_user_method
1
+ class Weeler::BaseController < Weeler::ApplicationController
2
+ before_filter :set_current_menu_item
3
+ before_filter :run_weeler_required_user_method
5
4
 
6
- private
5
+ protected
7
6
 
8
- def set_current_menu_item
9
- @current_menu_item = "home"
10
- end
7
+ def default_url_options(options={})
8
+ {}
9
+ end
10
+
11
+ private
12
+
13
+ def set_current_menu_item
14
+ @current_menu_item = "content"
15
+ end
11
16
 
12
- def run_weeler_required_user_method
13
- eval(Weeler.required_user_method.to_s) if Weeler.required_user_method.present?
14
- end
17
+ def run_weeler_required_user_method
18
+ eval(Weeler.required_user_method.to_s) if Weeler.required_user_method.present?
15
19
  end
16
- end
20
+ end