dust-cms 0.0.05
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +3 -0
- data/Rakefile +5 -0
- data/app/assets/images/admin/blank.png +0 -0
- data/app/assets/images/admin/dust-letterpress.png +0 -0
- data/app/assets/images/admin/main-back.png +0 -0
- data/app/assets/images/admin/ui/delete-icon.png +0 -0
- data/app/assets/images/admin/ui/edit-icon.png +0 -0
- data/app/assets/images/admin/ui/handle.png +0 -0
- data/app/assets/images/admin/ui/icons.png +0 -0
- data/app/assets/images/admin/ui/index-icon.png +0 -0
- data/app/assets/images/admin/ui/new-icon.png +0 -0
- data/app/assets/images/entypo/entypo.eot +0 -0
- data/app/assets/images/entypo/entypo.svg +13 -0
- data/app/assets/images/entypo/entypo.ttf +0 -0
- data/app/assets/images/entypo/entypo.woff +0 -0
- data/app/assets/images/entypo-social/entypo-social.eot +0 -0
- data/app/assets/images/entypo-social/entypo-social.svg +13 -0
- data/app/assets/images/entypo-social/entypo-social.ttf +0 -0
- data/app/assets/images/entypo-social/entypo-social.woff +0 -0
- data/app/assets/images/fancybox/blank.gif +0 -0
- data/app/assets/images/fancybox/fancy_close.png +0 -0
- data/app/assets/images/fancybox/fancy_loading.png +0 -0
- data/app/assets/images/fancybox/fancy_nav_left.png +0 -0
- data/app/assets/images/fancybox/fancy_nav_right.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_e.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_n.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_ne.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_nw.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_s.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_se.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_sw.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_w.png +0 -0
- data/app/assets/images/fancybox/fancy_title_left.png +0 -0
- data/app/assets/images/fancybox/fancy_title_main.png +0 -0
- data/app/assets/images/fancybox/fancy_title_over.png +0 -0
- data/app/assets/images/fancybox/fancy_title_right.png +0 -0
- data/app/assets/images/fancybox/fancybox-x.png +0 -0
- data/app/assets/images/fancybox/fancybox-y.png +0 -0
- data/app/assets/images/fancybox/fancybox.png +0 -0
- data/app/assets/javascripts/cms/dust/defaults.js.coffee +31 -0
- data/app/assets/javascripts/cms/dust/gallery/photo.js.coffee +1 -0
- data/app/assets/javascripts/cms/dust/gallery/photo_view.js.coffee +21 -0
- data/app/assets/javascripts/cms/dust/gallery/photos.js.coffee +6 -0
- data/app/assets/javascripts/cms/dust/gallery/photos_view.js.coffee +12 -0
- data/app/assets/javascripts/cms/dust/gallery/router.js.coffee +14 -0
- data/app/assets/javascripts/cms/dust/gallery.js.coffee +31 -0
- data/app/assets/javascripts/cms/dust/nav.js.coffee +21 -0
- data/app/assets/javascripts/cms/dust/sections.js.coffee +21 -0
- data/app/assets/javascripts/cms/dust/sortables.js.coffee +64 -0
- data/app/assets/javascripts/cms/dust/window.js.coffee +11 -0
- data/app/assets/javascripts/cms/dust.js.coffee +19 -0
- data/app/assets/javascripts/cms/lib/backbone.js +42 -0
- data/app/assets/javascripts/cms/lib/fineuploader-3.0.js +71 -0
- data/app/assets/javascripts/cms/lib/handlebars.js +1920 -0
- data/app/assets/javascripts/cms/lib/spin.js +2 -0
- data/app/assets/javascripts/cms/lib/underscore.js +1 -0
- data/app/assets/javascripts/cms.js +14 -0
- data/app/assets/javascripts/core/jquery.form.js +785 -0
- data/app/assets/javascripts/core/jquery.html5.js +29 -0
- data/app/assets/javascripts/core/jquery.mousewheel-3.0.2.pack.js +13 -0
- data/app/assets/javascripts/core/jquery.placeholder.min.js +11 -0
- data/app/assets/javascripts/core/nestedsortables.js +429 -0
- data/app/assets/javascripts/core/serializelist.js +66 -0
- data/app/assets/javascripts/core/tipTip.js +21 -0
- data/app/assets/javascripts/core.js +4 -0
- data/app/assets/javascripts/front_end/application-main.js.coffee +27 -0
- data/app/assets/javascripts/front_end/map.js +34 -0
- data/app/assets/javascripts/front_end/video.js +4569 -0
- data/app/assets/javascripts/front_end.js +18 -0
- data/app/assets/stylesheets/cms/flash_messages.css.scss +17 -0
- data/app/assets/stylesheets/cms/footer.css.scss +12 -0
- data/app/assets/stylesheets/cms/forms.css.scss +67 -0
- data/app/assets/stylesheets/cms/gallery.css.scss +21 -0
- data/app/assets/stylesheets/cms/icons.css.scss +123 -0
- data/app/assets/stylesheets/cms/jquery-ui.custom.scss +6 -0
- data/app/assets/stylesheets/cms/layout.css.scss +162 -0
- data/app/assets/stylesheets/cms/lib/grid.css.scss +116 -0
- data/app/assets/stylesheets/cms/lib/mixins.css.scss +20 -0
- data/app/assets/stylesheets/cms/login.scss +12 -0
- data/app/assets/stylesheets/cms/main.old +155 -0
- data/app/assets/stylesheets/cms/nav.css.scss +73 -0
- data/app/assets/stylesheets/cms/sections.scss +17 -0
- data/app/assets/stylesheets/cms/sortables.scss +20 -0
- data/app/assets/stylesheets/cms.css.scss +30 -0
- data/app/assets/stylesheets/core/app/defaults.css.scss +556 -0
- data/app/assets/stylesheets/core/plugins/PIE.htc +96 -0
- data/app/assets/stylesheets/core/plugins/jquery-ui-1.8.5.custom.old +572 -0
- data/app/assets/stylesheets/core/plugins/jquery.fancybox-1.3.1.css +364 -0
- data/app/assets/stylesheets/core/plugins/skeleton.css +155 -0
- data/app/assets/stylesheets/core/plugins/tipTip.css +115 -0
- data/app/assets/stylesheets/core/plugins/uploadify.css +25 -0
- data/app/assets/stylesheets/core/reset/reset.css +211 -0
- data/app/assets/stylesheets/core/reset/text.css +86 -0
- data/app/assets/stylesheets/core.css.scss +14 -0
- data/app/assets/stylesheets/front_end/app/just-delete-me-and-start-over.css.scss +70 -0
- data/app/assets/stylesheets/front_end.css +14 -0
- data/app/controllers/authentication_controller.rb +30 -0
- data/app/controllers/dust/blocks_controller.rb +49 -0
- data/app/controllers/dust/contacts_controller.rb +89 -0
- data/app/controllers/dust/dashboard_controller.rb +26 -0
- data/app/controllers/dust/gallery/albums_controller.rb +49 -0
- data/app/controllers/dust/gallery/api/photos_controller.rb +28 -0
- data/app/controllers/dust/gallery/photos_controller.rb +47 -0
- data/app/controllers/dust/menu_items_controller.rb +51 -0
- data/app/controllers/dust/menus_controller.rb +47 -0
- data/app/controllers/dust/pages_controller.rb +52 -0
- data/app/controllers/dust/password_resets_controller.rb +48 -0
- data/app/controllers/dust/posts_controller.rb +47 -0
- data/app/controllers/dust/roles_controller.rb +47 -0
- data/app/controllers/dust/sessions_controller.rb +29 -0
- data/app/controllers/dust/site_wides_controller.rb +28 -0
- data/app/controllers/dust/sortable_controller.rb +17 -0
- data/app/controllers/dust/users_controller.rb +52 -0
- data/app/controllers/front_end/page_controller.rb +27 -0
- data/app/controllers/front_end/post_controller.rb +14 -0
- data/app/controllers/front_end/sitemap_controller.rb +11 -0
- data/app/controllers/front_end_controller.rb +18 -0
- data/app/helpers/error_messages_helper.rb +23 -0
- data/app/helpers/exceptions.rb +4 -0
- data/app/helpers/layout_helper.rb +28 -0
- data/app/helpers/misc_helper.rb +29 -0
- data/app/helpers/region_helper.rb +32 -0
- data/app/mailers/post_office.rb +39 -0
- data/app/models/ckeditor/asset.rb +7 -0
- data/app/models/ckeditor/attachment_file.rb +7 -0
- data/app/models/ckeditor/picture.rb +7 -0
- data/app/models/dust/block.rb +114 -0
- data/app/models/dust/builder/page.rb +84 -0
- data/app/models/dust/builder/site_wide.rb +50 -0
- data/app/models/dust/contact.rb +34 -0
- data/app/models/dust/gallery/album.rb +14 -0
- data/app/models/dust/gallery/photo.rb +23 -0
- data/app/models/dust/handlebar.rb +59 -0
- data/app/models/dust/map.rb +21 -0
- data/app/models/dust/menu/item_dependency.rb +66 -0
- data/app/models/dust/menu.rb +11 -0
- data/app/models/dust/menu_item.rb +64 -0
- data/app/models/dust/page.rb +52 -0
- data/app/models/dust/post.rb +39 -0
- data/app/models/dust/role.rb +9 -0
- data/app/models/dust/section.rb +11 -0
- data/app/models/dust/session.rb +28 -0
- data/app/models/dust/site_wide.rb +41 -0
- data/app/models/dust/sort.rb +52 -0
- data/app/models/dust/sortable_item.rb +21 -0
- data/app/models/dust/user.rb +49 -0
- data/app/uploaders/ckeditor_attachment_file_uploader.rb +42 -0
- data/app/uploaders/ckeditor_picture_uploader.rb +53 -0
- data/app/uploaders/gallery_photo_uploader.rb +52 -0
- data/app/uploaders/image_uploader.rb +51 -0
- data/app/uploaders/slide_image_uploader.rb +51 -0
- data/app/views/dust/blocks/_block.html.haml +20 -0
- data/app/views/dust/blocks/_form.html.haml +50 -0
- data/app/views/dust/blocks/_normal_block_content.html.haml +1 -0
- data/app/views/dust/blocks/_search.html.haml +4 -0
- data/app/views/dust/blocks/edit.html.haml +4 -0
- data/app/views/dust/blocks/index.html.haml +16 -0
- data/app/views/dust/blocks/new.html.haml +3 -0
- data/app/views/dust/contacts/_form.html.haml +37 -0
- data/app/views/dust/contacts/_import_csv.html.haml +8 -0
- data/app/views/dust/contacts/_instance.html.haml +13 -0
- data/app/views/dust/contacts/_search.html.haml +4 -0
- data/app/views/dust/contacts/edit.html.haml +2 -0
- data/app/views/dust/contacts/index.html.haml +17 -0
- data/app/views/dust/contacts/index.json.haml +6 -0
- data/app/views/dust/contacts/new.html.haml +3 -0
- data/app/views/dust/dashboard/_options.html.haml +6 -0
- data/app/views/dust/dashboard/show.html.haml +33 -0
- data/app/views/dust/dashboard/update.html.haml +6 -0
- data/app/views/dust/gallery/albums/_form.html.haml +52 -0
- data/app/views/dust/gallery/albums/_photo.html.haml +12 -0
- data/app/views/dust/gallery/albums/edit.html.haml +3 -0
- data/app/views/dust/gallery/albums/index.html.haml +18 -0
- data/app/views/dust/gallery/albums/new.html.haml +4 -0
- data/app/views/dust/gallery/albums/show.html.haml +2 -0
- data/app/views/dust/gallery/photos/_form.html.haml +26 -0
- data/app/views/dust/gallery/photos/edit.html.haml +3 -0
- data/app/views/dust/gallery/photos/index.html.haml +18 -0
- data/app/views/dust/gallery/photos/new.html.haml +4 -0
- data/app/views/dust/gallery/photos/show.json.jbuilder +5 -0
- data/app/views/dust/menu_items/_form.html.haml +24 -0
- data/app/views/dust/menu_items/_roots.html.haml +3 -0
- data/app/views/dust/menu_items/_search.html.haml +4 -0
- data/app/views/dust/menu_items/_tree.html.haml +11 -0
- data/app/views/dust/menu_items/edit.html.haml +2 -0
- data/app/views/dust/menu_items/index.html.haml +19 -0
- data/app/views/dust/menu_items/new.html.haml +2 -0
- data/app/views/dust/menus/_form.html.haml +39 -0
- data/app/views/dust/menus/edit.html.haml +3 -0
- data/app/views/dust/menus/index.html.haml +18 -0
- data/app/views/dust/menus/new.html.haml +4 -0
- data/app/views/dust/menus/show.html.haml +2 -0
- data/app/views/dust/pages/_form.html.haml +68 -0
- data/app/views/dust/pages/_search.html.haml +4 -0
- data/app/views/dust/pages/edit.html.haml +3 -0
- data/app/views/dust/pages/index.html.haml +16 -0
- data/app/views/dust/pages/new.html.haml +3 -0
- data/app/views/dust/password_resets/edit.html.haml +6 -0
- data/app/views/dust/password_resets/new.html.haml +10 -0
- data/app/views/dust/posts/_form.html.haml +39 -0
- data/app/views/dust/posts/edit.html.haml +3 -0
- data/app/views/dust/posts/index.html.haml +18 -0
- data/app/views/dust/posts/new.html.haml +4 -0
- data/app/views/dust/posts/show.html.haml +2 -0
- data/app/views/dust/roles/_form.html.haml +11 -0
- data/app/views/dust/roles/edit.html.haml +2 -0
- data/app/views/dust/roles/index.html.haml +14 -0
- data/app/views/dust/roles/new.html.haml +2 -0
- data/app/views/dust/sessions/_form.html.haml +18 -0
- data/app/views/dust/sessions/new.html.haml +2 -0
- data/app/views/dust/site_wides/new.html.haml +19 -0
- data/app/views/dust/slides/_form.html.haml +26 -0
- data/app/views/dust/slides/_search.html.haml +4 -0
- data/app/views/dust/slides/_slideshow.html.haml +12 -0
- data/app/views/dust/slides/edit.html.haml +5 -0
- data/app/views/dust/slides/index.html.haml +25 -0
- data/app/views/dust/slides/index.js.haml +2 -0
- data/app/views/dust/slides/new.html.haml +6 -0
- data/app/views/dust/slides/show.html.haml +15 -0
- data/app/views/dust/sortable/sort.js.coffee +10 -0
- data/app/views/dust/users/_form.html.haml +27 -0
- data/app/views/dust/users/_search.html.haml +4 -0
- data/app/views/dust/users/_user_bar.html.haml +10 -0
- data/app/views/dust/users/dashboard.html.haml +40 -0
- data/app/views/dust/users/edit.html.haml +2 -0
- data/app/views/dust/users/index.html.haml +16 -0
- data/app/views/dust/users/new.html.haml +2 -0
- data/app/views/front_end/page/_admin.html.haml +6 -0
- data/app/views/front_end/page/search.html.haml +9 -0
- data/app/views/front_end/page/show.html.haml +8 -0
- data/app/views/front_end/post/_admin.html.haml +7 -0
- data/app/views/front_end/post/show.html.haml +12 -0
- data/app/views/front_end/sitemap/index.html.haml +4 -0
- data/app/views/front_end/sitemap/index.xml.haml +9 -0
- data/app/views/layouts/app_partials/_analytics.html.haml +11 -0
- data/app/views/layouts/app_partials/_application_tree.html.haml +6 -0
- data/app/views/layouts/cms.html.haml +52 -0
- data/app/views/layouts/cms_partials/_nav.html.haml +5 -0
- data/app/views/layouts/front_end.html.haml +22 -0
- data/app/views/layouts/sessions.html.haml +19 -0
- data/app/views/post_office/contact_confirmation.html.haml +7 -0
- data/app/views/post_office/contact_request.html.haml +24 -0
- data/app/views/post_office/password_reset_instructions.html.haml +6 -0
- data/app/views/widgets/_contact_form.html.haml +20 -0
- data/app/views/widgets/_map.html.haml +16 -0
- data/app/views/widgets/_quick_contact_form.html.haml +10 -0
- data/app/views/widgets/_site_map.html.haml +7 -0
- data/app/views/widgets/_site_menu.html.haml +10 -0
- data/app/views/widgets/_slider.html.haml +0 -0
- data/app/views/widgets/_user_login.html.haml +13 -0
- data/app/views/widgets/galleries/_archive.html.haml +1 -0
- data/app/views/widgets/galleries/_show.html.haml +0 -0
- data/app/views/widgets/posts/_index.html.haml +1 -0
- data/app/views/widgets/posts/_show.html.haml +0 -0
- data/config/authorization_rules.rb +23 -0
- data/config/generators/templates/haml/scaffold/_form.html.haml +19 -0
- data/config/generators/templates/haml/scaffold/edit.html.haml +3 -0
- data/config/generators/templates/haml/scaffold/index.html.haml +18 -0
- data/config/generators/templates/haml/scaffold/new.html.haml +4 -0
- data/config/generators/templates/haml/scaffold/show.html.haml +2 -0
- data/config/generators/templates/rails/scaffold_controller/controller.rb +51 -0
- data/config/initializers/app_string_io.rb +12 -0
- data/config/initializers/ckeditor.rb +18 -0
- data/config/initializers/client_side_validations.rb +13 -0
- data/config/initializers/dust_config.rb +22 -0
- data/config/initializers/dust_core_reloader.rb +11 -0
- data/config/initializers/sorcery.rb +398 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/routes.rb +55 -0
- data/db/migrate/20101206025845_create_roles.rb +11 -0
- data/db/migrate/20110217212357_create_ckeditor_assets.rb +31 -0
- data/db/migrate/20110218000640_create_pages.rb +15 -0
- data/db/migrate/20110218000641_create_sections.rb +15 -0
- data/db/migrate/20110218002220_create_contacts.rb +22 -0
- data/db/migrate/20110218020608_create_menu_items.rb +21 -0
- data/db/migrate/20110507014158_create_blocks.rb +23 -0
- data/db/migrate/20121106195938_sorcery_core.rb +17 -0
- data/db/migrate/20121106195939_sorcery_remember_me.rb +15 -0
- data/db/migrate/20121106195940_sorcery_reset_password.rb +17 -0
- data/db/migrate/20121106195941_sorcery_activity_logging.rb +17 -0
- data/db/migrate/20121106200754_sorcery_user_activation.rb +17 -0
- data/db/migrate/20130220044031_create_site_wides.rb +11 -0
- data/db/migrate/20130220051658_create_menus.rb +11 -0
- data/db/migrate/20130223030136_create_albums.rb +13 -0
- data/db/migrate/20130223040911_create_photos.rb +15 -0
- data/db/migrate/20130223044553_create_posts.rb +15 -0
- data/lib/dust/engine.rb +18 -0
- data/lib/dust/utils.rb +14 -0
- data/lib/dust/version.rb +3 -0
- data/lib/dust-cms.rb +53 -0
- data/lib/tasks/dust_tasks.rake +51 -0
- data/lib/tasks/seed.rb +46 -0
- metadata +613 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateContacts < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :contacts do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :email
|
6
|
+
t.string :company_name
|
7
|
+
t.string :phone
|
8
|
+
t.string :address
|
9
|
+
t.string :city
|
10
|
+
t.string :state
|
11
|
+
t.string :zip
|
12
|
+
t.string :message
|
13
|
+
t.string :hear
|
14
|
+
|
15
|
+
t.timestamps
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.down
|
20
|
+
drop_table :contacts
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateMenuItems < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :menu_items do |t|
|
4
|
+
t.string :title, :default => "Empty"
|
5
|
+
t.string :url, :default => "/empty"
|
6
|
+
t.boolean :active, :default => 0
|
7
|
+
|
8
|
+
t.integer :lft
|
9
|
+
t.integer :rgt
|
10
|
+
t.integer :parent_id
|
11
|
+
t.integer :menu_id, :default => 0
|
12
|
+
|
13
|
+
t.references :linkable, :polymorphic => true
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.down
|
19
|
+
drop_table :menu_items
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class CreateBlocks < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :blocks do |t|
|
4
|
+
t.boolean :show_title
|
5
|
+
t.string :title
|
6
|
+
t.text :body
|
7
|
+
t.string :where_to_show
|
8
|
+
t.text :show
|
9
|
+
t.boolean :show_title
|
10
|
+
t.string :column_span
|
11
|
+
t.string :column_offset
|
12
|
+
t.string :classes
|
13
|
+
t.integer :weight
|
14
|
+
t.string :partial_name
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.down
|
21
|
+
drop_table :blocks
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class SorceryCore < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :users do |t|
|
4
|
+
t.string :username, :null => false # if you use another field as a username, for example email, you can safely remove this field.
|
5
|
+
t.string :email, :default => nil # if you use this field as a username, you might want to make it :null => false.
|
6
|
+
t.string :crypted_password, :default => nil
|
7
|
+
t.string :salt, :default => nil
|
8
|
+
t.string :role_id, :default => nil
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :users
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class SorceryRememberMe < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :users, :remember_me_token, :string, :default => nil
|
4
|
+
add_column :users, :remember_me_token_expires_at, :datetime, :default => nil
|
5
|
+
|
6
|
+
add_index :users, :remember_me_token
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
remove_index :users, :remember_me_token
|
11
|
+
|
12
|
+
remove_column :users, :remember_me_token_expires_at
|
13
|
+
remove_column :users, :remember_me_token
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class SorceryResetPassword < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :users, :reset_password_token, :string, :default => nil
|
4
|
+
add_column :users, :reset_password_token_expires_at, :datetime, :default => nil
|
5
|
+
add_column :users, :reset_password_email_sent_at, :datetime, :default => nil
|
6
|
+
|
7
|
+
add_index :users, :reset_password_token
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.down
|
11
|
+
remove_index :users, :reset_password_token
|
12
|
+
|
13
|
+
remove_column :users, :reset_password_email_sent_at
|
14
|
+
remove_column :users, :reset_password_token_expires_at
|
15
|
+
remove_column :users, :reset_password_token
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class SorceryActivityLogging < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :users, :last_login_at, :datetime, :default => nil
|
4
|
+
add_column :users, :last_logout_at, :datetime, :default => nil
|
5
|
+
add_column :users, :last_activity_at, :datetime, :default => nil
|
6
|
+
|
7
|
+
add_index :users, [:last_logout_at, :last_activity_at]
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.down
|
11
|
+
remove_index :users, [:last_logout_at, :last_activity_at]
|
12
|
+
|
13
|
+
remove_column :users, :last_activity_at
|
14
|
+
remove_column :users, :last_logout_at
|
15
|
+
remove_column :users, :last_login_at
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class SorceryUserActivation < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :users, :activation_state, :string, :default => nil
|
4
|
+
add_column :users, :activation_token, :string, :default => nil
|
5
|
+
add_column :users, :activation_token_expires_at, :datetime, :default => nil
|
6
|
+
|
7
|
+
add_index :users, :activation_token
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.down
|
11
|
+
remove_index :users, :activation_token
|
12
|
+
|
13
|
+
remove_column :users, :activation_token_expires_at
|
14
|
+
remove_column :users, :activation_token
|
15
|
+
remove_column :users, :activation_state
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreatePhotos < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :photos do |t|
|
4
|
+
t.string :title
|
5
|
+
t.text :description
|
6
|
+
t.string :filename
|
7
|
+
t.integer :album_id
|
8
|
+
t.integer :parent_id
|
9
|
+
t.integer :lft
|
10
|
+
t.integer :rgt
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreatePosts < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :posts do |t|
|
4
|
+
t.string :title
|
5
|
+
t.string :file
|
6
|
+
t.boolean :published
|
7
|
+
t.datetime :published_at
|
8
|
+
t.boolean :share
|
9
|
+
t.string :share_type
|
10
|
+
t.text :body
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/dust/engine.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Dust
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
#isolate_namespace Dust
|
4
|
+
|
5
|
+
initializer 'dust_engine.widget_view_paths', :after=> :disable_dependency_loading do |app|
|
6
|
+
ActionController::Base.prepend_view_path File.join(Dust.root, "app/dust/views/widgets")
|
7
|
+
ActionController::Base.prepend_view_path "app/views/widgets"
|
8
|
+
|
9
|
+
Rails.application.config.assets.paths << "#{Dust.root}/app/assets/images"
|
10
|
+
Rails.application.config.assets.paths << "#{Dust.root}/app/assets/stylesheets"
|
11
|
+
Rails.application.config.assets.paths << "#{Dust.root}/app/assets/javascripts"
|
12
|
+
|
13
|
+
Rails.application.config.assets.precompile += %w( front_end.css cms.js cms.css )
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/dust/utils.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module Dust
|
2
|
+
module Utils
|
3
|
+
def select_assets(path, relative_path)
|
4
|
+
folder = File.join(path, '**')
|
5
|
+
relative_folder = Dust.root.join(relative_path)
|
6
|
+
|
7
|
+
Dir[Dust.root.join(folder, '*.{js,css}')].inject([]) do |list, file|
|
8
|
+
list << Pathname.new(file).relative_path_from(relative_folder).to_s
|
9
|
+
list
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
data/lib/dust/version.rb
ADDED
data/lib/dust-cms.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require "dust/engine"
|
2
|
+
|
3
|
+
require "sorcery"
|
4
|
+
require "declarative_authorization"
|
5
|
+
require "client_side_validations"
|
6
|
+
require "will_paginate"
|
7
|
+
require "simple_form"
|
8
|
+
require "country_select"
|
9
|
+
require "client_side_validations-simple_form"
|
10
|
+
require "carrierwave"
|
11
|
+
require "mini_magick"
|
12
|
+
require "awesome_nested_set"
|
13
|
+
require "auto_build"
|
14
|
+
require "dust-ckeditor"
|
15
|
+
require 'jquery-rails'
|
16
|
+
require 'jquery-ui-rails'
|
17
|
+
require "hashie"
|
18
|
+
require "jbuilder"
|
19
|
+
require "mustache"
|
20
|
+
require "haml-rails"
|
21
|
+
require "numbers_and_words"
|
22
|
+
|
23
|
+
unless Rails.env.production?
|
24
|
+
require "thin"
|
25
|
+
require "better_errors"
|
26
|
+
end
|
27
|
+
|
28
|
+
module Dust
|
29
|
+
extend self
|
30
|
+
|
31
|
+
def root
|
32
|
+
path = File.expand_path('../..',__FILE__)
|
33
|
+
Pathname.new(path)
|
34
|
+
end
|
35
|
+
|
36
|
+
def site_wides
|
37
|
+
Dust::SiteWide.all_to_object
|
38
|
+
end
|
39
|
+
|
40
|
+
def configure(&block)
|
41
|
+
instance_eval &block
|
42
|
+
@config
|
43
|
+
end
|
44
|
+
|
45
|
+
def config
|
46
|
+
@config ||= OpenStruct.new
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
if Rails.env.production?
|
51
|
+
ENV['PATH'] = "#{Dust.config.uploader_command_path}:#{ENV['PATH']}"
|
52
|
+
end
|
53
|
+
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require_relative './seed.rb'
|
2
|
+
|
3
|
+
namespace :dust do
|
4
|
+
desc "Dust cp migrations, migrate, and seed data"
|
5
|
+
task :init => :environment do
|
6
|
+
Rake::Task["dust_engine:install:migrations"].invoke
|
7
|
+
Rake::Task["db:migrate"].invoke
|
8
|
+
Rake::Task["dust:seed"].invoke
|
9
|
+
Rake::Task["dust:config"].invoke
|
10
|
+
Rake::Task["dust:override_scaffold"].invoke
|
11
|
+
Rake::Task["dust:authorization"].invoke
|
12
|
+
Rake::Task["dust:init_css"].invoke
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Generate all Dust app Data"
|
16
|
+
task :seed => :environment do
|
17
|
+
Dust::Seed.data
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Dust config initializer"
|
21
|
+
task :config => :environment do
|
22
|
+
template_path = File.join(Dust.root, 'config', 'initializers', 'dust_config.rb')
|
23
|
+
des_path = File.join(Rails.root, 'config', 'initializers')
|
24
|
+
cp(template_path, des_path)
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "Dust authorization_rules initializer"
|
28
|
+
task :authorization => :environment do
|
29
|
+
template_path = File.join(Dust.root, 'config', 'authorization_rules.rb')
|
30
|
+
des_path = File.join(Rails.root, 'config')
|
31
|
+
cp(template_path, des_path)
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Dust init css"
|
35
|
+
task :init_css => :environment do
|
36
|
+
template_path = File.join(Dust.root, 'app', 'assets', 'stylesheets', 'front_end')
|
37
|
+
des_path = File.join(Rails.root, 'app', 'assets', 'stylesheets')
|
38
|
+
cp_r(template_path, des_path)
|
39
|
+
|
40
|
+
template_path = File.join(Dust.root, 'app', 'assets', 'stylesheets', 'front_end.css')
|
41
|
+
des_path = File.join(Rails.root, 'app', 'assets', 'stylesheets')
|
42
|
+
cp(template_path, des_path)
|
43
|
+
end
|
44
|
+
|
45
|
+
desc "Override Rails scaffold generator"
|
46
|
+
task :override_scaffold => :environment do
|
47
|
+
template_path = File.join(Dust.root, 'config', 'generators', 'templates')
|
48
|
+
des_path = File.join(Rails.root, 'lib', 'templates')
|
49
|
+
cp_r(template_path, des_path)
|
50
|
+
end
|
51
|
+
end
|
data/lib/tasks/seed.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
module Dust
|
2
|
+
module Seed
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def data
|
6
|
+
Dust::Role.create([{:name => "admin"}, {:name => "moderator"}])
|
7
|
+
Dust::User.create(:username => 'admin',
|
8
|
+
:password => "secret",
|
9
|
+
:password_confirmation => "secret",
|
10
|
+
:email => 'admin@dust.com',
|
11
|
+
:role => Dust::Role.find_by_name("admin")
|
12
|
+
)
|
13
|
+
|
14
|
+
Dust::Menu.create({:title => "Main Menu", :nestable => "nest"})
|
15
|
+
Dust::Menu.create({:title => "Admin Menu", :nestable => "no-nest"})
|
16
|
+
Dust::MenuItem.create([
|
17
|
+
{:title => "Pages", :url => "/dust/pages", :menu_id => 2, :active => 1},
|
18
|
+
{:title => "Blocks", :url => "/dust/blocks", :menu_id => 2, :active => 1},
|
19
|
+
{:title => "Albums", :url => "/dust/gallery/albums", :menu_id => 2, :active => 1},
|
20
|
+
{:title => "Posts", :url => "/dust/posts", :menu_id => 2, :active => 1},
|
21
|
+
{:title => "Contacts", :url => "/dust/contacts", :menu_id => 2, :active => 1},
|
22
|
+
{:title => "Roles", :url => "/dust/roles", :menu_id => 2, :active => 1},
|
23
|
+
{:title => "Users", :url => "/dust/users", :menu_id => 2, :active => 1},
|
24
|
+
{:title => "Menus", :url => "/dust/menus", :menu_id => 2, :active => 1}
|
25
|
+
])
|
26
|
+
|
27
|
+
@page = Dust::Page.create({:meta_title => "Welcome"})
|
28
|
+
@page.build_menu_item
|
29
|
+
@page.menu_item.update_attributes(
|
30
|
+
{:title => "Home", :url => "/welcome", :menu_id => 1}
|
31
|
+
)
|
32
|
+
|
33
|
+
Dust::SiteWide.create([
|
34
|
+
{:name => "analytics code", :value => "UA-xxxxx-1", :category => "site info"},
|
35
|
+
{:name => "site url", :value => "www.newsite.com", :category => "site info"},
|
36
|
+
{:name => "default description", :value => "welcome to our new website", :category => "site info"},
|
37
|
+
{:name => "default recipient", :value => "admin@dust.com", :category => "contact info"},
|
38
|
+
{:name => "default recipient name", :value => "ross nelson", :category => "contact info"},
|
39
|
+
{:name => "address", :value => "12164 w. wadsworth rd.\nbeach park, il 60087", :category => "location info"},
|
40
|
+
{:name => "phone", :value => "847.244.2878", :category => "location info"}
|
41
|
+
])
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|