wheels 0.0.48 → 0.0.49
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/access_control_entries_controller.rb +4 -4
- data/app/controllers/external_links_controller.rb +5 -0
- data/app/controllers/feedbacks_controller.rb +10 -0
- data/app/controllers/menus_controller.rb +2 -0
- data/app/controllers/pages_controller.rb +16 -29
- data/app/controllers/sitemaps_controller.rb +135 -0
- data/app/helpers/application_helper.rb +4 -3
- data/app/helpers/external_links_helper.rb +2 -0
- data/app/helpers/feedbacks_helper.rb +2 -0
- data/app/helpers/menus_helper.rb +2 -0
- data/app/helpers/sitemaps_helper.rb +12 -0
- data/app/mailers/feedback_mailer.rb +10 -0
- data/app/models/ability.rb +2 -1
- data/app/models/access_control_entry.rb +17 -15
- data/app/models/external_link.rb +4 -0
- data/app/models/feedback.rb +13 -0
- data/app/models/image.rb +1 -1
- data/app/models/menu.rb +4 -0
- data/app/models/page.rb +2 -5
- data/app/models/sitemap.rb +153 -0
- data/app/models/user.rb +7 -1
- data/app/validators/email_validator.rb +22 -0
- data/app/views/access_control_entries/_form.html.haml +1 -1
- data/app/views/access_control_entries/_index.html.haml +3 -3
- data/app/views/access_control_entries/_show.html.haml +1 -1
- data/app/views/external_links/_fields_for.html.haml +2 -0
- data/app/views/external_links/_form.html.haml +18 -0
- data/app/views/external_links/_show.html.haml +7 -0
- data/app/views/external_links/edit.html.haml +7 -0
- data/app/views/external_links/index.html.haml +23 -0
- data/app/views/external_links/new.html.haml +5 -0
- data/app/views/external_links/show.html.haml +2 -0
- data/app/views/feedback_mailer/submit_feedback.html.haml +22 -0
- data/app/views/feedbacks/_form.html.haml +37 -0
- data/app/views/feedbacks/index.html.haml +27 -0
- data/app/views/feedbacks/new.html.haml +5 -0
- data/app/views/feedbacks/show.html.haml +19 -0
- data/app/views/layouts/application.html.haml +21 -16
- data/app/views/layouts/bare.html.haml +2 -0
- data/app/views/loadbehind/_view.js.haml +1 -2
- data/app/views/menus/_form.html.haml +13 -0
- data/app/views/menus/edit.html.haml +7 -0
- data/app/views/menus/index.html.haml +19 -0
- data/app/views/menus/new.html.haml +5 -0
- data/app/views/menus/show.html.haml +7 -0
- data/app/views/pages/_child_pages_links.html.haml +1 -1
- data/app/views/pages/_control_panel.html.haml +1 -6
- data/app/views/pages/_form.html.haml +2 -2
- data/app/views/pages/_form_fields.html.haml +7 -2
- data/app/views/pages/_show.html.haml +4 -0
- data/app/views/pages/create.js.haml +2 -1
- data/app/views/pages/destroy.js.haml +3 -0
- data/app/views/pages/edit.js.haml +4 -0
- data/app/views/pages/index.html.haml +4 -2
- data/app/views/pages/index.js.haml +3 -0
- data/app/views/pages/new.js.haml +3 -0
- data/app/views/pages/show.html.haml +2 -10
- data/app/views/pages/show.js.haml +3 -0
- data/app/views/pages/update.js.haml +2 -2
- data/app/views/sitemaps/edit.html.haml +12 -0
- data/app/views/sitemaps/edit.js.erb +0 -0
- data/app/views/sitemaps/index.html.haml +93 -0
- data/app/views/sitemaps/index.json.erb +23 -0
- data/app/views/sitemaps/new.html.haml +8 -0
- data/app/views/sitemaps/new.js.erb +0 -0
- data/app/views/users/edit.html.haml +45 -0
- data/db/migrate/{add_fields_to_users.rb → 0010_add_fields_to_users.rb} +0 -0
- data/db/migrate/{create_blogs.rb → 0020_create_blogs.rb} +0 -0
- data/db/migrate/{create_galleries.rb → 0030_create_galleries.rb} +0 -0
- data/db/migrate/{create_images.rb → 0040_create_images.rb} +0 -0
- data/db/migrate/{create_profiles.rb → 0050_create_profiles.rb} +0 -0
- data/db/migrate/{insert_admin_user_and_roles.rb → 0060_insert_admin_user_and_roles.rb} +0 -0
- data/db/migrate/{create_pages.rb → 0070_create_pages.rb} +0 -0
- data/db/migrate/{create_forums.rb → 0080_create_forums.rb} +0 -0
- data/db/migrate/{create_discussions.rb → 0090_create_discussions.rb} +0 -0
- data/db/migrate/{create_forum_messages.rb → 0100_create_forum_messages.rb} +0 -0
- data/db/migrate/{create_access_control_entries.rb → 0110_create_access_control_entries.rb} +3 -3
- data/db/migrate/{create_attachments.rb → 0120_create_attachments.rb} +0 -4
- data/db/migrate/{create_roles.rb → 0130_create_roles.rb} +0 -0
- data/db/migrate/0140_create_feedbacks.rb +20 -0
- data/db/migrate/0150_create_external_links.rb +14 -0
- data/db/migrate/0160_create_sitemaps.rb +17 -0
- data/db/migrate/0170_create_menus.rb +14 -0
- data/lib/development_mail_interceptor.rb +7 -0
- data/lib/generators/wheels/recipes/wheels.rb +18 -12
- data/lib/wheels/base.rb +7 -0
- data/lib/wheels/routes.rb +8 -3
- data/lib/wheels.rb +2 -0
- data/public/javascripts/jquery-validate/additional-methods.js +259 -0
- data/public/javascripts/jquery-validate/changelog.txt +239 -0
- data/public/javascripts/jquery-validate/jquery.validate.js +1146 -0
- data/public/javascripts/jquery-validate/jquery.validate.min.js +16 -0
- data/public/javascripts/jquery-validate/jquery.validate.pack.js +15 -0
- data/public/javascripts/jquery-validate/lib/jquery-1.4.2.js +6240 -0
- data/public/javascripts/jquery-validate/lib/jquery.form.js +660 -0
- data/public/javascripts/jquery-validate/lib/jquery.js +4376 -0
- data/public/javascripts/jquery-validate/lib/jquery.metadata.js +122 -0
- data/public/javascripts/jquery-validate/localization/messages_ar.js +24 -0
- data/public/javascripts/jquery-validate/localization/messages_bg.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_cn.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_cs.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_da.js +20 -0
- data/public/javascripts/jquery-validate/localization/messages_de.js +20 -0
- data/public/javascripts/jquery-validate/localization/messages_el.js +24 -0
- data/public/javascripts/jquery-validate/localization/messages_es.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_fa.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_fi.js +21 -0
- data/public/javascripts/jquery-validate/localization/messages_fr.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_he.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_hu.js +20 -0
- data/public/javascripts/jquery-validate/localization/messages_it.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_kk.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_lt.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_lv.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_nl.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_no.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_pl.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ptbr.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ptpt.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ro.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ru.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_se.js +21 -0
- data/public/javascripts/jquery-validate/localization/messages_sk.js +20 -0
- data/public/javascripts/jquery-validate/localization/messages_tr.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_tw.js +23 -0
- data/public/javascripts/jquery-validate/localization/messages_ua.js +23 -0
- data/public/javascripts/jquery-validate/localization/methods_de.js +12 -0
- data/public/javascripts/jquery-validate/localization/methods_nl.js +9 -0
- data/public/javascripts/jquery-validate/localization/methods_pt.js +9 -0
- data/public/javascripts/jquery-validate/todo +172 -0
- data/public/javascripts/jquery.cookie.js +96 -0
- data/public/javascripts/jquery.filedrop.js +253 -0
- data/public/javascripts/jquery.hotkeys.js +99 -0
- data/public/javascripts/jquery.js +6240 -0
- data/public/javascripts/jquery.jstree.js +3510 -0
- data/public/javascripts/jquery.uploadify.js +26 -0
- data/public/javascripts/jquery.validate.js +1147 -0
- data/public/javascripts/sitemap_jstree.js +329 -0
- data/public/javascripts/swfobject.js +4 -0
- data/public/jstree/_demo/_dump.sql +20 -0
- data/public/jstree/_demo/_inc/__mysql_errors.log +0 -0
- data/public/jstree/_demo/_inc/class._database.php +146 -0
- data/public/jstree/_demo/_inc/class._database_i.php +152 -0
- data/public/jstree/_demo/_inc/class.tree.php +602 -0
- data/public/jstree/_demo/_install.txt +6 -0
- data/public/jstree/_demo/config.php +14 -0
- data/public/jstree/_demo/index.html +262 -0
- data/public/jstree/_demo/server.php +69 -0
- data/public/jstree/_docs/!style.css +37 -0
- data/public/jstree/_docs/_drive.png +0 -0
- data/public/jstree/_docs/_html_data.html +2 -0
- data/public/jstree/_docs/_json_data.json +4 -0
- data/public/jstree/_docs/_search_data.json +6 -0
- data/public/jstree/_docs/_search_result.json +1 -0
- data/public/jstree/_docs/_xml_flat.xml +12 -0
- data/public/jstree/_docs/_xml_nest.xml +18 -0
- data/public/jstree/_docs/checkbox.html +148 -0
- data/public/jstree/_docs/contextmenu.html +120 -0
- data/public/jstree/_docs/cookies.html +96 -0
- data/public/jstree/_docs/core.html +622 -0
- data/public/jstree/_docs/crrm.html +315 -0
- data/public/jstree/_docs/dnd.html +197 -0
- data/public/jstree/_docs/hotkeys.html +81 -0
- data/public/jstree/_docs/html_data.html +174 -0
- data/public/jstree/_docs/index.html +75 -0
- data/public/jstree/_docs/json_data.html +240 -0
- data/public/jstree/_docs/languages.html +138 -0
- data/public/jstree/_docs/search.html +114 -0
- data/public/jstree/_docs/sort.html +84 -0
- data/public/jstree/_docs/syntax/!script.js +2232 -0
- data/public/jstree/_docs/syntax/!style.css +511 -0
- data/public/jstree/_docs/syntax/clipboard.swf +0 -0
- data/public/jstree/_docs/syntax/help.png +0 -0
- data/public/jstree/_docs/syntax/magnifier.png +0 -0
- data/public/jstree/_docs/syntax/page_white_code.png +0 -0
- data/public/jstree/_docs/syntax/page_white_copy.png +0 -0
- data/public/jstree/_docs/syntax/printer.png +0 -0
- data/public/jstree/_docs/syntax/wrapping.png +0 -0
- data/public/jstree/_docs/themeroller.html +98 -0
- data/public/jstree/_docs/themes.html +126 -0
- data/public/jstree/_docs/types.html +173 -0
- data/public/jstree/_docs/ui.html +188 -0
- data/public/jstree/_docs/unique.html +70 -0
- data/public/jstree/_docs/xml_data.html +214 -0
- data/public/jstree/_lib/jquery.cookie.js +96 -0
- data/public/jstree/_lib/jquery.hotkeys.js +99 -0
- data/public/jstree/_lib/jquery.js +6240 -0
- data/public/jstree/jquery.jstree.js +3510 -0
- data/public/jstree/jstree.html +237 -0
- data/public/jstree/themes/apple/bg.jpg +0 -0
- data/public/jstree/themes/apple/d.png +0 -0
- data/public/jstree/themes/apple/dot_for_ie.gif +0 -0
- data/public/jstree/themes/apple/style.css +60 -0
- data/public/jstree/themes/apple/throbber.gif +0 -0
- data/public/jstree/themes/classic/d.png +0 -0
- data/public/jstree/themes/classic/dot_for_ie.gif +0 -0
- data/public/jstree/themes/classic/style.css +59 -0
- data/public/jstree/themes/classic/throbber.gif +0 -0
- data/public/jstree/themes/default/d.gif +0 -0
- data/public/jstree/themes/default/d.png +0 -0
- data/public/jstree/themes/default/style.css +73 -0
- data/public/jstree/themes/default/throbber.gif +0 -0
- data/public/jstree/themes/default-rtl/d.gif +0 -0
- data/public/jstree/themes/default-rtl/d.png +0 -0
- data/public/jstree/themes/default-rtl/dots.gif +0 -0
- data/public/jstree/themes/default-rtl/style.css +83 -0
- data/public/jstree/themes/default-rtl/throbber.gif +0 -0
- data/public/stylesheets/sass/dreamy.sass +21 -56
- data/public/stylesheets/sass/menu.sass +43 -9
- data/public/stylesheets/sass/uploadify.sass +52 -0
- data/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/stylesheets/ui-lightness/jquery-ui-1.8.4.custom.css +549 -0
- data/wheels.gemspec +187 -15
- 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.
|
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,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,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,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,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
|
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
|
9
|
-
=
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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(:
|
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
|
-
|
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,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,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
|
@@ -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(:
|
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
|
|
@@ -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 '|
|
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
|
@@ -1,20 +1,12 @@
|
|
1
|
-
|
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
|
-
=
|
9
|
+
= sidebar_content do
|
18
10
|
%ul#attachments_list
|
19
11
|
%li.sidebar_title Files
|
20
12
|
- @page.attachments.each do |attachment|
|
@@ -1,3 +1,3 @@
|
|
1
|
-
$('
|
2
|
-
|
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" : "#{"✓".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" : "#{"✓".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" : "#{"✓".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
|