wheels 0.0.48 → 0.0.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. data/VERSION +1 -1
  2. data/app/controllers/access_control_entries_controller.rb +4 -4
  3. data/app/controllers/external_links_controller.rb +5 -0
  4. data/app/controllers/feedbacks_controller.rb +10 -0
  5. data/app/controllers/menus_controller.rb +2 -0
  6. data/app/controllers/pages_controller.rb +16 -29
  7. data/app/controllers/sitemaps_controller.rb +135 -0
  8. data/app/helpers/application_helper.rb +4 -3
  9. data/app/helpers/external_links_helper.rb +2 -0
  10. data/app/helpers/feedbacks_helper.rb +2 -0
  11. data/app/helpers/menus_helper.rb +2 -0
  12. data/app/helpers/sitemaps_helper.rb +12 -0
  13. data/app/mailers/feedback_mailer.rb +10 -0
  14. data/app/models/ability.rb +2 -1
  15. data/app/models/access_control_entry.rb +17 -15
  16. data/app/models/external_link.rb +4 -0
  17. data/app/models/feedback.rb +13 -0
  18. data/app/models/image.rb +1 -1
  19. data/app/models/menu.rb +4 -0
  20. data/app/models/page.rb +2 -5
  21. data/app/models/sitemap.rb +153 -0
  22. data/app/models/user.rb +7 -1
  23. data/app/validators/email_validator.rb +22 -0
  24. data/app/views/access_control_entries/_form.html.haml +1 -1
  25. data/app/views/access_control_entries/_index.html.haml +3 -3
  26. data/app/views/access_control_entries/_show.html.haml +1 -1
  27. data/app/views/external_links/_fields_for.html.haml +2 -0
  28. data/app/views/external_links/_form.html.haml +18 -0
  29. data/app/views/external_links/_show.html.haml +7 -0
  30. data/app/views/external_links/edit.html.haml +7 -0
  31. data/app/views/external_links/index.html.haml +23 -0
  32. data/app/views/external_links/new.html.haml +5 -0
  33. data/app/views/external_links/show.html.haml +2 -0
  34. data/app/views/feedback_mailer/submit_feedback.html.haml +22 -0
  35. data/app/views/feedbacks/_form.html.haml +37 -0
  36. data/app/views/feedbacks/index.html.haml +27 -0
  37. data/app/views/feedbacks/new.html.haml +5 -0
  38. data/app/views/feedbacks/show.html.haml +19 -0
  39. data/app/views/layouts/application.html.haml +21 -16
  40. data/app/views/layouts/bare.html.haml +2 -0
  41. data/app/views/loadbehind/_view.js.haml +1 -2
  42. data/app/views/menus/_form.html.haml +13 -0
  43. data/app/views/menus/edit.html.haml +7 -0
  44. data/app/views/menus/index.html.haml +19 -0
  45. data/app/views/menus/new.html.haml +5 -0
  46. data/app/views/menus/show.html.haml +7 -0
  47. data/app/views/pages/_child_pages_links.html.haml +1 -1
  48. data/app/views/pages/_control_panel.html.haml +1 -6
  49. data/app/views/pages/_form.html.haml +2 -2
  50. data/app/views/pages/_form_fields.html.haml +7 -2
  51. data/app/views/pages/_show.html.haml +4 -0
  52. data/app/views/pages/create.js.haml +2 -1
  53. data/app/views/pages/destroy.js.haml +3 -0
  54. data/app/views/pages/edit.js.haml +4 -0
  55. data/app/views/pages/index.html.haml +4 -2
  56. data/app/views/pages/index.js.haml +3 -0
  57. data/app/views/pages/new.js.haml +3 -0
  58. data/app/views/pages/show.html.haml +2 -10
  59. data/app/views/pages/show.js.haml +3 -0
  60. data/app/views/pages/update.js.haml +2 -2
  61. data/app/views/sitemaps/edit.html.haml +12 -0
  62. data/app/views/sitemaps/edit.js.erb +0 -0
  63. data/app/views/sitemaps/index.html.haml +93 -0
  64. data/app/views/sitemaps/index.json.erb +23 -0
  65. data/app/views/sitemaps/new.html.haml +8 -0
  66. data/app/views/sitemaps/new.js.erb +0 -0
  67. data/app/views/users/edit.html.haml +45 -0
  68. data/db/migrate/{add_fields_to_users.rb → 0010_add_fields_to_users.rb} +0 -0
  69. data/db/migrate/{create_blogs.rb → 0020_create_blogs.rb} +0 -0
  70. data/db/migrate/{create_galleries.rb → 0030_create_galleries.rb} +0 -0
  71. data/db/migrate/{create_images.rb → 0040_create_images.rb} +0 -0
  72. data/db/migrate/{create_profiles.rb → 0050_create_profiles.rb} +0 -0
  73. data/db/migrate/{insert_admin_user_and_roles.rb → 0060_insert_admin_user_and_roles.rb} +0 -0
  74. data/db/migrate/{create_pages.rb → 0070_create_pages.rb} +0 -0
  75. data/db/migrate/{create_forums.rb → 0080_create_forums.rb} +0 -0
  76. data/db/migrate/{create_discussions.rb → 0090_create_discussions.rb} +0 -0
  77. data/db/migrate/{create_forum_messages.rb → 0100_create_forum_messages.rb} +0 -0
  78. data/db/migrate/{create_access_control_entries.rb → 0110_create_access_control_entries.rb} +3 -3
  79. data/db/migrate/{create_attachments.rb → 0120_create_attachments.rb} +0 -4
  80. data/db/migrate/{create_roles.rb → 0130_create_roles.rb} +0 -0
  81. data/db/migrate/0140_create_feedbacks.rb +20 -0
  82. data/db/migrate/0150_create_external_links.rb +14 -0
  83. data/db/migrate/0160_create_sitemaps.rb +17 -0
  84. data/db/migrate/0170_create_menus.rb +14 -0
  85. data/lib/development_mail_interceptor.rb +7 -0
  86. data/lib/generators/wheels/recipes/wheels.rb +18 -12
  87. data/lib/wheels/base.rb +7 -0
  88. data/lib/wheels/routes.rb +8 -3
  89. data/lib/wheels.rb +2 -0
  90. data/public/javascripts/jquery-validate/additional-methods.js +259 -0
  91. data/public/javascripts/jquery-validate/changelog.txt +239 -0
  92. data/public/javascripts/jquery-validate/jquery.validate.js +1146 -0
  93. data/public/javascripts/jquery-validate/jquery.validate.min.js +16 -0
  94. data/public/javascripts/jquery-validate/jquery.validate.pack.js +15 -0
  95. data/public/javascripts/jquery-validate/lib/jquery-1.4.2.js +6240 -0
  96. data/public/javascripts/jquery-validate/lib/jquery.form.js +660 -0
  97. data/public/javascripts/jquery-validate/lib/jquery.js +4376 -0
  98. data/public/javascripts/jquery-validate/lib/jquery.metadata.js +122 -0
  99. data/public/javascripts/jquery-validate/localization/messages_ar.js +24 -0
  100. data/public/javascripts/jquery-validate/localization/messages_bg.js +23 -0
  101. data/public/javascripts/jquery-validate/localization/messages_cn.js +23 -0
  102. data/public/javascripts/jquery-validate/localization/messages_cs.js +23 -0
  103. data/public/javascripts/jquery-validate/localization/messages_da.js +20 -0
  104. data/public/javascripts/jquery-validate/localization/messages_de.js +20 -0
  105. data/public/javascripts/jquery-validate/localization/messages_el.js +24 -0
  106. data/public/javascripts/jquery-validate/localization/messages_es.js +23 -0
  107. data/public/javascripts/jquery-validate/localization/messages_fa.js +23 -0
  108. data/public/javascripts/jquery-validate/localization/messages_fi.js +21 -0
  109. data/public/javascripts/jquery-validate/localization/messages_fr.js +23 -0
  110. data/public/javascripts/jquery-validate/localization/messages_he.js +23 -0
  111. data/public/javascripts/jquery-validate/localization/messages_hu.js +20 -0
  112. data/public/javascripts/jquery-validate/localization/messages_it.js +23 -0
  113. data/public/javascripts/jquery-validate/localization/messages_kk.js +23 -0
  114. data/public/javascripts/jquery-validate/localization/messages_lt.js +23 -0
  115. data/public/javascripts/jquery-validate/localization/messages_lv.js +23 -0
  116. data/public/javascripts/jquery-validate/localization/messages_nl.js +23 -0
  117. data/public/javascripts/jquery-validate/localization/messages_no.js +23 -0
  118. data/public/javascripts/jquery-validate/localization/messages_pl.js +23 -0
  119. data/public/javascripts/jquery-validate/localization/messages_ptbr.js +23 -0
  120. data/public/javascripts/jquery-validate/localization/messages_ptpt.js +23 -0
  121. data/public/javascripts/jquery-validate/localization/messages_ro.js +23 -0
  122. data/public/javascripts/jquery-validate/localization/messages_ru.js +23 -0
  123. data/public/javascripts/jquery-validate/localization/messages_se.js +21 -0
  124. data/public/javascripts/jquery-validate/localization/messages_sk.js +20 -0
  125. data/public/javascripts/jquery-validate/localization/messages_tr.js +23 -0
  126. data/public/javascripts/jquery-validate/localization/messages_tw.js +23 -0
  127. data/public/javascripts/jquery-validate/localization/messages_ua.js +23 -0
  128. data/public/javascripts/jquery-validate/localization/methods_de.js +12 -0
  129. data/public/javascripts/jquery-validate/localization/methods_nl.js +9 -0
  130. data/public/javascripts/jquery-validate/localization/methods_pt.js +9 -0
  131. data/public/javascripts/jquery-validate/todo +172 -0
  132. data/public/javascripts/jquery.cookie.js +96 -0
  133. data/public/javascripts/jquery.filedrop.js +253 -0
  134. data/public/javascripts/jquery.hotkeys.js +99 -0
  135. data/public/javascripts/jquery.js +6240 -0
  136. data/public/javascripts/jquery.jstree.js +3510 -0
  137. data/public/javascripts/jquery.uploadify.js +26 -0
  138. data/public/javascripts/jquery.validate.js +1147 -0
  139. data/public/javascripts/sitemap_jstree.js +329 -0
  140. data/public/javascripts/swfobject.js +4 -0
  141. data/public/jstree/_demo/_dump.sql +20 -0
  142. data/public/jstree/_demo/_inc/__mysql_errors.log +0 -0
  143. data/public/jstree/_demo/_inc/class._database.php +146 -0
  144. data/public/jstree/_demo/_inc/class._database_i.php +152 -0
  145. data/public/jstree/_demo/_inc/class.tree.php +602 -0
  146. data/public/jstree/_demo/_install.txt +6 -0
  147. data/public/jstree/_demo/config.php +14 -0
  148. data/public/jstree/_demo/index.html +262 -0
  149. data/public/jstree/_demo/server.php +69 -0
  150. data/public/jstree/_docs/!style.css +37 -0
  151. data/public/jstree/_docs/_drive.png +0 -0
  152. data/public/jstree/_docs/_html_data.html +2 -0
  153. data/public/jstree/_docs/_json_data.json +4 -0
  154. data/public/jstree/_docs/_search_data.json +6 -0
  155. data/public/jstree/_docs/_search_result.json +1 -0
  156. data/public/jstree/_docs/_xml_flat.xml +12 -0
  157. data/public/jstree/_docs/_xml_nest.xml +18 -0
  158. data/public/jstree/_docs/checkbox.html +148 -0
  159. data/public/jstree/_docs/contextmenu.html +120 -0
  160. data/public/jstree/_docs/cookies.html +96 -0
  161. data/public/jstree/_docs/core.html +622 -0
  162. data/public/jstree/_docs/crrm.html +315 -0
  163. data/public/jstree/_docs/dnd.html +197 -0
  164. data/public/jstree/_docs/hotkeys.html +81 -0
  165. data/public/jstree/_docs/html_data.html +174 -0
  166. data/public/jstree/_docs/index.html +75 -0
  167. data/public/jstree/_docs/json_data.html +240 -0
  168. data/public/jstree/_docs/languages.html +138 -0
  169. data/public/jstree/_docs/search.html +114 -0
  170. data/public/jstree/_docs/sort.html +84 -0
  171. data/public/jstree/_docs/syntax/!script.js +2232 -0
  172. data/public/jstree/_docs/syntax/!style.css +511 -0
  173. data/public/jstree/_docs/syntax/clipboard.swf +0 -0
  174. data/public/jstree/_docs/syntax/help.png +0 -0
  175. data/public/jstree/_docs/syntax/magnifier.png +0 -0
  176. data/public/jstree/_docs/syntax/page_white_code.png +0 -0
  177. data/public/jstree/_docs/syntax/page_white_copy.png +0 -0
  178. data/public/jstree/_docs/syntax/printer.png +0 -0
  179. data/public/jstree/_docs/syntax/wrapping.png +0 -0
  180. data/public/jstree/_docs/themeroller.html +98 -0
  181. data/public/jstree/_docs/themes.html +126 -0
  182. data/public/jstree/_docs/types.html +173 -0
  183. data/public/jstree/_docs/ui.html +188 -0
  184. data/public/jstree/_docs/unique.html +70 -0
  185. data/public/jstree/_docs/xml_data.html +214 -0
  186. data/public/jstree/_lib/jquery.cookie.js +96 -0
  187. data/public/jstree/_lib/jquery.hotkeys.js +99 -0
  188. data/public/jstree/_lib/jquery.js +6240 -0
  189. data/public/jstree/jquery.jstree.js +3510 -0
  190. data/public/jstree/jstree.html +237 -0
  191. data/public/jstree/themes/apple/bg.jpg +0 -0
  192. data/public/jstree/themes/apple/d.png +0 -0
  193. data/public/jstree/themes/apple/dot_for_ie.gif +0 -0
  194. data/public/jstree/themes/apple/style.css +60 -0
  195. data/public/jstree/themes/apple/throbber.gif +0 -0
  196. data/public/jstree/themes/classic/d.png +0 -0
  197. data/public/jstree/themes/classic/dot_for_ie.gif +0 -0
  198. data/public/jstree/themes/classic/style.css +59 -0
  199. data/public/jstree/themes/classic/throbber.gif +0 -0
  200. data/public/jstree/themes/default/d.gif +0 -0
  201. data/public/jstree/themes/default/d.png +0 -0
  202. data/public/jstree/themes/default/style.css +73 -0
  203. data/public/jstree/themes/default/throbber.gif +0 -0
  204. data/public/jstree/themes/default-rtl/d.gif +0 -0
  205. data/public/jstree/themes/default-rtl/d.png +0 -0
  206. data/public/jstree/themes/default-rtl/dots.gif +0 -0
  207. data/public/jstree/themes/default-rtl/style.css +83 -0
  208. data/public/jstree/themes/default-rtl/throbber.gif +0 -0
  209. data/public/stylesheets/sass/dreamy.sass +21 -56
  210. data/public/stylesheets/sass/menu.sass +43 -9
  211. data/public/stylesheets/sass/uploadify.sass +52 -0
  212. data/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  213. data/public/stylesheets/ui-lightness/jquery-ui-1.8.4.custom.css +549 -0
  214. data/wheels.gemspec +187 -15
  215. metadata +188 -16
