refinerycms-page-menus 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/app/assets/javascripts/refinery/backend.js.coffee +24 -0
  2. data/app/assets/stylesheets/refinery/select_form.css.scss +182 -0
  3. data/app/controllers/refinery/admin/page_menus_controller.rb +57 -1
  4. data/app/controllers/refinery/admin/page_positions_controller.rb +19 -39
  5. data/app/helpers/refinery/page_positions_helper.rb +66 -0
  6. data/app/models/refinery/page_menu.rb +3 -15
  7. data/app/models/refinery/page_position.rb +87 -15
  8. data/app/views/refinery/admin/page_menus/_form.html.erb +27 -35
  9. data/app/views/refinery/admin/page_menus/_form_actions.html.erb +23 -0
  10. data/app/views/refinery/admin/page_menus/_page_menu.html.erb +16 -0
  11. data/app/views/refinery/admin/page_menus/_page_menus.html.erb +2 -0
  12. data/app/views/refinery/admin/page_menus/_records.html.erb +18 -0
  13. data/app/views/refinery/admin/page_menus/_sortable_list.html.erb +5 -0
  14. data/app/views/refinery/admin/page_menus/edit.html.erb +12 -1
  15. data/app/views/refinery/admin/page_menus/index.html.erb +3 -0
  16. data/app/views/refinery/admin/page_positions/_custom_link.html.erb +14 -0
  17. data/app/views/refinery/admin/page_positions/_page_position.html.erb +25 -48
  18. data/app/views/refinery/admin/page_positions/_resource_link.html.erb +14 -0
  19. data/app/views/refinery/admin/page_positions/_resource_link_editor_box.html.erb +21 -0
  20. data/app/views/refinery/admin/page_positions/create.js.erb +5 -0
  21. data/app/views/refinery/admin/page_positions/destroy.js.erb +3 -0
  22. data/config/locales/da.yml +9 -5
  23. data/config/locales/en.yml +25 -82
  24. data/config/locales/fr.yml +37 -0
  25. data/config/routes.rb +15 -4
  26. data/db/migrate/{20120406121839_create_page_menus.rb → 01_create_page_menus.rb} +0 -0
  27. data/db/migrate/{20120411133453_add_permatitle_to_page_menus.rb → 02_add_permatitle_to_page_menus.rb} +0 -0
  28. data/db/migrate/{20120411134419_add_menu_match_to_page_positions.rb → 03_add_menu_match_to_page_positions.rb} +0 -0
  29. data/db/migrate/04_add_flex_fields_to_page_positions.rb +9 -0
  30. data/db/migrate/05_remove_refinery_page_id_from_refinery_page_positions.rb +9 -0
  31. data/db/seeds.rb +18 -0
  32. data/lib/generators/refinery/page_menus/page_menus_generator.rb +12 -2
  33. data/lib/generators/refinery/page_menus/templates/config/initializers/refinery/page_menus.rb.erb +11 -0
  34. data/lib/refinery/page_menus/configuration.rb +24 -3
  35. data/lib/refinery/page_menus/controller_extension.rb +7 -3
  36. data/lib/refinery/page_menus/engine.rb +9 -9
  37. data/lib/refinery/page_menus/instance_methods.rb +1 -1
  38. data/lib/refinery/page_menus/version.rb +18 -0
  39. data/lib/refinery/page_menus.rb +1 -2
  40. data/readme.md +66 -1
  41. metadata +91 -52
  42. data/.gitignore +0 -2
  43. data/app/views/refinery/admin/page_positions/_actions.html.erb +0 -45
  44. data/app/views/refinery/admin/page_positions/_records.html.erb +0 -14
  45. data/app/views/refinery/admin/page_positions/_sortable_list.html.erb +0 -4
  46. data/app/views/refinery/admin/page_positions/index.html.erb +0 -11
  47. data/app/views/refinery/admin/pages/_actions.html.erb +0 -40
  48. data/app/views/refinery/admin/pages/_list_actions.html.erb +0 -28
  49. data/app/views/refinery/admin/pages/_list_page.html.erb +0 -46
  50. data/app/views/refinery/admin/pages/_list_records.html.erb +0 -16
  51. data/app/views/refinery/admin/pages/list.html.erb +0 -8
  52. data/app/views/refinery/admin/pages_shared/_submenu.html.erb +0 -65
  53. data/lib/refinery/page_menus/model_extension.rb +0 -14
  54. data/license.md +0 -21
  55. data/refinerycms-page-menus.gemspec +0 -25
  56. data/spec/factories/pages.rb +0 -5
  57. data/spec/helpers/refinery/pages/content_pages_helper_spec.rb +0 -44
  58. data/spec/lib/generators/refinery/pages/pages_generator_spec.rb +0 -29
  59. data/spec/lib/pages/content_page_presenter_spec.rb +0 -43
  60. data/spec/lib/pages/content_presenter_spec.rb +0 -111
  61. data/spec/lib/pages/page_part_section_presenter_spec.rb +0 -35
  62. data/spec/lib/pages/section_presenter_spec.rb +0 -86
  63. data/spec/lib/pages/title_section_presenter_spec.rb +0 -21
  64. data/spec/lib/pages_spec.rb +0 -26
  65. data/spec/models/refinery/page_spec.rb +0 -415
  66. data/spec/requests/refinery/admin/pages_spec.rb +0 -613
  67. data/spec/requests/refinery/pages_spec.rb +0 -302
