humpyard 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +28 -0
- data/README.rdoc +61 -0
- data/VERSION +1 -0
- data/app/controllers/humpyard/assets_controller.rb +123 -0
- data/app/controllers/humpyard/elements_controller.rb +200 -0
- data/app/controllers/humpyard/errors_controller.rb +8 -0
- data/app/controllers/humpyard/pages_controller.rb +365 -0
- data/app/helpers/humpyard/pages_helper.rb +19 -0
- data/app/models/humpyard/asset.rb +22 -0
- data/app/models/humpyard/assets/paperclip_asset.rb +48 -0
- data/app/models/humpyard/assets/youtube_asset.rb +38 -0
- data/app/models/humpyard/element.rb +57 -0
- data/app/models/humpyard/elements/box_element.rb +15 -0
- data/app/models/humpyard/elements/media_element.rb +13 -0
- data/app/models/humpyard/elements/news_element.rb +13 -0
- data/app/models/humpyard/elements/sitemap_element.rb +11 -0
- data/app/models/humpyard/elements/text_element.rb +49 -0
- data/app/models/humpyard/news_item.rb +42 -0
- data/app/models/humpyard/page.rb +153 -0
- data/app/models/humpyard/pages/news_page.rb +71 -0
- data/app/models/humpyard/pages/static_page.rb +25 -0
- data/app/models/humpyard/pages/virtual_page.rb +30 -0
- data/app/views/humpyard/assets/_edit.html.haml +15 -0
- data/app/views/humpyard/assets/_index.html.haml +24 -0
- data/app/views/humpyard/assets/_list.html.haml +4 -0
- data/app/views/humpyard/assets/_list_item.html.haml +1 -0
- data/app/views/humpyard/assets/_show.html.haml +38 -0
- data/app/views/humpyard/assets/_show_asset.html.haml +3 -0
- data/app/views/humpyard/assets/destroy.js.erb +4 -0
- data/app/views/humpyard/assets/paperclip_assets/_edit.html.haml +4 -0
- data/app/views/humpyard/assets/paperclip_assets/_info_table.html.haml +10 -0
- data/app/views/humpyard/assets/paperclip_assets/_show.html.haml +12 -0
- data/app/views/humpyard/assets/youtube_assets/_edit.html.haml +4 -0
- data/app/views/humpyard/assets/youtube_assets/_show.html.haml +5 -0
- data/app/views/humpyard/common/_head.html.haml +8 -0
- data/app/views/humpyard/common/_page_construct.html.haml +45 -0
- data/app/views/humpyard/elements/_edit.html.haml +25 -0
- data/app/views/humpyard/elements/_inline_edit.haml +0 -0
- data/app/views/humpyard/elements/_new.html.haml +1 -0
- data/app/views/humpyard/elements/_show.html.haml +29 -0
- data/app/views/humpyard/elements/_show_container.html.haml +3 -0
- data/app/views/humpyard/elements/_show_view.html.haml +2 -0
- data/app/views/humpyard/elements/box_elements/_edit.html.haml +4 -0
- data/app/views/humpyard/elements/box_elements/_inline_edit.html.haml +0 -0
- data/app/views/humpyard/elements/box_elements/_show.html.haml +5 -0
- data/app/views/humpyard/elements/destroy.js.erb +1 -0
- data/app/views/humpyard/elements/error.js.erb +1 -0
- data/app/views/humpyard/elements/media_elements/_edit.html.haml +7 -0
- data/app/views/humpyard/elements/media_elements/_show.html.haml +8 -0
- data/app/views/humpyard/elements/news_elements/_edit.html.haml +5 -0
- data/app/views/humpyard/elements/news_elements/_inline_edit.html.haml +0 -0
- data/app/views/humpyard/elements/news_elements/_show.html.haml +4 -0
- data/app/views/humpyard/elements/sitemap_elements/_edit.html.haml +5 -0
- data/app/views/humpyard/elements/sitemap_elements/_inline_edit.html.haml +0 -0
- data/app/views/humpyard/elements/sitemap_elements/_show.html.haml +3 -0
- data/app/views/humpyard/elements/sitemap_elements/_show_part.html.haml +12 -0
- data/app/views/humpyard/elements/text_elements/_edit.html.haml +4 -0
- data/app/views/humpyard/elements/text_elements/_inline_edit.html.haml +0 -0
- data/app/views/humpyard/elements/text_elements/_show.html.haml +4 -0
- data/app/views/humpyard/pages/_content.html.haml +2 -0
- data/app/views/humpyard/pages/_edit.html.haml +39 -0
- data/app/views/humpyard/pages/_index.html.haml +23 -0
- data/app/views/humpyard/pages/_show.html.haml +16 -0
- data/app/views/humpyard/pages/_subtree.html.haml +6 -0
- data/app/views/humpyard/pages/_tree.html.haml +3 -0
- data/app/views/humpyard/pages/destroy.js.erb +4 -0
- data/app/views/humpyard/pages/news_pages/_detail.html.haml +10 -0
- data/app/views/humpyard/pages/news_pages/_edit.html.haml +3 -0
- data/app/views/humpyard/pages/news_pages/_show.html.haml +5 -0
- data/app/views/humpyard/pages/show.html.haml +3 -0
- data/app/views/humpyard/pages/static_pages/_edit.html.haml +1 -0
- data/app/views/humpyard/pages/static_pages/_show.html.haml +1 -0
- data/app/views/humpyard/pages/virtual_pages/_edit.html.haml +7 -0
- data/app/views/humpyard/pages/virtual_pages/_show.html.haml +4 -0
- data/app/views/humpyard/pages/welcome.html.haml +13 -0
- data/compass/stylesheets/_humpyard.scss +12 -0
- data/compass/stylesheets/humpyard/_backend.scss +1 -0
- data/compass/stylesheets/humpyard/_base.scss +144 -0
- data/compass/stylesheets/humpyard/_ie.scss +1 -0
- data/compass/stylesheets/humpyard/_jquery_ui_overrides.scss +380 -0
- data/compass/stylesheets/humpyard/_print.scss +3 -0
- data/config/locales/de.yml +84 -0
- data/config/locales/en.yml +81 -0
- data/config/routes.rb +38 -0
- data/db/migrate/20100321134138_base.rb +60 -0
- data/db/migrate/20100330204700_create_box_element.rb +24 -0
- data/db/migrate/20100401153655_page_template.rb +11 -0
- data/db/migrate/20100409195732_page_types.rb +26 -0
- data/db/migrate/20100413230623_element_yield.rb +14 -0
- data/db/migrate/20100415132312_news_page.rb +48 -0
- data/db/migrate/20100415193423_page_i18n_name.rb +27 -0
- data/db/migrate/20100415213700_create_news_element.rb +12 -0
- data/db/migrate/20100703120000_shared_elements.rb +9 -0
- data/db/migrate/20101001142534_page_modified_at.rb +11 -0
- data/db/migrate/20101003100138_create_sitemap_elements.rb +13 -0
- data/db/migrate/20101003122108_create_humpyard_pages_virtual_pages.rb +11 -0
- data/db/migrate/20101006070503_page_cache_control.rb +9 -0
- data/db/migrate/20101104173743_create_media.rb +36 -0
- data/db/migrate/20110425230524_media_with_link.rb +9 -0
- data/lib/generators/humpyard.rb +114 -0
- data/lib/generators/humpyard/auth/auth_generator.rb +191 -0
- data/lib/generators/humpyard/auth/templates/authlogic/README +9 -0
- data/lib/generators/humpyard/auth/templates/authlogic/controllers/user_sessions_controller.rb +22 -0
- data/lib/generators/humpyard/auth/templates/authlogic/migration.rb +17 -0
- data/lib/generators/humpyard/auth/templates/authlogic/models/ability.rb +12 -0
- data/lib/generators/humpyard/auth/templates/authlogic/models/user.rb +7 -0
- data/lib/generators/humpyard/auth/templates/authlogic/models/user_session.rb +6 -0
- data/lib/generators/humpyard/auth/templates/authlogic/views/user_sessions/new.html.haml +12 -0
- data/lib/generators/humpyard/auth/templates/custom/README +8 -0
- data/lib/generators/humpyard/auth/templates/devise/README +14 -0
- data/lib/generators/humpyard/auth/templates/devise/models/ability.rb +14 -0
- data/lib/generators/humpyard/auth/templates/fake/README +0 -0
- data/lib/generators/humpyard/auth/templates/fake/models/ability.rb +12 -0
- data/lib/generators/humpyard/auth/templates/simple/README +16 -0
- data/lib/generators/humpyard/auth/templates/simple/config/humpyard_users.yml +2 -0
- data/lib/generators/humpyard/auth/templates/simple/controllers/user_sessions_controller.rb +39 -0
- data/lib/generators/humpyard/auth/templates/simple/models/ability.rb +12 -0
- data/lib/generators/humpyard/auth/templates/simple/views/user_sessions/new.html.haml +15 -0
- data/lib/generators/humpyard/element/USAGE +7 -0
- data/lib/generators/humpyard/element/element_generator.rb +82 -0
- data/lib/generators/humpyard/element/templates/_edit.html.haml +12 -0
- data/lib/generators/humpyard/element/templates/_inline_edit.html.haml +0 -0
- data/lib/generators/humpyard/element/templates/_show.html.haml +9 -0
- data/lib/generators/humpyard/element/templates/fixtures.yml +23 -0
- data/lib/generators/humpyard/element/templates/migration.rb +16 -0
- data/lib/generators/humpyard/element/templates/model.rb +11 -0
- data/lib/generators/humpyard/element/templates/tests/rspec/model.rb +7 -0
- data/lib/generators/humpyard/element/templates/tests/shoulda/model.rb +7 -0
- data/lib/generators/humpyard/element/templates/tests/test_unit/model.rb +7 -0
- data/lib/generators/humpyard/page/USAGE +7 -0
- data/lib/generators/humpyard/page/page_generator.rb +80 -0
- data/lib/generators/humpyard/page/templates/_edit.html.haml +7 -0
- data/lib/generators/humpyard/page/templates/_show.html.haml +4 -0
- data/lib/generators/humpyard/page/templates/fixtures.yml +23 -0
- data/lib/generators/humpyard/page/templates/migration.rb +16 -0
- data/lib/generators/humpyard/page/templates/model.rb +37 -0
- data/lib/generators/humpyard/page/templates/tests/rspec/model.rb +7 -0
- data/lib/generators/humpyard/page/templates/tests/shoulda/model.rb +7 -0
- data/lib/generators/humpyard/page/templates/tests/test_unit/model.rb +7 -0
- data/lib/generators/humpyard/skeleton/USAGE +6 -0
- data/lib/generators/humpyard/skeleton/skeleton_generator.rb +99 -0
- data/lib/generators/humpyard/skeleton/templates/compass.config +14 -0
- data/lib/generators/humpyard/skeleton/templates/images/ajax-loader.gif +0 -0
- data/lib/generators/humpyard/skeleton/templates/images/grid.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/initializers/compass.rb +16 -0
- data/lib/generators/humpyard/skeleton/templates/initializers/haml.rb +3 -0
- data/lib/generators/humpyard/skeleton/templates/initializers/humpyard.rb +20 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/images/jstree/d.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/images/jstree/throbber.gif +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/javascripts/jquery-1.5.1.js +8316 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/javascripts/jquery-humpyard.js +790 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/javascripts/jquery-rails.js +157 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/javascripts/jquery-ui-1.8.10.js +11544 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/javascripts/jquery.form-2.64.js +803 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/javascripts/jquery.jstree.js +3510 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/humpyard/skeleton/templates/javascripts/jquery-ui-18/stylesheets/smoothness/jquery-ui-1.8.10.css +573 -0
- data/lib/generators/humpyard/skeleton/templates/stylesheets/ie.sass +15 -0
- data/lib/generators/humpyard/skeleton/templates/stylesheets/ie.scss +16 -0
- data/lib/generators/humpyard/skeleton/templates/stylesheets/partials/_base.sass +12 -0
- data/lib/generators/humpyard/skeleton/templates/stylesheets/partials/_base.scss +11 -0
- data/lib/generators/humpyard/skeleton/templates/stylesheets/print.sass +3 -0
- data/lib/generators/humpyard/skeleton/templates/stylesheets/print.scss +3 -0
- data/lib/generators/humpyard/skeleton/templates/stylesheets/screen.sass +78 -0
- data/lib/generators/humpyard/skeleton/templates/stylesheets/screen.scss +90 -0
- data/lib/generators/humpyard/skeleton/templates/views/layout.html.haml +28 -0
- data/lib/html_to_textile.rb +220 -0
- data/lib/humpyard.rb +70 -0
- data/lib/humpyard/action_controller/base.rb +24 -0
- data/lib/humpyard/active_model/naming.rb +29 -0
- data/lib/humpyard/active_model/translation.rb +26 -0
- data/lib/humpyard/active_model/validators/publish_range.rb +14 -0
- data/lib/humpyard/active_record/acts/asset.rb +68 -0
- data/lib/humpyard/active_record/acts/container_element.rb +26 -0
- data/lib/humpyard/active_record/acts/element.rb +89 -0
- data/lib/humpyard/active_record/acts/page.rb +101 -0
- data/lib/humpyard/active_record/has/title_for_url.rb +75 -0
- data/lib/humpyard/compass.rb +6 -0
- data/lib/humpyard/config.rb +235 -0
- data/lib/humpyard/engine.rb +7 -0
- data/lib/humpyard/uri_parser.rb +16 -0
- data/lib/humpyard/uri_parser/assets_uri_parser.rb +15 -0
- data/lib/humpyard/uri_parser/pages_uri_parser.rb +15 -0
- data/lib/tasks/humpyard.rake +103 -0
- metadata +331 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
de:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
humpyard:
|
5
|
+
element: "Element"
|
6
|
+
elements:
|
7
|
+
box_element: 'Rahmenelement'
|
8
|
+
text_element: 'Textelement'
|
9
|
+
news_element: 'Nachrichtenelement'
|
10
|
+
page: "Seite"
|
11
|
+
pages:
|
12
|
+
static_page: 'Statische Seite'
|
13
|
+
news_page: 'Nachrichtenseite'
|
14
|
+
virtual_page: 'Virtuelle Seite'
|
15
|
+
attributes:
|
16
|
+
humpyard:
|
17
|
+
elements:
|
18
|
+
shared_state: "Element teilen"
|
19
|
+
display_from: "Anzeige von"
|
20
|
+
display_until: "Anzeige bis"
|
21
|
+
box_element:
|
22
|
+
title: "Überschrift"
|
23
|
+
text_element:
|
24
|
+
content: "Inhalt"
|
25
|
+
html_content: "Inhalt (formatiert)"
|
26
|
+
news_element:
|
27
|
+
news_page: "Nachrichtenseite"
|
28
|
+
media_element:
|
29
|
+
asset: "Medium"
|
30
|
+
float: "Schwebende Ausrichtung"
|
31
|
+
uri: "Link Adresse"
|
32
|
+
pages:
|
33
|
+
title: "Überschrift"
|
34
|
+
description: "Beschreibung"
|
35
|
+
in_menu: "Im Menü anzeigen"
|
36
|
+
in_sitemap: "In der Sitemap anzeigen"
|
37
|
+
always_refresh: "Keinen Cache verwenden"
|
38
|
+
display_from: "Anzeige von"
|
39
|
+
display_until: "Anzeige bis"
|
40
|
+
|
41
|
+
yes: Ja
|
42
|
+
no: Nein
|
43
|
+
|
44
|
+
humpyard:
|
45
|
+
elements:
|
46
|
+
media_elements:
|
47
|
+
edit:
|
48
|
+
uri_description: "Die Link-Adresse funktioniert nur mit gewissen Medientypen wie Bildern."
|
49
|
+
none: "Keine"
|
50
|
+
left: "Links"
|
51
|
+
right: "Rechts"
|
52
|
+
|
53
|
+
|
54
|
+
humpyard_cms:
|
55
|
+
start: 'Humpyard %{version} laden'
|
56
|
+
login:
|
57
|
+
title: "Humpyard Anmeldung"
|
58
|
+
username: "Benutzer"
|
59
|
+
password: "Kennwort"
|
60
|
+
submit: "Anmelden"
|
61
|
+
login_error: "Konnte Sie mit den angegebenen Daten nicht anmelden!"
|
62
|
+
shared_state_info:
|
63
|
+
owning_page:
|
64
|
+
"0": Ungeteilt
|
65
|
+
"1": Mit allen Geschwisterseiten geteilt
|
66
|
+
"2": Mit allen Kinderseiten geteilt
|
67
|
+
with_title:
|
68
|
+
"0": Ungeteilt
|
69
|
+
"1": Mit Geschwisterseite '%{title}' geteilt
|
70
|
+
"2": Von Elternseite '%{title}' geteilt
|
71
|
+
toolbar:
|
72
|
+
edit: "Seite bearbeiten"
|
73
|
+
pages: "Seiten verwalten"
|
74
|
+
assets: "Medien verwalten"
|
75
|
+
logout: "Abmelden"
|
76
|
+
pages:
|
77
|
+
edit:
|
78
|
+
title: "Seiten bearbeiten"
|
79
|
+
add: "%{page_type} hinzufügen"
|
80
|
+
|
81
|
+
errors:
|
82
|
+
messages:
|
83
|
+
cannot_be_after_display_until: "cannot be after 'Display until'. Set an earlier date/time OR remove 'Display until'"
|
84
|
+
cannot_be_before_display_from: "cannot be before 'Display from'. Set a later date/time OR remove 'Display from'"
|
@@ -0,0 +1,81 @@
|
|
1
|
+
en:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
humpyard:
|
5
|
+
element: "Element"
|
6
|
+
elements:
|
7
|
+
box_element: 'box element'
|
8
|
+
text_element: 'text element'
|
9
|
+
news_element: 'news element'
|
10
|
+
page: "page"
|
11
|
+
pages:
|
12
|
+
static_page: 'static page'
|
13
|
+
news_page: 'news page'
|
14
|
+
virtual_page: 'virtual page'
|
15
|
+
attributes:
|
16
|
+
humpyard:
|
17
|
+
elements:
|
18
|
+
shared_state: "Share element"
|
19
|
+
display_from: "Display from"
|
20
|
+
display_until: "Display until"
|
21
|
+
box_element:
|
22
|
+
title: "Title"
|
23
|
+
text_element:
|
24
|
+
content: "Content"
|
25
|
+
html_content: "Content (formated)"
|
26
|
+
news_element:
|
27
|
+
news_page: "News page"
|
28
|
+
media_element:
|
29
|
+
asset: "Media Asset"
|
30
|
+
float: "Float Alignment"
|
31
|
+
uri: "URI"
|
32
|
+
pages:
|
33
|
+
title: "Title"
|
34
|
+
description: "Description"
|
35
|
+
in_menu: "Display in menu"
|
36
|
+
display_from: "Display from"
|
37
|
+
display_until: "Display until"
|
38
|
+
|
39
|
+
yes: yes
|
40
|
+
no: no
|
41
|
+
|
42
|
+
humpyard:
|
43
|
+
elements:
|
44
|
+
media_elements:
|
45
|
+
edit:
|
46
|
+
uri_description: "URI only works for some mime types like images"
|
47
|
+
none: "None"
|
48
|
+
left: "Left"
|
49
|
+
right: "Right"
|
50
|
+
|
51
|
+
humpyard_cms:
|
52
|
+
start: 'Loading Humpyard %{version}'
|
53
|
+
login:
|
54
|
+
title: "Login to Humpyard"
|
55
|
+
username: "Username"
|
56
|
+
password: "Password"
|
57
|
+
submit: "Login"
|
58
|
+
login_error: "Could not login with given credentials!"
|
59
|
+
shared_state_info:
|
60
|
+
owning_page:
|
61
|
+
"0": unshared
|
62
|
+
"1": shared on all siblings
|
63
|
+
"2": shared on all children
|
64
|
+
with_title:
|
65
|
+
"0": unshared
|
66
|
+
"1": Shared from sibling '%{title}'
|
67
|
+
"2": Shared from parent '%{title}'
|
68
|
+
toolbar:
|
69
|
+
edit: "Edit Page"
|
70
|
+
pages: "Manage Pages"
|
71
|
+
assets: "Manage Medias"
|
72
|
+
logout: "Logout"
|
73
|
+
pages:
|
74
|
+
edit:
|
75
|
+
title: "Manage Pages"
|
76
|
+
add: "Add %{page_type}"
|
77
|
+
|
78
|
+
errors:
|
79
|
+
messages:
|
80
|
+
cannot_be_after_display_until: "cannot be after 'Display until'. Set an earlier date/time OR remove 'Display until'"
|
81
|
+
cannot_be_before_display_from: "cannot be before 'Display from'. Set a later date/time OR remove 'Display from'"
|
data/config/routes.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
# Map admin controllers
|
3
|
+
|
4
|
+
scope "/#{Humpyard::config.admin_prefix}" do
|
5
|
+
resources :humpyard_pages, :controller => 'humpyard/pages', :path => "pages", :only => [:index, :new, :create, :edit, :update, :show, :destroy] do
|
6
|
+
collection do
|
7
|
+
post :move
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
resources :humpyard_elements, :controller => 'humpyard/elements', :path => "elements", :only => [:new, :create, :edit, :update, :show, :destroy] do
|
12
|
+
member do
|
13
|
+
get :inline_edit
|
14
|
+
end
|
15
|
+
collection do
|
16
|
+
post :move
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
resources :humpyard_assets, :controller => 'humpyard/assets', :path => "assets", :only => [:index, :new, :create, :edit, :update, :show, :destroy] do
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Map "/" URL
|
26
|
+
root :to => 'humpyard/pages#show', :webpath => 'index'
|
27
|
+
# Map sitemap.xml
|
28
|
+
match "/sitemap.xml" => 'humpyard/pages#sitemap', :as => 'sitemap'
|
29
|
+
# Map human readable page URLs
|
30
|
+
if Humpyard::config.www_prefix.match /:locale/
|
31
|
+
match "/#{Humpyard::config.www_prefix}" => 'humpyard/pages#show', :webpath => 'index', :constraints => { :locale => Humpyard.config.locales_contraint }
|
32
|
+
match "/#{Humpyard::config.www_prefix}*webpath.:format" => 'humpyard/pages#show', :constraints => { :locale => Humpyard.config.locales_contraint, :format => Humpyard.config.page_formats_contraint }
|
33
|
+
match "/#{Humpyard::config.www_prefix}*path" => 'humpyard/errors#error404', :constraints => { :locale => Humpyard.config.locales_contraint }
|
34
|
+
else
|
35
|
+
match "/#{Humpyard::config.www_prefix}*webpath.:format" => 'humpyard/pages#show', :constraints => { :format => Humpyard.config.page_formats_contraint }
|
36
|
+
match "/#{Humpyard::config.www_prefix}*path" => 'humpyard/errors#error404'
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
class Base < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :pages do |t|
|
4
|
+
t.references :parent
|
5
|
+
t.string :name # should be i18n, searchable
|
6
|
+
t.boolean :in_menu, :default => true
|
7
|
+
t.boolean :in_sitemap, :default => true
|
8
|
+
t.boolean :searchable, :default => true
|
9
|
+
t.datetime :display_from
|
10
|
+
t.datetime :display_until
|
11
|
+
t.integer :position
|
12
|
+
t.timestamps
|
13
|
+
t.datetime :deleted_at
|
14
|
+
end
|
15
|
+
|
16
|
+
create_table :page_translations do |t|
|
17
|
+
t.references :"#{Humpyard::config.table_name_prefix}page"
|
18
|
+
t.string :locale
|
19
|
+
t.string :title
|
20
|
+
t.string :title_for_url
|
21
|
+
t.text :description
|
22
|
+
t.timestamps
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table :elements do |t|
|
26
|
+
t.references :page
|
27
|
+
t.references :container
|
28
|
+
t.references :content_data
|
29
|
+
t.string :content_data_type
|
30
|
+
t.datetime :display_from
|
31
|
+
t.datetime :display_until
|
32
|
+
t.integer :position
|
33
|
+
t.timestamps
|
34
|
+
t.datetime :deleted_at
|
35
|
+
end
|
36
|
+
|
37
|
+
create_table :elements_container_elements do |t|
|
38
|
+
t.timestamps
|
39
|
+
end
|
40
|
+
|
41
|
+
create_table :elements_text_elements do |t|
|
42
|
+
t.timestamps
|
43
|
+
end
|
44
|
+
|
45
|
+
create_table :elements_text_element_translations do |t|
|
46
|
+
t.references :"#{Humpyard::config.table_name_prefix}elements_text_element"
|
47
|
+
t.string :locale
|
48
|
+
t.text :content
|
49
|
+
t.timestamps
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.down
|
54
|
+
drop_table :elements_text_element_translations
|
55
|
+
drop_table :elements_text_element
|
56
|
+
drop_table :elements
|
57
|
+
drop_table :page_translations
|
58
|
+
drop_table :pages
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class CreateBoxElement < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :elements_box_elements do |t|
|
4
|
+
t.timestamps
|
5
|
+
end
|
6
|
+
|
7
|
+
create_table :elements_box_element_translations do |t|
|
8
|
+
t.references :"#{Humpyard::config.table_name_prefix}elements_box_element"
|
9
|
+
t.string :locale
|
10
|
+
t.string :title
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
drop_table :elements_container_elements
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.down
|
18
|
+
drop_table :elements_box_element_translations
|
19
|
+
drop_table :elements_box_elements
|
20
|
+
create_table :elements_container_elements do |t|
|
21
|
+
t.timestamps
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class PageTemplate < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :pages, :template_name, :string#, :default => Humpyard::config.default_template_name
|
4
|
+
Humpyard::Page.reset_column_information
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_column :pages, :template_name
|
9
|
+
Humpyard::Page.reset_column_information
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class PageTypes < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :pages, :content_data_id, :integer
|
4
|
+
add_column :pages, :content_data_type, :string
|
5
|
+
Humpyard::Page.reset_column_information
|
6
|
+
|
7
|
+
create_table :pages_static_pages do |t|
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
rename_column :page_translations, :"#{Humpyard::config.table_name_prefix}page_id", :page_id
|
12
|
+
Humpyard::Page.all.each do |p|
|
13
|
+
sp = Humpyard::Pages::StaticPage.new
|
14
|
+
sp.page = p
|
15
|
+
sp.save
|
16
|
+
end
|
17
|
+
rename_column :page_translations, :page_id, :"#{Humpyard::config.table_name_prefix}page_id"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.down
|
21
|
+
drop_table :pages_static_pages
|
22
|
+
remove_column :pages, :content_data_id
|
23
|
+
remove_column :pages, :content_data_type
|
24
|
+
Humpyard::Page.reset_column_information
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class ElementYield < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
change_column :pages, :template_name, :string, :default => Humpyard::config.default_template_name
|
4
|
+
Humpyard::Page.reset_column_information
|
5
|
+
add_column :elements, :page_yield_name, :string, :default => 'main'
|
6
|
+
add_index :elements, :page_yield_name
|
7
|
+
Humpyard::Element.reset_column_information
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.down
|
11
|
+
remove_column :elements, :page_yield_name
|
12
|
+
Humpyard::Element.reset_column_information
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
class NewsPage < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
#Remove old news stuff if exists
|
4
|
+
# begin
|
5
|
+
# drop_table :news_feed_translations
|
6
|
+
# rescue
|
7
|
+
# end
|
8
|
+
# begin
|
9
|
+
# drop_table :news_feeds
|
10
|
+
# rescue
|
11
|
+
# end
|
12
|
+
# begin
|
13
|
+
# drop_table :news_item_translations
|
14
|
+
# rescue
|
15
|
+
# end
|
16
|
+
# begin
|
17
|
+
# drop_table :news_items
|
18
|
+
# rescue
|
19
|
+
# end
|
20
|
+
|
21
|
+
create_table :pages_news_pages do |t|
|
22
|
+
t.timestamps
|
23
|
+
t.datetime :deleted_at
|
24
|
+
end
|
25
|
+
|
26
|
+
create_table :news_items do |t|
|
27
|
+
t.references :news_page
|
28
|
+
t.datetime :published_at
|
29
|
+
t.timestamps
|
30
|
+
t.datetime :deleted_at
|
31
|
+
end
|
32
|
+
|
33
|
+
create_table :news_item_translations do |t|
|
34
|
+
t.references :"#{Humpyard::config.table_name_prefix}news_items"
|
35
|
+
t.string :locale
|
36
|
+
t.string :title
|
37
|
+
t.string :title_for_url
|
38
|
+
t.text :description
|
39
|
+
t.timestamps
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.down
|
44
|
+
drop_table :news_item_translations
|
45
|
+
drop_table :news_items
|
46
|
+
drop_table :pages_news_pages
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class PageI18nName < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
# begin
|
4
|
+
# add_column :page_translations, :title_for_url, :string
|
5
|
+
# Humpyard::Page.reset_column_information
|
6
|
+
#
|
7
|
+
# rename_column :page_translations, :"#{Humpyard::config.table_name_prefix}page_id", :page_id
|
8
|
+
# Humpyard::Page.all.each do | p |
|
9
|
+
# Humpyard::config.locales.each do | locale |
|
10
|
+
# I18n.locale = locale
|
11
|
+
# p.title_for_url = p.suggested_title_for_url
|
12
|
+
# p.save
|
13
|
+
# end
|
14
|
+
# end
|
15
|
+
# I18n.locale = Humpyard::config.locales.first
|
16
|
+
# rename_column :page_translations, :page_id, :"#{Humpyard::config.table_name_prefix}page_id"
|
17
|
+
# remove_column :pages, :name, :string
|
18
|
+
# Humpyard::Page.reset_column_information
|
19
|
+
# rescue
|
20
|
+
# end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.down
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|