@@ -3,7 +3,7 @@
3
3
  %li= resource.role.name if resource.role
4
4
  %li= resource.can ? "Can" : "Cannot"
5
5
  %li= resource.verb
6
- %li= resource.resource_class_name
6
+ %li= resource.resource_type
7
7
  %li= resource.options_str if resource.options_str
8
8
  - if can? :edit, resource
9
9
  %li= link_to "Edit", edit_access_control_entry_path(resource), :remote=>true
@@ -0,0 +1,2 @@
1
+ .fieldName Where does the link point to?
2
+
@@ -0,0 +1,18 @@
1
+ = form_for @external_link, :remote=>true do |f|
2
+ -if @external_link.errors.any?
3
+ #errorExplanation
4
+ %h2= "#{pluralize(@external_link.errors.count, "error")} prohibited this external_link from being saved:"
5
+ %ul
6
+ - @external_link.errors.full_messages.each do |msg|
7
+ %li= msg
8
+ .field
9
+ = f.label :url
10
+ = f.text_field :url
11
+ .field
12
+ = f.label :link_text
13
+ = f.text_area :link_text
14
+ = hidden_field_tag :container, 'content_pane'
15
+ = hidden_field_tag :ajax_function, 'html'
16
+ .actions
17
+ = f.submit 'Save', :disable_with=>"Saving..."
18
+
@@ -0,0 +1,7 @@
1
+ %p
2
+ %b Url:
3
+ = @external_link.url
4
+ %p
5
+ %b Link text:
6
+ = @external_link.link_text
7
+
@@ -0,0 +1,7 @@
1
+ %h1 Editing external_link
2
+
3
+ = render 'form'
4
+
5
+ = link_to 'Show', @external_link
6
+ \|
7
+ = link_to 'Back', external_links_path
@@ -0,0 +1,23 @@
1
+ %h1 Listing external_links
2
+
3
+ %table
4
+ %tr
5
+ %th Page
6
+ %th Url
7
+ %th Link text
8
+ %th
9
+ %th
10
+ %th
11
+
12
+ - @external_links.each do |external_link|
13
+ %tr
14
+ %td= external_link.page_id
15
+ %td= external_link.url
16
+ %td= external_link.link_text
17
+ %td= link_to 'Show', external_link
18
+ %td= link_to 'Edit', edit_external_link_path(external_link)
19
+ %td= link_to 'Destroy', external_link, :confirm => 'Are you sure?', :method => :delete
20
+
21
+ %br
22
+
23
+ = link_to 'New external_link', new_external_link_path
@@ -0,0 +1,5 @@
1
+ %h1 New external_link
2
+
3
+ = render 'form'
4
+
5
+ = link_to 'Back', external_links_path
@@ -0,0 +1,2 @@
1
+ = render :partial => "show"
2
+
@@ -0,0 +1,22 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %meta{:content=>"text/html; charset=UTF-8", "http-equiv"=>"Content-Type"}
5
+ %body
6
+ %h1 A user submitted feedback to cagym.com.
7
+ %p
8
+ %b Name:
9
+ = @feedback.name
10
+ %p
11
+ %b Phone:
12
+ = @feedback.phone
13
+ %p
14
+ %b Email:
15
+ = @feedback.email
16
+ %p
17
+ %b Message:
18
+ = @feedback.message
19
+ %p
20
+ %b Want response:
21
+ = @feedback.want_response ? "Yes" : "No"
22
+
@@ -0,0 +1,37 @@
1
+ = content_for :head do
2
+ = javascript_include_tag 'jquery-validate/jquery.validate.pack'
3
+
4
+ :javascript
5
+ $(function(){
6
+ $('form').validate();
7
+ });
8
+
9
+ = form_for @feedback do |f|
10
+ -if @feedback.errors.any?
11
+ #errorExplanation
12
+ %h2= "#{pluralize(@feedback.errors.count, "error")} prohibited this feedback from being saved:"
13
+ %ul
14
+ - @feedback.errors.full_messages.each do |msg|
15
+ %li= msg
16
+
17
+ .field
18
+ = f.label :name
19
+ = f.text_field :name
20
+ .field
21
+ = f.label :phone
22
+ = f.text_field :phone
23
+ .field
24
+ = f.label :email
25
+ = f.text_field :email
26
+ .field
27
+ = f.label :subject
28
+ = f.text_field :subject
29
+ .field
30
+ = f.label :message
31
+ = f.text_area :message
32
+ .field
33
+ = label_tag "Would you like to hear back from us?"
34
+ = f.check_box :want_response
35
+ .actions
36
+ = f.submit 'Send feedback'
37
+
@@ -0,0 +1,27 @@
1
+ %h1 Listing feedbacks
2
+
3
+ %table
4
+ %tr
5
+ %th Name
6
+ %th Phone
7
+ %th Email
8
+ %th Message
9
+ %th Want response
10
+ %th
11
+ %th
12
+ %th
13
+
14
+ - @feedbacks.each do |feedback|
15
+ %tr
16
+ %td= feedback.name
17
+ %td= feedback.phone
18
+ %td= feedback.email
19
+ %td= feedback.message
20
+ %td= feedback.want_response
21
+ %td= link_to 'Show', feedback
22
+ %td= link_to 'Edit', edit_feedback_path(feedback)
23
+ %td= link_to 'Destroy', feedback, :confirm => 'Are you sure?', :method => :delete
24
+
25
+ %br
26
+
27
+ = link_to 'New feedback', new_feedback_path
@@ -0,0 +1,5 @@
1
+ %h1 New feedback
2
+
3
+ = render 'form'
4
+
5
+ = link_to 'Back', feedbacks_path
@@ -0,0 +1,19 @@
1
+ %p
2
+ %b Name:
3
+ = @feedback.name
4
+ %p
5
+ %b Phone:
6
+ = @feedback.phone
7
+ %p
8
+ %b Email:
9
+ = @feedback.email
10
+ %p
11
+ %b Message:
12
+ = @feedback.message
13
+ %p
14
+ %b Want response:
15
+ = @feedback.want_response
16
+
17
+ = link_to 'Edit', edit_feedback_path(@feedback)
18
+ \|
19
+ = link_to 'Back', feedbacks_path
@@ -1,12 +1,13 @@
1
1
  !!! 5