data/readme.md CHANGED
@@ -1 +1,66 @@
1
- ## Coming soon
1
+ # Page Menus Extension for Refinery CMS
2
+
3
+ ## IMPORTANT: IN DEVELOPMENT!
4
+
5
+ This extension is still in development! There is no tests yet.
6
+ Also you can't create new menus in the admin interface, you have to create them yourself.
7
+
8
+ A stable complete version will soon be released.
9
+
10
+ If you are willing to contribute please send me a mail (johan@pylonweb.dk), and follow the contribution guidelines below. Especially test would be appriciated!
11
+
12
+ ## About
13
+
14
+ Page menus allows you to create and edit several custom menus for your Refinery CMS app.
15
+
16
+ ## Requirements
17
+
18
+ * refinerycms >= 2.0.6
19
+
20
+ ## Install
21
+
22
+ Add this line to your applications `Gemfile`
23
+
24
+ ```ruby
25
+ gem 'refinerycms-page-menus', '~> 2.0.6'
26
+ ```
27
+
28
+ or for edge version
29
+
30
+ ```ruby
31
+ gem 'refinerycms-page-menus', git: 'git://github.com/pylonweb/refinerycms-page-menus.git'
32
+ ```
33
+
34
+ Next run
35
+
36
+ ```bash
37
+ bundle install
38
+ rails generate refinery:page_menus
39
+ rake db:migrate
40
+ ```
41
+
42
+ Now when you start up your Refinery application, go to the pages in your admin interface, and you should see a roll-down menu called "Menus".
43
+
44
+ ## Usage
45
+
46
+ `app/views/refinery/pages/_header.html.erb`
47
+
48
+ If you don't have this file then Refinery will be using its default. You can override this with
49
+
50
+ ```bash
51
+ rake refinery:override view=refinery/_header
52
+ ```
53
+
54
+ ```erb
55
+ == render :partial => "/refinery/menu", :locals => {
56
+ :roots => refinery_page_menu("custom_menu")
57
+ }
58
+ ```
59
+
60
+ ## Contributing
61
+
62
+ 1. Fork it
63
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
64
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
65
+ 4. Push to the branch (`git push origin my-new-feature`)
66
+ 5. Create new Pull Request
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-page-menus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,43 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-20 00:00:00.000000000Z
12
+ date: 2013-01-06 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: refinerycms-core
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.9
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.9
30
+ - !ruby/object:Gem::Dependency
31
+ name: refinerycms-pages
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.0.9
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 2.0.9
14
46
  - !ruby/object:Gem::Dependency
15
47
  name: awesome_nested_set
16
- requirement: &70203803567920 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
17
49
  none: false
18
50
  requirements:
19
51
  - - ~>
@@ -21,72 +53,91 @@ dependencies:
21
53
  version: 2.1.0
22
54
  type: :runtime
23
55
  prerelease: false
