raffle_v1 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/README.md +11 -2
- data/app/assets/images/raffle_v1/game.png +0 -0
- data/app/assets/images/raffle_v1/gift.png +0 -0
- data/app/assets/images/raffle_v1/lifesaver.png +0 -0
- data/app/assets/images/raffle_v1/person01.jpg +0 -0
- data/app/assets/javascripts/raffle_v1/application.js +2 -1
- data/app/assets/javascripts/raffle_v1/home.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/locales.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/page_layouts.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/pages.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/programs.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/roles.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/stylesheets.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/terms_and_conditions.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/terms_of_conditions.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/translation_keys.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/translation_objects.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/user.js.coffee +3 -0
- data/app/assets/javascripts/raffle_v1/versions.js.coffee +3 -0
- data/app/assets/stylesheets/raffle_v1/TableTools.css +264 -0
- data/app/assets/stylesheets/raffle_v1/TableTools.css.scss +264 -0
- data/app/assets/stylesheets/raffle_v1/TableTools_JUI.css +182 -0
- data/app/assets/stylesheets/raffle_v1/TableTools_JUI.css.scss +183 -0
- data/app/assets/stylesheets/raffle_v1/_custom.css.scss +3310 -0
- data/app/assets/stylesheets/raffle_v1/_variable.scss +122 -0
- data/app/assets/stylesheets/raffle_v1/_variable_defaults.scss +83 -0
- data/app/assets/stylesheets/raffle_v1/application.css.scss +34 -0
- data/app/assets/stylesheets/raffle_v1/application.css.scss.erb +32 -0
- data/app/assets/stylesheets/raffle_v1/bootstrap-responsive.css +570 -0
- data/app/assets/stylesheets/raffle_v1/bootstrap-responsive.css.scss +570 -0
- data/app/assets/stylesheets/raffle_v1/bootstrap.css +4226 -0
- data/app/assets/stylesheets/raffle_v1/bootstrap.css.scss +4226 -0
- data/app/assets/stylesheets/raffle_v1/colorbox.css +88 -0
- data/app/assets/stylesheets/raffle_v1/colorbox.css.scss +88 -0
- data/app/assets/stylesheets/raffle_v1/grid.css.scss +258 -0
- data/app/assets/stylesheets/raffle_v1/hierarchy.css.scss +16 -0
- data/app/assets/stylesheets/raffle_v1/home.css.scss +18 -0
- data/app/assets/stylesheets/raffle_v1/jquery.dataTables.css +83 -0
- data/app/assets/stylesheets/raffle_v1/jquery.dataTables.css.scss +83 -0
- data/app/assets/stylesheets/raffle_v1/jquery.jcarousel.css +206 -0
- data/app/assets/stylesheets/raffle_v1/jquery.wysiwyg.css +57 -0
- data/app/assets/stylesheets/raffle_v1/jquery.wysiwyg.css.scss +57 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/jquery.ui.core.css +38 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/jquery.ui.core.css.scss +38 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/jquery.ui.dialog.css +21 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/jquery.ui.dialog.css.scss +21 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/jquery-ui-1.8.18.custom.css +563 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/jquery-ui-1.8.18.custom.css.scss +563 -0
- data/app/assets/stylesheets/raffle_v1/locales.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/page_layouts.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/pages.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/programs.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/reset.css.scss +96 -0
- data/app/assets/stylesheets/raffle_v1/roles.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/scaffolds.css.scss +42 -0
- data/app/assets/stylesheets/raffle_v1/stylesheets.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/terms_and_conditions.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/terms_of_conditions.css.scss +4 -0
- data/app/assets/stylesheets/raffle_v1/translation_keys.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/translation_objects.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/ui.multiselect.css +33 -0
- data/app/assets/stylesheets/raffle_v1/ui.multiselect.css.scss +33 -0
- data/app/assets/stylesheets/raffle_v1/user.css.scss +3 -0
- data/app/assets/stylesheets/raffle_v1/versions.css.scss +3 -0
- data/app/controllers/raffle_v1/application_controller.rb +80 -0
- data/app/controllers/raffle_v1/home_controller.rb +15 -0
- data/app/controllers/raffle_v1/locales_controller.rb +87 -0
- data/app/controllers/raffle_v1/page_layouts_controller.rb +87 -0
- data/app/controllers/raffle_v1/pages_controller.rb +180 -0
- data/app/controllers/raffle_v1/programs_controller.rb +140 -0
- data/app/controllers/raffle_v1/roles_controller.rb +87 -0
- data/app/controllers/raffle_v1/stylesheets_controller.rb +19 -0
- data/app/controllers/raffle_v1/terms_and_conditions_controller.rb +118 -0
- data/app/controllers/raffle_v1/translation_keys_controller.rb +119 -0
- data/app/controllers/raffle_v1/translation_objects_controller.rb +87 -0
- data/app/controllers/raffle_v1/user_controller.rb +138 -0
- data/app/controllers/raffle_v1/versions_controller.rb +15 -0
- data/app/models/raffle_v1/ability.rb +30 -0
- data/app/models/raffle_v1/admin.rb +35 -0
- data/app/models/raffle_v1/admin_ability.rb +28 -0
- data/app/models/raffle_v1/locale.rb +29 -0
- data/app/models/raffle_v1/page.rb +26 -0
- data/app/models/raffle_v1/page_layout.rb +6 -0
- data/app/models/raffle_v1/program.rb +84 -0
- data/app/models/raffle_v1/program_locale.rb +11 -0
- data/app/models/raffle_v1/program_setting.rb +5 -0
- data/app/models/raffle_v1/role.rb +5 -0
- data/app/models/raffle_v1/roles_users.rb +5 -0
- data/app/models/raffle_v1/stylesheet.rb +9 -0
- data/app/models/raffle_v1/terms_and_condition.rb +17 -0
- data/app/models/raffle_v1/translation.rb +29 -0
- data/app/models/raffle_v1/translation_key.rb +35 -0
- data/app/models/raffle_v1/translation_object.rb +11 -0
- data/app/models/raffle_v1/user.rb +108 -0
- data/config/rafflev1.rb +6 -0
- data/db/migrate/20130123214645_devise_create_users.rb +49 -0
- data/db/migrate/20130124004626_devise_create_admins.rb +49 -0
- data/db/migrate/20130124231541_create_versions.rb +18 -0
- data/db/migrate/20130127235347_create_programs.rb +9 -0
- data/db/migrate/20130129155515_add_domain_fields_to_programs.rb +6 -0
- data/db/migrate/20130129160949_create_terms_and_conditions.rb +18 -0
- data/db/migrate/20130129183112_add_program_to_users.rb +5 -0
- data/db/migrate/20130129204204_add_username_to_users.rb +6 -0
- data/db/migrate/20130129211205_create_roles.rb +9 -0
- data/db/migrate/20130129212302_create_roles_users.rb +12 -0
- data/db/migrate/20130130013315_create_locales.rb +11 -0
- data/db/migrate/20130130154500_create_program_locales.rb +8 -0
- data/db/migrate/20130130223342_add_settings_to_users.rb +5 -0
- data/db/migrate/20130130223609_add_locale_available_to_program.rb +5 -0
- data/db/migrate/20130130223810_add_locales_to_versions.rb +5 -0
- data/db/migrate/20130130224141_add_locale_name_to_program.rb +5 -0
- data/db/migrate/20130130224327_add_admin_type_to_admins.rb +5 -0
- data/db/migrate/20130130225223_add_deleted_at_to_models.rb +9 -0
- data/db/migrate/20130130230516_create_translations.rb +13 -0
- data/db/migrate/20130131005653_add_timeout_field_to_program.rb +7 -0
- data/db/migrate/20130131144951_create_stylesheets.rb +14 -0
- data/db/migrate/20130202132442_add_tos_to_program.rb +5 -0
- data/db/migrate/20130202133149_add_programid_to_terms.rb +23 -0
- data/db/migrate/20130202193646_add_akm_to_terms_and_conditions.rb +5 -0
- data/db/migrate/20130203035054_create_translation_keys.rb +10 -0
- data/db/migrate/20130203214314_create_program_settings.rb +9 -0
- data/db/migrate/20130204025824_add_translationkey_to_translation.rb +5 -0
- data/db/migrate/20130204030555_create_translation_objects.rb +39 -0
- data/db/migrate/20130205203152_create_pages.rb +25 -0
- data/db/migrate/20130208042652_add_fields_to_page.rb +6 -0
- data/db/migrate/20130208043123_create_page_layouts.rb +12 -0
- data/db/migrate/20130208051925_add_statusitem_to_page.rb +5 -0
- data/db/migrate/20130306012135_add_fields_to_user.rb +40 -0
- data/db/migrate/20130306162357_change_bad_fields_on_user.rb +11 -0
- data/db/migrate/20130306163554_add_password_created_at_to_user.rb +6 -0
- data/db/migrate/20130306165455_add_confirmable_to_user.rb +14 -0
- data/db/migrate/20130306211253_add_username_index_to_user.rb +41 -0
- data/db/migrate/20130313011833_add_field_to_user.rb +5 -0
- data/lib/database_cleaner-0.7.2/Gemfile.lock +163 -0
- data/lib/database_cleaner-0.7.2/History.txt +209 -0
- data/lib/database_cleaner-0.7.2/LICENSE +20 -0
- data/lib/database_cleaner-0.7.2/README.textile +223 -0
- data/lib/database_cleaner-0.7.2/Rakefile +65 -0
- data/lib/database_cleaner-0.7.2/TODO +3 -0
- data/lib/database_cleaner-0.7.2/VERSION.yml +5 -0
- data/lib/database_cleaner-0.7.2/cucumber.yml +1 -0
- data/lib/database_cleaner-0.7.2/examples/Gemfile +49 -0
- data/lib/database_cleaner-0.7.2/examples/Gemfile.lock +163 -0
- data/lib/database_cleaner-0.7.2/examples/config/database.yml.example +8 -0
- data/{test/dummy/db/test.sqlite3 → lib/database_cleaner-0.7.2/examples/db/sqlite_databases_go_here} +0 -0
- data/lib/database_cleaner-0.7.2/examples/features/example.feature +11 -0
- data/lib/database_cleaner-0.7.2/examples/features/example_multiple_db.feature +23 -0
- data/lib/database_cleaner-0.7.2/examples/features/example_multiple_orm.feature +22 -0
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/activerecord_steps.rb +31 -0
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/couchpotato_steps.rb +31 -0
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/datamapper_steps.rb +37 -0
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/mongoid_steps.rb +23 -0
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/mongomapper_steps.rb +31 -0
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/translation_steps.rb +55 -0
- data/lib/database_cleaner-0.7.2/examples/features/support/env.rb +62 -0
- data/lib/database_cleaner-0.7.2/examples/lib/activerecord_models.rb +41 -0
- data/lib/database_cleaner-0.7.2/examples/lib/couchpotato_models.rb +61 -0
- data/lib/database_cleaner-0.7.2/examples/lib/datamapper_models.rb +50 -0
- data/lib/database_cleaner-0.7.2/examples/lib/mongoid_models.rb +49 -0
- data/lib/database_cleaner-0.7.2/examples/lib/mongomapper_models.rb +51 -0
- data/lib/database_cleaner-0.7.2/features/cleaning.feature +22 -0
- data/lib/database_cleaner-0.7.2/features/cleaning_default_strategy.feature +19 -0
- data/lib/database_cleaner-0.7.2/features/cleaning_multiple_dbs.feature +21 -0
- data/lib/database_cleaner-0.7.2/features/cleaning_multiple_orms.feature +29 -0
- data/lib/database_cleaner-0.7.2/features/step_definitions/database_cleaner_steps.rb +32 -0
- data/lib/database_cleaner-0.7.2/features/support/env.rb +7 -0
- data/lib/database_cleaner-0.7.2/features/support/feature_runner.rb +39 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner.rb +3 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/active_record/base.rb +53 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/active_record/deletion.rb +69 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/active_record/transaction.rb +28 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/active_record/truncation.rb +151 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/base.rb +138 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/configuration.rb +94 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/couch_potato/base.rb +7 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/couch_potato/truncation.rb +28 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/cucumber.rb +11 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/data_mapper/base.rb +21 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/data_mapper/transaction.rb +26 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/data_mapper/truncation.rb +175 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/generic/base.rb +20 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/generic/truncation.rb +37 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongo/truncation.rb +22 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongo_mapper/base.rb +20 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongo_mapper/truncation.rb +19 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongoid/base.rb +20 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongoid/truncation.rb +20 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/null_strategy.rb +15 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/sequel/base.rb +22 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb +25 -0
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/sequel/truncation.rb +50 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/active_record/base_spec.rb +144 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/active_record/transaction_spec.rb +77 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/active_record/truncation_spec.rb +76 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/base_spec.rb +493 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/configuration_spec.rb +294 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb +41 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/data_mapper/base_spec.rb +30 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/data_mapper/transaction_spec.rb +23 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/data_mapper/truncation_spec.rb +11 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/generic/base_spec.rb +22 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/generic/truncation_spec.rb +78 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/mongo_mapper/base_spec.rb +33 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/mongo_mapper/mongo_examples.rb +8 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/mongo_mapper/truncation_spec.rb +74 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/sequel/base_spec.rb +32 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/sequel/transaction_spec.rb +21 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/sequel/truncation_spec.rb +13 -0
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/shared_strategy_spec.rb +13 -0
- data/lib/database_cleaner-0.7.2/spec/rcov.opts +1 -0
- data/lib/database_cleaner-0.7.2/spec/spec.opts +7 -0
- data/lib/database_cleaner-0.7.2/spec/spec_helper.rb +19 -0
- data/lib/generators/raffle_v1/install/USAGE +8 -0
- data/lib/generators/raffle_v1/install/install_generator.rb +2 -2
- data/lib/raffle_v1/version.rb +1 -1
- metadata +266 -80
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -1304
- data/test/dummy/tmp/cache/assets/CA9/000/sprockets%2F4a08cdc7528358910b09a742236ce1d5 +0 -0
- data/test/dummy/tmp/cache/assets/CB2/BD0/sprockets%2F85aac33f66112e73231ea0779f646d48 +0 -0
- data/test/dummy/tmp/cache/assets/CC8/930/sprockets%2Ff75c059e31f23788564cdeb37454997a +0 -0
- data/test/dummy/tmp/cache/assets/CEF/E80/sprockets%2Fd1d95274bb399cd78c4372bc6330679f +0 -0
- data/test/dummy/tmp/cache/assets/D00/C30/sprockets%2F7d453e5233c35cc0664189bd1c060dca +0 -0
- data/test/dummy/tmp/cache/assets/D06/390/sprockets%2F2db5f5807daaf42647f3f1614b2061c7 +0 -0
- data/test/dummy/tmp/cache/assets/D06/5C0/sprockets%2F10f71b69148321ca26d0bb94df09ed46 +0 -0
- data/test/dummy/tmp/cache/assets/D1E/8D0/sprockets%2Fd0f3965813d75eefebe5353981159cb3 +0 -0
- data/test/dummy/tmp/cache/assets/D35/FB0/sprockets%2Ff706372b7e19b270321cbce180d7edd3 +0 -0
- data/test/dummy/tmp/cache/assets/D49/1E0/sprockets%2F1c8eb9a82d46a60faa9b194282db8976 +0 -0
- data/test/dummy/tmp/cache/assets/D67/FA0/sprockets%2F3072f540a4a5f4af3636dc9cee4bd821 +0 -0
- data/test/dummy/tmp/cache/assets/D76/180/sprockets%2Fe06d9366092cba68641ddefa60cb5e97 +0 -0
- data/test/dummy/tmp/cache/assets/D9B/470/sprockets%2Fb7bb6ac37b3929f36a390e4f5b70aec3 +0 -0
- data/test/dummy/tmp/cache/assets/D9F/080/sprockets%2F67fdbee8438ea0fdd3406c4f3b277a14 +0 -0
- data/test/dummy/tmp/cache/assets/DCD/970/sprockets%2Fb3d4eb65c6d389bff1cb035a7c4e74d2 +0 -0
- data/test/dummy/tmp/cache/assets/DD2/7D0/sprockets%2F6d8fc01a6bd28f831fdbe625ea56f2c7 +0 -0
- data/test/dummy/tmp/cache/assets/DF1/CA0/sprockets%2Faa2be5b854dacdce2a30a0fff7412887 +0 -0
- data/test/dummy/tmp/cache/assets/E0B/E40/sprockets%2F96b1b0fa8f4feee3299fc9dcd2078d0d +0 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
require_dependency "raffle_v1/application_controller"
|
2
|
+
|
3
|
+
module RaffleV1
|
4
|
+
class PageLayoutsController < ApplicationController
|
5
|
+
# GET /page_layouts
|
6
|
+
# GET /page_layouts.json
|
7
|
+
def index
|
8
|
+
@page_layouts = PageLayout.all
|
9
|
+
|
10
|
+
respond_to do |format|
|
11
|
+
format.html # index.html.erb
|
12
|
+
format.json { render json: @page_layouts }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /page_layouts/1
|
17
|
+
# GET /page_layouts/1.json
|
18
|
+
def show
|
19
|
+
@page_layout = PageLayout.find(params[:id])
|
20
|
+
|
21
|
+
respond_to do |format|
|
22
|
+
format.html # show.html.erb
|
23
|
+
format.json { render json: @page_layout }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# GET /page_layouts/new
|
28
|
+
# GET /page_layouts/new.json
|
29
|
+
def new
|
30
|
+
@page_layout = PageLayout.new
|
31
|
+
|
32
|
+
respond_to do |format|
|
33
|
+
format.html # new.html.erb
|
34
|
+
format.json { render json: @page_layout }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# GET /page_layouts/1/edit
|
39
|
+
def edit
|
40
|
+
@page_layout = PageLayout.find(params[:id])
|
41
|
+
end
|
42
|
+
|
43
|
+
# POST /page_layouts
|
44
|
+
# POST /page_layouts.json
|
45
|
+
def create
|
46
|
+
@page_layout = PageLayout.new(params[:page_layout])
|
47
|
+
|
48
|
+
respond_to do |format|
|
49
|
+
if @page_layout.save
|
50
|
+
format.html { redirect_to @page_layout, notice: 'Page layout was successfully created.' }
|
51
|
+
format.json { render json: @page_layout, status: :created, location: @page_layout }
|
52
|
+
else
|
53
|
+
format.html { render action: "new" }
|
54
|
+
format.json { render json: @page_layout.errors, status: :unprocessable_entity }
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# PUT /page_layouts/1
|
60
|
+
# PUT /page_layouts/1.json
|
61
|
+
def update
|
62
|
+
@page_layout = PageLayout.find(params[:id])
|
63
|
+
|
64
|
+
respond_to do |format|
|
65
|
+
if @page_layout.update_attributes(params[:page_layout])
|
66
|
+
format.html { redirect_to @page_layout, notice: 'Page layout was successfully updated.' }
|
67
|
+
format.json { head :no_content }
|
68
|
+
else
|
69
|
+
format.html { render action: "edit" }
|
70
|
+
format.json { render json: @page_layout.errors, status: :unprocessable_entity }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# DELETE /page_layouts/1
|
76
|
+
# DELETE /page_layouts/1.json
|
77
|
+
def destroy
|
78
|
+
@page_layout = PageLayout.find(params[:id])
|
79
|
+
@page_layout.destroy
|
80
|
+
|
81
|
+
respond_to do |format|
|
82
|
+
format.html { redirect_to page_layouts_url }
|
83
|
+
format.json { head :no_content }
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,180 @@
|
|
1
|
+
require_dependency "raffle_v1/application_controller"
|
2
|
+
|
3
|
+
module RaffleV1
|
4
|
+
class PagesController < ApplicationController
|
5
|
+
load_and_authorize_resource
|
6
|
+
|
7
|
+
def index
|
8
|
+
if !params[:page_filter].nil? && !params[:page_filter][:type].empty?
|
9
|
+
@pages = @current_program.pages.where("page_type = ?", params[:page_filter][:type])
|
10
|
+
else
|
11
|
+
@pages = @current_program.pages.all
|
12
|
+
end
|
13
|
+
|
14
|
+
respond_to do |format|
|
15
|
+
format.html # index.html.erb
|
16
|
+
format.json { render json: @pages }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def show
|
21
|
+
@page = Page.find(params[:id])
|
22
|
+
|
23
|
+
respond_to do |format|
|
24
|
+
format.html # show.html.erb
|
25
|
+
format.json { render json: @page }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def new
|
30
|
+
@page = Page.new
|
31
|
+
|
32
|
+
respond_to do |format|
|
33
|
+
format.html # new.html.erb
|
34
|
+
format.json { render json: @page }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def edit
|
39
|
+
@page = Page.find(params[:id])
|
40
|
+
@status = @page.item_status
|
41
|
+
@header = @page.header
|
42
|
+
@footer = @page.footer
|
43
|
+
@nav = @page.nav
|
44
|
+
@type = @page.page_type
|
45
|
+
end
|
46
|
+
|
47
|
+
def create
|
48
|
+
@page = Page.new(params[:page])
|
49
|
+
@page.program_id = @current_program.id
|
50
|
+
|
51
|
+
preDefined = @current_program.pages.where(page_type: "Pre-Defined").first
|
52
|
+
if params[:page][:page_type] == "Pre-Defined" && preDefined.present?
|
53
|
+
flash[:notice] = "Pre-Defined page already exist."
|
54
|
+
render :new
|
55
|
+
return
|
56
|
+
end
|
57
|
+
|
58
|
+
if params[:preview_button] || !@page.save
|
59
|
+
render :action => 'new'
|
60
|
+
return
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
if @page.item_status == 'archive'
|
65
|
+
@page.archived = true
|
66
|
+
end
|
67
|
+
|
68
|
+
params[:page][:translations_attributes].each do |t|
|
69
|
+
t = t[1]
|
70
|
+
doc = Nokogiri::HTML(t[:body])
|
71
|
+
doc.xpath("//text()").remove
|
72
|
+
t[:body] = doc.to_s
|
73
|
+
end
|
74
|
+
|
75
|
+
respond_to do |format|
|
76
|
+
if @page.save
|
77
|
+
save_reach @page
|
78
|
+
if params[:button] == 'save_and_continue'
|
79
|
+
format.html { redirect_to edit_page_path(@page), notice: "Page was successfully created." }
|
80
|
+
else
|
81
|
+
format.html { redirect_to @page, notice: 'Page was successfully created.' }
|
82
|
+
end
|
83
|
+
|
84
|
+
format.json { render json: @page, status: :created, location: @page }
|
85
|
+
else
|
86
|
+
format.html { render action: "new" }
|
87
|
+
format.json { render json: @page.errors, status: :unprocessable_entity }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def update
|
93
|
+
@page = Page.find(params[:id])
|
94
|
+
|
95
|
+
if params[:page][:item_status] == 'archived'
|
96
|
+
@page.archived = true
|
97
|
+
end
|
98
|
+
|
99
|
+
respond_to do |format|
|
100
|
+
if @page.update_attributes(params[:page])
|
101
|
+
save_reach @page
|
102
|
+
if params[:button] == 'save_and_continue'
|
103
|
+
format.html { redirect_to edit_page_path(@page), notice: "Page was successfully created." }
|
104
|
+
else
|
105
|
+
format.html { redirect_to @page, notice: 'Page was successfully created.' }
|
106
|
+
end
|
107
|
+
format.json { head :no_content }
|
108
|
+
else
|
109
|
+
format.html { render action: "edit" }
|
110
|
+
format.json { render json: @page.errors, status: :unprocessable_entity }
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def destroy
|
116
|
+
@page = Page.find(params[:id])
|
117
|
+
@page.destroy
|
118
|
+
|
119
|
+
respond_to do |format|
|
120
|
+
format.html { redirect_to pages_url }
|
121
|
+
format.json { head :no_content }
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def action
|
126
|
+
if params[:button] == 'archive' && params[:page_ids]
|
127
|
+
archive
|
128
|
+
elsif params[:button] == 'publish' && params[:page_ids]
|
129
|
+
publish
|
130
|
+
elsif params[:button] == 'draft' && params[:page_ids]
|
131
|
+
draft
|
132
|
+
elsif params[:button] == 'remove' && params[:page_ids]
|
133
|
+
remove
|
134
|
+
else
|
135
|
+
redirect_to pages_url#, flash: "Article must be selected."
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def publish
|
140
|
+
@pages = Page.find(params[:page_ids])
|
141
|
+
@pages.each do |a|
|
142
|
+
a.update_attributes(publish_date: Date.today, archived: false, item_status: "active", expiration_date: Date.today + 5.days)
|
143
|
+
end
|
144
|
+
redirect_to pages_url#, flash: "pages published."
|
145
|
+
end
|
146
|
+
|
147
|
+
def archive
|
148
|
+
@pages = Page.find(params[:page_ids])
|
149
|
+
@pages.each do |a|
|
150
|
+
a.update_attributes(archived: true, item_status: 'archive')
|
151
|
+
end
|
152
|
+
redirect_to pages_url
|
153
|
+
end
|
154
|
+
|
155
|
+
def draft
|
156
|
+
@pages = Page.find(params[:page_ids])
|
157
|
+
@pages.each do |a|
|
158
|
+
a.update_attributes(item_status: 'draft')
|
159
|
+
end
|
160
|
+
redirect_to pages_url
|
161
|
+
end
|
162
|
+
|
163
|
+
def remove
|
164
|
+
@pages = Page.find(params[:page_ids])
|
165
|
+
@pages.each do |a|
|
166
|
+
a.destroy
|
167
|
+
end
|
168
|
+
|
169
|
+
respond_to do |format|
|
170
|
+
format.html { redirect_to pages_url }
|
171
|
+
format.json { head :no_content }
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def find_page_info
|
176
|
+
page = Page.find(params[:page_id])
|
177
|
+
render json: { title: page.translation_for(I18n.locale).title, body: page.translation_for(I18n.locale).body }
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
require_dependency "raffle_v1/application_controller"
|
2
|
+
|
3
|
+
module RaffleV1
|
4
|
+
class ProgramsController < ApplicationController
|
5
|
+
before_filter :clean_select_multiple_params
|
6
|
+
before_filter :password_strength, only: [:update]
|
7
|
+
load_and_authorize_resource except: [:log_history]
|
8
|
+
skip_authorization_check [:log_history]
|
9
|
+
authorize_resource :class => false
|
10
|
+
|
11
|
+
# GET /programs
|
12
|
+
# GET /programs.json
|
13
|
+
def index
|
14
|
+
authorize! :index, Program unless user_signed_in?
|
15
|
+
@q = Program.search(params[:q])
|
16
|
+
@programs = @q.result(:distinct => true)
|
17
|
+
|
18
|
+
respond_to do |format|
|
19
|
+
format.html # index.html.erb
|
20
|
+
format.json { render json: @programs }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /programs/1
|
25
|
+
# GET /programs/1.json
|
26
|
+
def show
|
27
|
+
@program = Program.find(params[:id])
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # show.html.erb
|
31
|
+
format.json { render json: @program }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def summary
|
36
|
+
@program = Program.new
|
37
|
+
|
38
|
+
respond_to do |format|
|
39
|
+
format.html
|
40
|
+
format.json {render json: @program }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# GET /programs/new
|
45
|
+
# GET /programs/new.json
|
46
|
+
def new
|
47
|
+
@program = Program.new
|
48
|
+
|
49
|
+
respond_to do |format|
|
50
|
+
format.html # new.html.erb
|
51
|
+
format.json { render json: @program }
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# GET /programs/1/edit
|
56
|
+
def edit
|
57
|
+
@program = Program.find(params[:id])
|
58
|
+
if @current_programt.nil? && admin_signed_in?
|
59
|
+
@current_program = @program
|
60
|
+
end
|
61
|
+
initialize_components
|
62
|
+
@term = @program.terms_and_condition
|
63
|
+
@pass_str = @program.password_strength
|
64
|
+
@program_locales = @current_program.locales.map{|x| x.id}
|
65
|
+
|
66
|
+
#loading all required from db column
|
67
|
+
@selected = YAML.load(@program.user_requirements) if @program.user_requirements.present?
|
68
|
+
@search_fields = YAML.load(@program.search_fields) if @program.search _fields.presents?
|
69
|
+
@adv_search_fields = YAML.load(@program.advance_search_fields) if @program.advance_search_fields.present?
|
70
|
+
end
|
71
|
+
|
72
|
+
# POST /programs
|
73
|
+
# POST /programs.json
|
74
|
+
def create
|
75
|
+
@program = Program.new(params[:program])
|
76
|
+
@locale = @program.locales.build
|
77
|
+
@program_locales = params[:program][:locale_ids]
|
78
|
+
@theme_setting_id = params[:program][:theme_settings_ids]
|
79
|
+
@selected = params[:program][:user_requirements]
|
80
|
+
params[:program][:advanced_search_fields].reject!{|x| x.blank? }
|
81
|
+
|
82
|
+
respond_to do |format|
|
83
|
+
if @program.save
|
84
|
+
@program.create_default_theme_setting(@theme_setting_id)
|
85
|
+
format.html { redirect_to @program, notice: 'Program was successfully created.' }
|
86
|
+
format.json { render json: @program, status: :created, location: @program }
|
87
|
+
else
|
88
|
+
format.html { render action: "new" }
|
89
|
+
format.json { render json: @program.errors, status: :unprocessable_entity }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# PUT /programs/1
|
95
|
+
# PUT /programs/1.json
|
96
|
+
def update
|
97
|
+
@program = Program.find(params[:id])
|
98
|
+
|
99
|
+
respond_to do |format|
|
100
|
+
if @program.update_attributes(params[:program])
|
101
|
+
format.html { redirect_to @program, notice: 'Program was successfully updated.' }
|
102
|
+
format.json { head :no_content }
|
103
|
+
else
|
104
|
+
format.html { render action: "edit" }
|
105
|
+
format.json { render json: @program.errors, status: :unprocessable_entity }
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# DELETE /programs/1
|
111
|
+
# DELETE /programs/1.json
|
112
|
+
def destroy
|
113
|
+
@program = Program.find(params[:id])
|
114
|
+
@program.destroy
|
115
|
+
|
116
|
+
respond_to do |format|
|
117
|
+
format.html { redirect_to programs_url }
|
118
|
+
format.json { head :no_content }
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
#Method to retrieve the log in history, per program
|
123
|
+
def log_history
|
124
|
+
if !@current_program.nil?
|
125
|
+
users = User.where("#{User.table_name}.program_id = ?", @current_program.id)
|
126
|
+
@logs = UserLogHistory.where("user_id IN (?)", users)
|
127
|
+
else
|
128
|
+
if(admin_signed_in? && !params[:id].nil?)
|
129
|
+
users = User.where("#{User.table_name}.program_id = ?", params[:id])
|
130
|
+
@logs = UserLogHistory.where("user_id IN (?)", users)
|
131
|
+
if users.empty?
|
132
|
+
redirect_to "/"
|
133
|
+
end
|
134
|
+
else
|
135
|
+
redirect_to "/"
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require_dependency "raffle_v1/application_controller"
|
2
|
+
|
3
|
+
module RaffleV1
|
4
|
+
class RolesController < ApplicationController
|
5
|
+
# GET /roles
|
6
|
+
# GET /roles.json
|
7
|
+
def index
|
8
|
+
@roles = Role.all
|
9
|
+
|
10
|
+
respond_to do |format|
|
11
|
+
format.html # index.html.erb
|
12
|
+
format.json { render json: @roles }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /roles/1
|
17
|
+
# GET /roles/1.json
|
18
|
+
def show
|
19
|
+
@role = Role.find(params[:id])
|
20
|
+
|
21
|
+
respond_to do |format|
|
22
|
+
format.html # show.html.erb
|
23
|
+
format.json { render json: @role }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# GET /roles/new
|
28
|
+
# GET /roles/new.json
|
29
|
+
def new
|
30
|
+
@role = Role.new
|
31
|
+
|
32
|
+
respond_to do |format|
|
33
|
+
format.html # new.html.erb
|
34
|
+
format.json { render json: @role }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# GET /roles/1/edit
|
39
|
+
def edit
|
40
|
+
@role = Role.find(params[:id])
|
41
|
+
end
|
42
|
+
|
43
|
+
# POST /roles
|
44
|
+
# POST /roles.json
|
45
|
+
def create
|
46
|
+
@role = Role.new(params[:role])
|
47
|
+
|
48
|
+
respond_to do |format|
|
49
|
+
if @role.save
|
50
|
+
format.html { redirect_to @role, notice: 'Role was successfully created.' }
|
51
|
+
format.json { render json: @role, status: :created, location: @role }
|
52
|
+
else
|
53
|
+
format.html { render action: "new" }
|
54
|
+
format.json { render json: @role.errors, status: :unprocessable_entity }
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# PUT /roles/1
|
60
|
+
# PUT /roles/1.json
|
61
|
+
def update
|
62
|
+
@role = Role.find(params[:id])
|
63
|
+
|
64
|
+
respond_to do |format|
|
65
|
+
if @role.update_attributes(params[:role])
|
66
|
+
format.html { redirect_to @role, notice: 'Role was successfully updated.' }
|
67
|
+
format.json { head :no_content }
|
68
|
+
else
|
69
|
+
format.html { render action: "edit" }
|
70
|
+
format.json { render json: @role.errors, status: :unprocessable_entity }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# DELETE /roles/1
|
76
|
+
# DELETE /roles/1.json
|
77
|
+
def destroy
|
78
|
+
@role = Role.find(params[:id])
|
79
|
+
@role.destroy
|
80
|
+
|
81
|
+
respond_to do |format|
|
82
|
+
format.html { redirect_to roles_url }
|
83
|
+
format.json { head :no_content }
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|