2
2
  %html
3
3
  %head
4
- %title Your Awesome Web Site
4
+ %title CAGYM Web Site
5
5
  = csrf_meta_tag
6
6
  /[if lt IE 9]
7
7
  = javascript_include_tag 'html5'
8
- = javascript_include_tag :defaults, "loadbehind.js", "jquery.growl.js"
9
- = stylesheet_link_tag 'menu.css','dreamy'
8
+ = javascript_include_tag :defaults
9
+ = javascript_include_tag *%w(jquery-ui menu application)
10
+ = stylesheet_link_tag *%w(menu dreamy cagym ui-lightness/jquery-ui-1.8.4.custom)
10
11
  = yield(:head)
11
12
 
12
13
  :javascript
@@ -16,33 +17,37 @@
16
17
  %body
17
18
  #wrapper
18
19
  #header
19
- %h1 Artful Dodgin
20
20
  #menu
21
- %ul
22
- %li
23
- %a{:href => "/profile"} Profile
24
- %li
25
- %a{:href => "/blog"} Blog
26
- %li
27
- %a{:href => "/galleries"} Galleries
21
+ %ul.menu
22
+ != menu_item "Home", "/pages/Welcome"
23
+ != menu_item "About Us", "/pages/About_Us/"
24
+ != menu_item "Committees", "/pages/Committees"
25
+ != menu_item "Members", "/pages/Members"
26
+ != menu_item "Support Forum", "/forums"
27
+ != menu_item "Resources", "/pages/Resources"
28
+ != menu_item "Contact Us", "/submit_feedback"
28
29
  #sidebar