24
- version_requirements: *70203803567920
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.1.0
25
62
  - !ruby/object:Gem::Dependency
26
- name: refinerycms-pages
27
- requirement: &70203803567080 !ruby/object:Gem::Requirement
63
+ name: nokogiri
64
+ requirement: !ruby/object:Gem::Requirement
28
65
  none: false
29
66
  requirements:
30
67
  - - ~>
31
68
  - !ruby/object:Gem::Version
32
- version: 2.0.3
69
+ version: 1.5.5
33
70
  type: :runtime
34
71
  prerelease: false
35
- version_requirements: *70203803567080
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 1.5.5
78
+ - !ruby/object:Gem::Dependency
79
+ name: refinerycms-testing
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 2.0.9
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.0.9
36
94
  description: Add custom menus to pages
37
95
  email: johan@pylonweb.dk
38
96
  executables: []
39
97
  extensions: []
40
98
  extra_rdoc_files: []
41
99
  files:
42
- - .gitignore
100
+ - app/assets/javascripts/refinery/backend.js.coffee
101
+ - app/assets/stylesheets/refinery/select_form.css.scss
43
102
  - app/controllers/refinery/admin/page_menus_controller.rb
44
103
  - app/controllers/refinery/admin/page_positions_controller.rb
104
+ - app/helpers/refinery/page_positions_helper.rb
45
105
  - app/models/refinery/page_menu.rb
46
106
  - app/models/refinery/page_position.rb
47
107
  - app/views/refinery/admin/page_menus/_form.html.erb
108
+ - app/views/refinery/admin/page_menus/_form_actions.html.erb
109
+ - app/views/refinery/admin/page_menus/_page_menu.html.erb
110
+ - app/views/refinery/admin/page_menus/_page_menus.html.erb
111
+ - app/views/refinery/admin/page_menus/_records.html.erb
112
+ - app/views/refinery/admin/page_menus/_sortable_list.html.erb
48
113
  - app/views/refinery/admin/page_menus/edit.html.erb
49
- - app/views/refinery/admin/page_positions/_actions.html.erb
114
+ - app/views/refinery/admin/page_menus/index.html.erb
115
+ - app/views/refinery/admin/page_positions/_custom_link.html.erb
50
116
  - app/views/refinery/admin/page_positions/_page_position.html.erb
51
- - app/views/refinery/admin/page_positions/_records.html.erb
52
- - app/views/refinery/admin/page_positions/_sortable_list.html.erb
53
- - app/views/refinery/admin/page_positions/index.html.erb
54
- - app/views/refinery/admin/pages/_actions.html.erb
55
- - app/views/refinery/admin/pages/_list_actions.html.erb
56
- - app/views/refinery/admin/pages/_list_page.html.erb
57
- - app/views/refinery/admin/pages/_list_records.html.erb
58
- - app/views/refinery/admin/pages/list.html.erb
59
- - app/views/refinery/admin/pages_shared/_submenu.html.erb
117
+ - app/views/refinery/admin/page_positions/_resource_link.html.erb
118
+ - app/views/refinery/admin/page_positions/_resource_link_editor_box.html.erb
119
+ - app/views/refinery/admin/page_positions/create.js.erb
120
+ - app/views/refinery/admin/page_positions/destroy.js.erb
60
121
  - config/locales/da.yml
61
122
  - config/locales/en.yml
123
+ - config/locales/fr.yml
62
124
  - config/routes.rb
63
- - db/migrate/20120406121839_create_page_menus.rb
64
- - db/migrate/20120411133453_add_permatitle_to_page_menus.rb
65
- - db/migrate/20120411134419_add_menu_match_to_page_positions.rb
125
+ - db/migrate/01_create_page_menus.rb
126
+ - db/migrate/02_add_permatitle_to_page_menus.rb
127
+ - db/migrate/03_add_menu_match_to_page_positions.rb
128
+ - db/migrate/04_add_flex_fields_to_page_positions.rb
129
+ - db/migrate/05_remove_refinery_page_id_from_refinery_page_positions.rb
130
+ - db/seeds.rb
66
131
  - lib/generators/refinery/page_menus/page_menus_generator.rb
67
132
  - lib/generators/refinery/page_menus/templates/config/initializers/refinery/page_menus.rb.erb
68
- - lib/refinery/page_menus.rb
69
133
  - lib/refinery/page_menus/configuration.rb
70
134
  - lib/refinery/page_menus/controller_extension.rb
71
135
  - lib/refinery/page_menus/engine.rb
72
136
  - lib/refinery/page_menus/instance_methods.rb
73
- - lib/refinery/page_menus/model_extension.rb
137
+ - lib/refinery/page_menus/version.rb
138
+ - lib/refinery/page_menus.rb
74
139
  - lib/refinerycms-page-menus.rb
75
- - license.md
76
140
  - readme.md
77
- - refinerycms-page-menus.gemspec
78
- - spec/factories/pages.rb
79
- - spec/helpers/refinery/pages/content_pages_helper_spec.rb
80
- - spec/lib/generators/refinery/pages/pages_generator_spec.rb
81
- - spec/lib/pages/content_page_presenter_spec.rb
82
- - spec/lib/pages/content_presenter_spec.rb
83
- - spec/lib/pages/page_part_section_presenter_spec.rb
84
- - spec/lib/pages/section_presenter_spec.rb
85
- - spec/lib/pages/title_section_presenter_spec.rb
86
- - spec/lib/pages_spec.rb
87
- - spec/models/refinery/page_spec.rb
88
- - spec/requests/refinery/admin/pages_spec.rb
89
- - spec/requests/refinery/pages_spec.rb
90
141
  homepage: http://github.com/pylonweb/refinerycms-page-menus
91
142
  licenses:
92
143
  - MIT
@@ -108,20 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
159
  version: '0'
109
160
  requirements: []
110
161
  rubyforge_project:
111
- rubygems_version: 1.8.10
162
+ rubygems_version: 1.8.23
112
163
  signing_key:
113
164
  specification_version: 3
114
165
  summary: Pages Menus extension for Refinery CMS