29
- #feed
30
- %a.feed-button{:href=>'/blog.xml'}
31
30
  %ul
32
- = yield(:tags)
31
+ = yield(:links)
32
+ = yield(:sidebar)
33
33
  #sidebar-bottom
34
34
  \ 
35
35
  #content
36
+ - flash.each do |key, value|
37
+ %p{:class=>key}= value
36
38
  = yield
37
39
  #footer
38
40
  #footer-valid
41
+
39
42
  %a{:href => "http://validator.w3.org/check/referer"} xhtml
40
43
  |
41
- %a{:href => "http://www.ginger-ninja.net/"} ginger ninja!
42
44
  - if user_signed_in?
43
- Hi #{link_to current_user.profile.alias, user_profile_path(current_user)}#{link_to('Logout', destroy_user_session_path)}
45
+ Logged in as #{current_user.email} | #{link_to('Logout', destroy_user_session_path)}
46
+ |
47
+ = link_to 'Change Password', '/change_password'
44
48
  - else
45
49
  = link_to('Log in', new_user_session_path)
50
+
46
51
  #copyright
47
52
  Copyright © 2010 #{link_to "Apycom jQuery Menus", "http://apycom.com/"}
48
53
 
@@ -0,0 +1,2 @@
1
+ = yield
2
+
@@ -1,5 +1,4 @@
1
- setUpDocument($('##{container}'));
2
1
  - unless flash[:notice].empty?