115
- test_files:
116
- - spec/factories/pages.rb
117
- - spec/helpers/refinery/pages/content_pages_helper_spec.rb
118
- - spec/lib/generators/refinery/pages/pages_generator_spec.rb
119
- - spec/lib/pages/content_page_presenter_spec.rb
120
- - spec/lib/pages/content_presenter_spec.rb
121
- - spec/lib/pages/page_part_section_presenter_spec.rb
122
- - spec/lib/pages/section_presenter_spec.rb
123
- - spec/lib/pages/title_section_presenter_spec.rb
124
- - spec/lib/pages_spec.rb
125
- - spec/models/refinery/page_spec.rb
126
- - spec/requests/refinery/admin/pages_spec.rb
127
- - spec/requests/refinery/pages_spec.rb
166
+ test_files: []
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- Gemfile.lock
2
- spec/dummy/
@@ -1,45 +0,0 @@
1
- <ul>
2
- <li>
3
- <%= render '/refinery/admin/search', :url => refinery.admin_pages_path %>
4
- </li>
5
-
6
- <li>
7
- <%= link_to t('menus.edit', :scope => 'refinery.admin.pages.actions'), refinery.edit_admin_page_menu_path(@page_menu),
8
- :class => "add_icon" %>
9
- </li>
10
-
11
- <li>
12
- <%= link_to t('reorder_pages', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_path,
13
- :id => "reorder_action",
14
- :class => "reorder_icon" %>
15
-
16
- <%= link_to t('reorder_pages_done', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_path,
17
- :id => "reorder_action_done",
18
- :style => "display: none;",
19
- :class => "reorder_icon" %>
20
- </li>
21
-
22
- <li>
23
- <%= link_to t('pages.manage', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_path,
24
- :class => "folder_icon" %>
25
- </li>
26
-
27
- <ul class='collapsible_menu'>
28
- <li class='not_a_link'>
29
- <%= link_to t('menus.title', :scope => 'refinery.admin.pages.actions'), "#",
30
- :class => "folder_icon" %>
31
- </li>
32
-
33
- <li>
34
- <%= link_to t('menus.main', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_main_menu_path,
35
- :class => "folder_icon" %>
36
- </li>
37
-
38
- <% (@page_menus - [@page_menu]).each do |menu| %>
39
- <li>
40
- <%= link_to menu.title, refinery.admin_page_menu_page_positions_path(menu),
41
- :class => "folder_icon" %>
42
- </li>
43
- <% end %>
44
- </ul>
45
- </ul>
@@ -1,14 +0,0 @@
1
- <% if searching? %>
2
- <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
3
- <% end %>
4
- <% if @page_positions.any? %>
5
- <%= render 'sortable_list' %>
6
- <% else %>
7
- <p>
8
- <% unless searching? %>
9
- <strong><%=t('.no_pages_yet')%></strong>
10
- <% else %>
11
- <%= t('no_results', :scope => 'refinery.admin.search') %>
12
- <% end %>
13
- </p>
14
- <% end %>
@@ -1,4 +0,0 @@
1
- <ul id='sortable_list'>
2
- <%= render :partial => 'page_position', :collection => @page_positions.select{|p| p.parent_id.nil?} %>
3
- </ul>
4
- <%= render '/refinery/admin/sortable_list', :continue_reordering => !!local_assigns[:continue_reordering] %>
@@ -1,11 +0,0 @@
1
- <h2><%= @page_menu.title %></h2>
2
-
3
- <section id='records' class='tree'>
4
- <% cache_if(Refinery::Pages.cache_pages_backend, [Refinery::Core.base_cache_key, "pages_backend", Globalize.locale].join('_')) do %>
5
- <%= render 'records' %>
6
- <% end %>
7
- </section>
8
- <section id='actions'>
9
- <%= render 'actions' %>
10
- </section>
11
- <%= render '/refinery/admin/make_sortable', :tree => true if @page_positions.many? -%>
@@ -1,40 +0,0 @@
1
- <ul>
2
- <li>
3
- <%= render '/refinery/admin/search', :url => refinery.admin_pages_path %>
4
- </li>
5
- <li>
6
- <%= link_to t('.create_new_page'), refinery.new_admin_page_path,
7
- :class => "add_icon" %>
8
- </li>
9
- <% if @pages.many? and !searching? %>
10
- <li>
11
- <%= link_to t('.reorder_pages'), refinery.admin_pages_path,
12
- :id => "reorder_action",
13
- :class => "reorder_icon" %>
14
-
15
- <%= link_to t('.reorder_pages_done'), refinery.admin_pages_path,
16
- :id => "reorder_action_done",
17
- :style => "display: none;",
18
- :class => "reorder_icon" %>
19
- </li>
20
- <% end %>
21
-
22
- <li>
23
- <%= link_to t('.pages.manage'), refinery.admin_pages_path,
24
- :class => "folder_icon" %>
25
- </li>
26
-
27
- <ul class='collapsible_menu'>
28
- <li class='not_a_link'>
29
- <%= link_to t('.menus.title'), "#",
30
- :class => "folder_icon" %>
31
- </li>
32
-
33
- <% @page_menus.each do |menu| %>
34
- <li>
35
- <%= link_to menu.title, refinery.admin_page_menu_page_positions_path(menu),
36
- :class => "folder_icon" %>
37
- </li>
38
- <% end %>
39
- </ul>
40
- </ul>
@@ -1,28 +0,0 @@
1
- <ul>
2
- <li>
3
- <%= render '/refinery/admin/search', :url => refinery.admin_pages_path %>
4
- </li>
5
- <li>
6
- <%= link_to t('create_new_page', :scope => "refinery.admin.pages.actions"), refinery.new_admin_page_path,
7
- :class => "add_icon" %>
8
- </li>
9
-
10
- <ul class='collapsible_menu'>
11
- <li class='not_a_link'>
12
- <%= link_to t('menus.title', :scope => "refinery.admin.pages.actions"), "#",
13
- :class => "folder_icon" %>
14
- </li>
15
-
16
- <li>
17
- <%= link_to t('menus.main', :scope => "refinery.admin.pages.actions"), refinery.admin_pages_main_menu_path,
18
- :class => "folder_icon" %>
19
- </li>
20
-
21
- <% @page_menus.each do |menu| %>
22
- <li>
23
- <%= link_to menu.title, refinery.admin_page_menu_page_positions_path(menu),
24
- :class => "folder_icon" %>
25
- </li>
26
- <% end %>
27
- </ul>
28
- </ul>
@@ -1,46 +0,0 @@
1
- <% page = list_page %>
2
- <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(page) -%>">
3
- <div class='clearfix'>
4
- <% if page.children.present? %>
5
- <span class="icon toggle <%= 'expanded' if Refinery::Pages.auto_expand_admin_tree %>" title="<%= t('expand_collapse', :scope => 'refinery.admin.pages') %>"></span>
6
- <% else %>
7
- <span class="icon"></span>
8
- <% end %>
9
-
10
- <span class='title <%= 'toggle' if page.children.present? %>'>
11
- <%= page.title_with_meta.html_safe %>
12
- <% if Refinery.i18n_enabled? and Refinery::I18n.frontend_locales.many? %>
13
- <span class='preview'>
14
- <% page.translations.each do |translation| %>
15
- <% if translation.title.present? %>
16
- <%= link_to refinery_icon_tag("flags/#{translation.locale}.png", :size => '16x11'),
17
- refinery.edit_admin_page_path(page, :switch_locale => translation.locale),
18
- :class => 'locale' %>
19
- <% end %>
20
- <% end %>
21
- </span>
22
- <% end %>
23
- </span>
24
-
25
- <span class='actions'>
26
- <%= link_to refinery_icon_tag('application_go.png'),
27
- refinery.page_path(page),
28
- :target => "_blank",
29
- :title => t('.view_live_html') %>
30
- <%= link_to refinery_icon_tag('page_add.png'),
31
- refinery.new_admin_page_path(:parent_id => page.id),
32
- :title => t('new', :scope => 'refinery.admin.pages') %>
33
-
34
- <%= link_to refinery_icon_tag('application_edit.png'),
35
- refinery.edit_admin_page_path(page.uncached_nested_url),
36
- :title => t('edit', :scope => 'refinery.admin.pages') %>
37
-
38
- <%= link_to refinery_icon_tag('delete.png'),
39
- refinery.admin_page_path(page.uncached_nested_url),
40
- :class => "cancel confirm-delete",
41
- :title => t('delete', :scope => 'refinery.admin.pages'),
42
- :confirm => t('message', :scope => 'refinery.admin.delete', :title => page.title_with_meta.gsub(/\ ?<em>.*<\/em>/, "")),
43
- :method => :delete if page.deletable? %>
44
- </span>
45
- </div>
46
- </li>
@@ -1,16 +0,0 @@
1
- <% if searching? %>
2
- <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
3
- <% end %>
4
- <% if @pages.any? %>
5
- <ul id='sortable_list'>
6
- <%= render :partial => 'list_page', :collection => @pages %>
7
- </ul>
8
- <% else %>
9
- <p>
10
- <% unless searching? %>
11
- <strong><%=t('.no_pages_yet')%></strong>
12
- <% else %>
13
- <%= t('no_results', :scope => 'refinery.admin.search') %>
14
- <% end %>
15
- </p>
16
- <% end %>
@@ -1,8 +0,0 @@
1
- <section id='records'>
2
- <% cache_if(Refinery::Pages.cache_pages_backend, [Refinery::Core.base_cache_key, "pages_backend", Globalize.locale].join('_')) do %>
3
- <%= render 'list_records' %>
4
- <% end %>
5
- </section>
6
- <section id='actions'>
7
- <%= render 'list_actions' %>
8
- </section>
@@ -1,65 +0,0 @@
1
- <section id="actions">
2
- <ul>
3
- <li>
4
- <%= render '/refinery/admin/search', :url => refinery.admin_pages_path %>
5
- </li>
6
-
7
- <li>
8
- <% if @page_menu && type == "page" %>
9
- <%= link_to t('menus.edit', :scope => 'refinery.admin.pages.actions'), refinery.edit_admin_page_menu_path(@page_menu),
10
- :class => "add_icon" %>
11
- <% elsif type == "page" %>
12
- <%= link_to t('pages.create_new', :scope => 'refinery.admin.pages.actions'), refinery.new_admin_page_path,
13
- :class => "add_icon" %>
14
- <%# else %>
15
- <%#= link_to t('menus.create_new', :scope => 'refinery.admin.pages.actions'), refinery.new_admin_page_menu_path,
16
- :class => "add_icon" %>
17
- <% end %>
18
- </li>
19
-
20
- <% if type == "page" && @pages.many? && !searching? %>
21
- <li>
22
- <%= link_to t('reorder_pages', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_path,
23
- :id => "reorder_action",
24
- :class => "reorder_icon" %>
25
-
26
- <%= link_to t('reorder_pages_done', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_path,
27
- :id => "reorder_action_done",
28
- :style => "display: none;",
29
- :class => "reorder_icon" %>
30
- </li>
31
- <% elsif type == "page_position" && @page_positions.many? && !searching? %>
32
- <li>
33
- <%= link_to t('reorder_pages', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_path,
34
- :id => "reorder_action",
35
- :class => "reorder_icon" %>
36
-
37
- <%= link_to t('reorder_pages_done', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_path,
38
- :id => "reorder_action_done",
39
- :style => "display: none;",
40
- :class => "reorder_icon" %>
41
- </li>
42
- <% end %>
43
-
44
- <% if @page_menu %>
45
- <li>
46
- <%= link_to t('pages.manage', :scope => 'refinery.admin.pages.actions'), refinery.admin_pages_path,
47
- :class => "folder_icon" %>
48
- </li>
49
- <% end %>
50
-
51
- <ul class='collapsible_menu'>
52
- <li class='not_a_link'>
53
- <%= link_to t('menus.title', :scope => 'refinery.admin.pages.actions'), "#",
54
- :class => "folder_icon" %>
55
- </li>
56
-
57
- <% @page_menus.each do |menu| %>
58
- <li>
59
- <%= link_to menu.title, refinery.admin_page_menu_page_positions_path(menu),
60
- :class => "folder_icon" %>
61
- </li>
62
- <% end %>
63
- </ul>
64
- </ul>
65
- </section>
@@ -1,14 +0,0 @@
1
- module Refinery
2
- module PageMenus
3
- module ModelExtension
4
-
5
- def has_many_page_menus
6
- has_many :positions, :class_name => '::Refinery::PagePosition', :foreign_key => :refinery_page_id, :dependent => :destroy
7
- has_many :menus, :through => :positions, :class_name => '::Refinery::PageMenu', :foreign_key => :refinery_menu_id
8
- end
9
-
10
- end
11
- end
12
- end
13
-
14
- ActiveRecord::Base.send(:extend, Refinery::PageMenus::ModelExtension)
data/license.md DELETED
@@ -1,21 +0,0 @@
1
- # MIT License
2
-
3
- Copyright (c) 2005-2012 [Pylonweb](http://pylonweb.dk)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,25 +0,0 @@
1
- # Encoding: UTF-8
2
- # $:.push File.expand_path('../../core/lib', __FILE__)
3
- # require 'refinery/version'
4
- #
5
- # version = Refinery::Version.to_s
6
-
7
- Gem::Specification.new do |s|
8
- s.platform = Gem::Platform::RUBY
9
- s.name = %q{refinerycms-page-menus}
10
- s.version = '2.0.3'
11
- s.summary = %q{Pages Menus extension for Refinery CMS}
12
- s.description = %q{Add custom menus to pages}
13
- s.date = Date.today.strftime("%Y-%m-%d")
14
- s.email = %q{johan@pylonweb.dk}
15
- s.homepage = %q{http://github.com/pylonweb/refinerycms-page-menus}
16
- s.authors = ['Johan Frølich']
17
- s.license = %q{MIT}
18
- s.require_paths = %w(lib)
19
-
20
- s.files = `git ls-files`.split("\n")
21
- s.test_files = `git ls-files -- spec/*`.split("\n")
22
-
23
- s.add_dependency 'awesome_nested_set', '~> 2.1.0'
24
- s.add_dependency 'refinerycms-pages', '~> 2.0.3'
25
- end
@@ -1,5 +0,0 @@
1
- # FactoryGirl.define do
2
- # factory :page, :class => Refinery::Page do
3
- # title "Test title"
4
- # end
5
- # end