3
- = growl("Success", flash[:notice])
2
+ userDialog("Success", '#{flash[:notice]}');
4
3
  - flash.discard
5
4
 
@@ -0,0 +1,13 @@
1
+ = form_for @menu do |f|
2
+ -if @menu.errors.any?
3
+ #errorExplanation
4
+ %h2= "#{pluralize(@menu.errors.count, "error")} prohibited this menu from being saved:"
5
+ %ul
6
+ - @menu.errors.full_messages.each do |msg|
7
+ %li= msg
8
+
9
+ .field
10
+ = f.label :name
11
+ = f.text_field :name
12
+ .actions
13
+ = f.submit 'Save'
@@ -0,0 +1,7 @@
1
+ %h1 Editing menu
2
+
3
+ = render 'form'
4
+
5
+ = link_to 'Show', @menu
6
+ \|
7
+ = link_to 'Back', menus_path
@@ -0,0 +1,19 @@
1
+ %h1 Listing menus
2
+
3
+ %table
4
+ %tr
5
+ %th Name
6
+ %th
7
+ %th
8
+ %th
9
+
10
+ - @menus.each do |menu|
11
+ %tr
12
+ %td= menu.name
13
+ %td= link_to 'Show', menu
14
+ %td= link_to 'Edit', edit_menu_path(menu)
15
+ %td= link_to 'Destroy', menu, :confirm => 'Are you sure?', :method => :delete
16
+
17
+ %br
18
+
19
+ = link_to 'New menu', new_menu_path
@@ -0,0 +1,5 @@
1
+ %h1 New menu
2
+
3
+ = render 'form'
4
+
5
+ = link_to 'Back', menus_path
@@ -0,0 +1,7 @@
1
+ %p
2
+ %b Name:
3
+ = @menu.name
4
+
5
+ = link_to 'Edit', edit_menu_path(@menu)
6
+ \|
7
+ = link_to 'Back', menus_path
@@ -1,5 +1,5 @@
1
1
  = content_for :sidebar do
2
2
  %ul#child_pages
3
- - @children.each do |page|
3
+ - @sitemap_node.try(:each) do |page|
4
4
  %li= link_to page.title, page_child_path(page.parent_id, page.id)
5
5
 
@@ -6,14 +6,9 @@
6
6
  %li
7
7
  Upload a file to this page.
8
8
  = render :partial=>'attachments/form'
9
- %li
10
- Set an existing page as a child of current one
11
- = form_for form_object, :url=>form_url, :remote=>true do |f|
12
- = select_tag :child_id, options_for_select(to_html_options(Page.orphans))
13
- = f.submit "Add Child"
14
9
  %li
15
10
  Set permissions >>
16
- = link_to 'Edit Access', access_control_entries_path(:resource_class=>"Page", :resource_id=>@page.id), |
11
+ = link_to 'Edit Access', access_control_entries_path(:resource_type=>"Page", :resource_id=>@page.id), |
17
12
  :confirm => "Are you sure? Any unsaved changes on this page should be saved before leaving."
18
13
  %li= link_to 'New Page as child', new_page_path(:page_id=>@page.id), |
19
14
  :confirm => "Are you sure? Any unsaved changes on this page should be saved before leaving."
@@ -2,10 +2,10 @@
2
2
  = render :partial => "child_pages_links"
3
3
 
4
4
  - if params[:action]=="new"
5
- = form_for resource do |f|
5
+ = form_for resource, :remote=>true do |f|
6
6
  = render :partial => "form_fields", :locals=>{:f=>f}
7
7
  - else
8
- = form_for form_object, {:url=>form_url} do |f|
8
+ = form_for form_object, {:url=>form_url, :remote=>true} do |f|
9
9
  = render :partial => "form_fields", :locals=>{:f=>f}
10
10
 
11
11
  = content_for :head do
@@ -7,10 +7,15 @@
7
7
  .field
8
8
  = f.label :title
9
9
  = f.text_field :title
10
+ .field
11
+ .fieldName "Display Title for this page?"
12
+ = f.check_box :show_title
10
13
 
11
14
  .textarea
12
15
  = f.label :body
13
- = f.text_area :body, :class=>'ckeditor_textarea', :cols=>100
16
+ = f.text_area :body, :class=>'ckeditor_textarea', :cols=>100, :rows=>25
17
+ = hidden_field_tag :container, 'content_pane'
18
+ = hidden_field_tag :ajax_function, 'html'
14
19
  .actions
15
- = f.submit 'Save'
20
+ = f.submit 'Save', :disable_with=>"Saving..."
16
21
 
@@ -0,0 +1,4 @@
1
+ - if resource.show_title
2
+ %h1= resource.title
3
+ .page_content!= resource.body
4
+
@@ -1,2 +1,3 @@
1
- $('##child_pages').append(#{raw render_js('show_small')});
1
+ $('##{container}').#{ajax_function}(#{raw render_js('show')});
2
+ = render :partial => "loadbehind/view"
2
3
 
@@ -0,0 +1,3 @@
1
+ $('##{container}').remove;
2
+ = render :partial => "loadbehind/destroy"
3
+
@@ -0,0 +1,4 @@
1
+ if (CKEDITOR.instances['page_body']) {CKEDITOR.remove(CKEDITOR.instances['page_body'])}
2
+ $('##{container}').#{ajax_function}(#{raw render_js('form')});
3
+ $('.ckeditor_textarea').ckeditor({filebrowserBrowseUrl : '/galleries'});
4
+
@@ -2,12 +2,14 @@
2
2
 
3
3
  = content_for :links do
4
4
  - @pages.each do |page|
5
- %li
5
+ %li{:id=>page.element_id}
6
6
  = link_to page.title, page
7
7
  - if can? :edit, @page
8
8
  = link_to '| Edit', edit_page_path(page)
9
9
  - if can? :manage, @page
10
- = link_to '| Access Ctrl', access_control_entries_path(:resource_class=>"Page", :resource_id=>page.id)
10
+ = link_to '| Delete', page_path(page), :remote=>true, "data-confirm" => "Are you sure?", :method=>"delete"
11
+ - if can? :manage, @page
12
+ = link_to '| Access Ctrl', access_control_entries_path(:resource_type=>"Page", :resource_id=>page.id)
11
13
 
12
14
  - @pages.each do |page|
13
15
  %h1= link_to page.title, page
@@ -0,0 +1,3 @@
1
+ $('##{container}').#{ajax_function}(#{raw render_js('index')});
2
+ = render :partial => "loadbehind/view"
3
+
@@ -0,0 +1,3 @@
1
+ $('##{container}').#{ajax_function}(#{raw render_js('form')});
2
+ = render :partial => "loadbehind/edit"
3
+
@@ -1,20 +1,12 @@
1
- %h1= resource.title
2
- .page_content!= resource.body
3
-
1
+ = render :partial => "show"
4
2
  = render :partial => "child_pages_links"
5
3
 
6
- - if can? :manage, @page
7
- = content_for :sidebar do
8
- %ul
9
- %li.sidebar_title Manage This Page
10
- %li= link_to 'Edit', edit_page_path(@page)
11
-
12
4
  - if @parent_page
13
5
  = content_for :links do
14
6
  %li= link_to "< #{@parent_page.title}", @parent_page
15
7
 
16
8
  - unless @page.attachments.empty?
17
- = content_for :sidebar do
9
+ = sidebar_content do
18
10
  %ul#attachments_list
19
11
  %li.sidebar_title Files
20
12
  - @page.attachments.each do |attachment|
@@ -0,0 +1,3 @@
1
+ $('##{container}').#{ajax_function}(#{raw render_js('show')});
2
+ = render :partial => "loadbehind/view"
3
+
@@ -1,3 +1,3 @@
1
- $('#child_pages').append(#{raw render_js('show_small')});
2
- alert('#{raw params.inspect}');
1
+ $('##{container}').#{ajax_function}(#{raw render_js('show')});
2
+ = render :partial => "loadbehind/view"
3
3
 
@@ -0,0 +1,12 @@
1
+
2
+
3
+
4
+ #sitemap
5
+
6
+
7
+ = content_for :head do
8
+ = javascript_include_tag %(http://static.jstree.com/v.1.0rc2/jquery.cookie.js)
9
+ = javascript_include_tag %(http://static.jstree.com/v.1.0rc2/jquery.hotkeys.js)
10
+ = javascript_include_tag %(http://static.jstree.com/v.1.0rc2/jquery.jstree.js)
11
+ = javascript_include_tag %(sitemap_jstree)
12
+
File without changes
@@ -0,0 +1,93 @@
1
+ - include_ckeditor
2
+ = content_for :head do
3
+ = javascript_include_tag %w(jquery.hotkeys jquery.cookie jquery.jstree)
4
+ = javascript_include_tag %(sitemap_jstree)
5
+ :css
6
+ #sitemap, #sitemap input, .jstree-dnd-helper, #vakata-contextmenu { font-size:10px; font-family:Verdana; }
7
+ #container .sitemap { border:2; padding:0; }
8
+ #container #sitemap { opacity: opaque; width: 98%; height: 98%; overflow:auto; border:1px solid gray; }
9
+ #menub { height:30px; overflow:auto; }
10
+ #text { margin-top:1px; }
11
+ #alog { font-size:9px !important; margin:5px; border:1px solid silver; }
12
+ #content_pane {width: 100%; height: 600px; border-top: 2px; border-color: #0bba10;}
13
+ #control_panel {position: absolute; width: 125px; height: 180px;}
14
+ #control_panel_handle {width: 100%; height: 14px; background-color: #44c012;}
15
+ #container
16
+ #control_panel
17
+ #control_panel_handle
18
+ %h3 Control Panel
19
+ / the tree container (notice NOT an UL node)
20
+ #sitemap.sitemap
21
+ / JavaScript neccessary for the tree
22
+ #content_pane
23
+ :javascript
24
+ $(function () {
25
+ $('#control_panel').draggable({handle: '#control_panel_handle'}).resizable();
26
+
27
+ // Settings up the tree - using $(selector).jstree(options);
28
+ // All those configuration options are documented in the _docs folder
29
+ $.jstree._themes = '/jstree/themes/'
30
+ $("#sitemap")
31
+ .jstree(sitemapJsTreeConfig())
32
+ .bind("create.jstree", jstreeEventDeclarations()["create.jstree"])
33
+ .bind("remove.jstree", jstreeEventDeclarations()["remove.jstree"])
34
+ // { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
35
+ .bind("rename.jstree", jstreeEventDeclarations()["rename.jstree"])
36
+ .bind("select_node.jstree", jstreeEventDeclarations()["select_node.jstree"])
37
+ .bind("move_node.jstree", jstreeEventDeclarations()["move_node.jstree"]);
38
+ });
39
+ :javascript
40
+ function createSiteMap(data, callback) {
41
+ $.post(
42
+ "#{sitemaps_path(:format=>:json)}",
43
+ {
44
+ "utf8" : "#{"&#x2713;".html_safe}",
45
+ #{authenticity_token_json}
46
+ "sitemap[menu_text]" : data['menu_text'],
47
+ "sitemap[position]" : data['position'],
48
+ "sitemap[resource_type]" : data['resource_type'],
49
+ "sitemap[resource_id]" : data['resource_id'],
50
+ "sitemap[parent_id]" : data['parent_id']
51
+ },
52
+ callback
53
+ );
54
+ }
55
+
56
+ function updateSiteMap(data, callback) {
57
+ post_data = {
58
+ "utf8" : "#{"&#x2713;".html_safe}",
59
+ "format" : "json",
60
+ #{authenticity_token_json}
61
+ }
62
+ if (data['parent_id']) {post_data['parent_id'] = data['parent_id']}
63
+ if (data['menu_text']) {post_data['sitemap[menu_text]'] = data['menu_text']}
64
+ if (data['position']) {post_data['sitemap[position]'] = data['position']}
65
+ if (data['resource_id']) {post_data['sitemap[resource_id]'] = data['resource_id']}
66
+ if (data['resource_type']) {post_data['sitemap[resource_type]'] = data['resource_type']}
67
+ array_print('updateSiteMap Args', data);
68
+ array_print('updateSiteMap Data', post_data);
69
+
70
+ $.ajax({
71
+ async : false,
72
+ type: 'PUT',
73
+ url: "/sitemaps/" + data['id'].toString(),
74
+ data : post_data,
75
+ success: callback
76
+ });
77
+ }
78
+
79
+ function deleteSiteMap(node_id, callback) {
80
+ $.ajax({
81
+ async : false,
82
+ type: 'DELETE',
83
+ url: "/sitemaps/" + node_id.toString() + ".json",
84
+ data : {
85
+ "utf8" : "#{"&#x2713;".html_safe}",
86
+ #{authenticity_token_json}
87
+ },
88
+ success : callback
89
+ });
90
+ }
91
+
92
+ #dialog_form
93
+
@@ -0,0 +1,23 @@
1
+ {
2
+ data: {
3
+ title=>
4
+ }
5
+ :data=>{
6
+ :title=>self.menu_text,
7
+ :icon=>icon_name,
8
+ },
9
+ :attr=>{
10
+ :id=>"node_#{id}",
11
+ :data_resource_type => self.resource_type,
12
+ :data_resource_id => self.resource_id,
13
+ :data_edit_path =>
14
+ },
15
+ :state=>treeview_state,
16
+ :children=>children.map{|t| t.to_jstree(false)}
17
+ }
18
+
19
+ def to_jstree(root=true)
20
+ r =
21
+ root ? r.to_json : r
22
+ end
23
+
@@ -0,0 +1,8 @@
1
+ = form_for resource, :html=>{:id=>"sitemap_form"} do |f|
2
+ = f.hidden_field :resource_type
3
+ = f.hidden_field :resource_id
4
+ = f.label :menu_text
5
+ = f.text_field :menu_text
6
+ = f.fields_for :resource do |rf|
7
+ = render :partial = "#{resource.resource_type.tableize}/fields_for", :locals=>{:f=>rf}
8
+
File without changes