trusty-festivity-extension 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +33 -0
  4. data/README.md +2 -0
  5. data/Rakefile +110 -0
  6. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  7. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +288 -0
  8. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  9. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  10. data/app/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  11. data/app/assets/images/pct-black.png +0 -0
  12. data/app/assets/images/skins/pghkids/footer.png +0 -0
  13. data/app/assets/images/skins/pghkids/footer_mobile.png +0 -0
  14. data/app/assets/images/skins/pghkids/frog.png +0 -0
  15. data/app/assets/images/skins/pghkids/frog_mobile.png +0 -0
  16. data/app/assets/images/skins/pghkids/header.png +0 -0
  17. data/app/assets/images/skins/pghkids/header_mobile.png +0 -0
  18. data/app/assets/images/skins/pghkids/seafoam.jpg +0 -0
  19. data/app/assets/javascripts/admin/festivity_admin.js +22 -0
  20. data/app/assets/javascripts/admin/pages/ajax_image_uploader.js +29 -0
  21. data/app/assets/javascripts/admin/pages/page_bindings.js +94 -0
  22. data/app/assets/javascripts/admin/pages/performances.js +59 -0
  23. data/app/assets/javascripts/admin/sites/categories.js +74 -0
  24. data/app/assets/javascripts/admin/sites/category_types.js +63 -0
  25. data/app/assets/javascripts/admin/sites/site_bindings.js +4 -0
  26. data/app/assets/javascripts/ajaxupload.js +1 -0
  27. data/app/assets/javascripts/bootstrap-sprockets.js +12 -0
  28. data/app/assets/javascripts/bootstrap.js +2306 -0
  29. data/app/assets/javascripts/bootstrap.min.js +7 -0
  30. data/app/assets/javascripts/bootstrap/affix.js +162 -0
  31. data/app/assets/javascripts/bootstrap/alert.js +94 -0
  32. data/app/assets/javascripts/bootstrap/button.js +116 -0
  33. data/app/assets/javascripts/bootstrap/carousel.js +237 -0
  34. data/app/assets/javascripts/bootstrap/collapse.js +211 -0
  35. data/app/assets/javascripts/bootstrap/dropdown.js +161 -0
  36. data/app/assets/javascripts/bootstrap/modal.js +324 -0
  37. data/app/assets/javascripts/bootstrap/popover.js +113 -0
  38. data/app/assets/javascripts/bootstrap/scrollspy.js +175 -0
  39. data/app/assets/javascripts/bootstrap/tab.js +153 -0
  40. data/app/assets/javascripts/bootstrap/tooltip.js +472 -0
  41. data/app/assets/javascripts/bootstrap/transition.js +59 -0
  42. data/app/assets/javascripts/events/event_list_bindings.js +3 -0
  43. data/app/assets/javascripts/events/filters.js +100 -0
  44. data/app/assets/javascripts/festivity.js +1 -0
  45. data/app/assets/javascripts/festivity_app.js +13 -0
  46. data/app/assets/javascripts/jasny-bootstrap.js +1024 -0
  47. data/app/assets/javascripts/jquery-migrate.js +521 -0
  48. data/app/assets/javascripts/jquery.collapse.js +176 -0
  49. data/app/assets/javascripts/jquery.collapse_cookie_storage.js +37 -0
  50. data/app/assets/javascripts/jquery.collapse_storage.js +56 -0
  51. data/app/assets/javascripts/jquery.inputmask.bundle.min.js +10 -0
  52. data/app/assets/javascripts/lodash.min.js +88 -0
  53. data/app/assets/javascripts/readmore.min.js +11 -0
  54. data/app/assets/javascripts/script.js +22 -0
  55. data/app/assets/javascripts/underscore.js +1545 -0
  56. data/app/assets/stylesheets/_bootstrap-compass.scss +9 -0
  57. data/app/assets/stylesheets/_bootstrap-mincer.scss +19 -0
  58. data/app/assets/stylesheets/_bootstrap-sprockets.scss +9 -0
  59. data/app/assets/stylesheets/_bootstrap.scss +50 -0
  60. data/app/assets/stylesheets/_defaults.scss +6 -0
  61. data/app/assets/stylesheets/_event_filter_bar.scss +78 -0
  62. data/app/assets/stylesheets/_faq.scss +48 -0
  63. data/app/assets/stylesheets/_filter-bar-mobile.scss +32 -0
  64. data/app/assets/stylesheets/_footer.scss +18 -0
  65. data/app/assets/stylesheets/_global.scss +30 -0
  66. data/app/assets/stylesheets/_header.scss +95 -0
  67. data/app/assets/stylesheets/_landing_page.scss +62 -0
  68. data/app/assets/stylesheets/_locations.scss +17 -0
  69. data/app/assets/stylesheets/_media-queries.scss +9 -0
  70. data/app/assets/stylesheets/_mixins.scss +17 -0
  71. data/app/assets/stylesheets/_nav.scss +128 -0
  72. data/app/assets/stylesheets/_normalize.scss +375 -0
  73. data/app/assets/stylesheets/_overrides.scss +11 -0
  74. data/app/assets/stylesheets/_page-template.scss +124 -0
  75. data/app/assets/stylesheets/_related_events.scss +20 -0
  76. data/app/assets/stylesheets/_search-results.scss +20 -0
  77. data/app/assets/stylesheets/_utils.scss +8 -0
  78. data/app/assets/stylesheets/admin/festivity_admin.scss +28 -0
  79. data/app/assets/stylesheets/admin/modules/_category_styles.scss +23 -0
  80. data/app/assets/stylesheets/admin/modules/_form_styles.scss +40 -0
  81. data/app/assets/stylesheets/admin/modules/_list_styles.scss +30 -0
  82. data/app/assets/stylesheets/admin/modules/_variables.scss +3 -0
  83. data/app/assets/stylesheets/bootstrap/_alerts.scss +73 -0
  84. data/app/assets/stylesheets/bootstrap/_badges.scss +67 -0
  85. data/app/assets/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
  86. data/app/assets/stylesheets/bootstrap/_button-groups.scss +243 -0
  87. data/app/assets/stylesheets/bootstrap/_buttons.scss +160 -0
  88. data/app/assets/stylesheets/bootstrap/_carousel.scss +269 -0
  89. data/app/assets/stylesheets/bootstrap/_close.scss +36 -0
  90. data/app/assets/stylesheets/bootstrap/_code.scss +69 -0
  91. data/app/assets/stylesheets/bootstrap/_component-animations.scss +38 -0
  92. data/app/assets/stylesheets/bootstrap/_dropdowns.scss +214 -0
  93. data/app/assets/stylesheets/bootstrap/_forms.scss +570 -0
  94. data/app/assets/stylesheets/bootstrap/_glyphicons.scss +301 -0
  95. data/app/assets/stylesheets/bootstrap/_grid.scss +84 -0
  96. data/app/assets/stylesheets/bootstrap/_input-groups.scss +166 -0
  97. data/app/assets/stylesheets/bootstrap/_jumbotron.scss +50 -0
  98. data/app/assets/stylesheets/bootstrap/_labels.scss +66 -0
  99. data/app/assets/stylesheets/bootstrap/_list-group.scss +124 -0
  100. data/app/assets/stylesheets/bootstrap/_media.scss +61 -0
  101. data/app/assets/stylesheets/bootstrap/_mixins.scss +39 -0
  102. data/app/assets/stylesheets/bootstrap/_modals.scss +148 -0
  103. data/app/assets/stylesheets/bootstrap/_navbar.scss +663 -0
  104. data/app/assets/stylesheets/bootstrap/_navs.scss +244 -0
  105. data/app/assets/stylesheets/bootstrap/_normalize.scss +427 -0
  106. data/app/assets/stylesheets/bootstrap/_pager.scss +54 -0
  107. data/app/assets/stylesheets/bootstrap/_pagination.scss +88 -0
  108. data/app/assets/stylesheets/bootstrap/_panels.scss +265 -0
  109. data/app/assets/stylesheets/bootstrap/_popovers.scss +135 -0
  110. data/app/assets/stylesheets/bootstrap/_print.scss +107 -0
  111. data/app/assets/stylesheets/bootstrap/_progress-bars.scss +87 -0
  112. data/app/assets/stylesheets/bootstrap/_responsive-embed.scss +35 -0
  113. data/app/assets/stylesheets/bootstrap/_responsive-utilities.scss +177 -0
  114. data/app/assets/stylesheets/bootstrap/_scaffolding.scss +150 -0
  115. data/app/assets/stylesheets/bootstrap/_tables.scss +234 -0
  116. data/app/assets/stylesheets/bootstrap/_theme.scss +273 -0
  117. data/app/assets/stylesheets/bootstrap/_thumbnails.scss +38 -0
  118. data/app/assets/stylesheets/bootstrap/_tooltip.scss +103 -0
  119. data/app/assets/stylesheets/bootstrap/_type.scss +298 -0
  120. data/app/assets/stylesheets/bootstrap/_utilities.scss +56 -0
  121. data/app/assets/stylesheets/bootstrap/_variables.scss +862 -0
  122. data/app/assets/stylesheets/bootstrap/_wells.scss +29 -0
  123. data/app/assets/stylesheets/bootstrap/mixins/_alerts.scss +14 -0
  124. data/app/assets/stylesheets/bootstrap/mixins/_background-variant.scss +11 -0
  125. data/app/assets/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  126. data/app/assets/stylesheets/bootstrap/mixins/_buttons.scss +52 -0
  127. data/app/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  128. data/app/assets/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  129. data/app/assets/stylesheets/bootstrap/mixins/_forms.scss +88 -0
  130. data/app/assets/stylesheets/bootstrap/mixins/_gradients.scss +58 -0
  131. data/app/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
  132. data/app/assets/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  133. data/app/assets/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  134. data/app/assets/stylesheets/bootstrap/mixins/_image.scss +33 -0
  135. data/app/assets/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  136. data/app/assets/stylesheets/bootstrap/mixins/_list-group.scss +31 -0
  137. data/app/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  138. data/app/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  139. data/app/assets/stylesheets/bootstrap/mixins/_opacity.scss +8 -0
  140. data/app/assets/stylesheets/bootstrap/mixins/_pagination.scss +23 -0
  141. data/app/assets/stylesheets/bootstrap/mixins/_panels.scss +24 -0
  142. data/app/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +10 -0
  143. data/app/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  144. data/app/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  145. data/app/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +21 -0
  146. data/app/assets/stylesheets/bootstrap/mixins/_size.scss +10 -0
  147. data/app/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  148. data/app/assets/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  149. data/app/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +11 -0
  150. data/app/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  151. data/app/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +222 -0
  152. data/app/assets/stylesheets/events/_event-list-item.scss +85 -0
  153. data/app/assets/stylesheets/events/_event_template.scss +66 -0
  154. data/app/assets/stylesheets/events/_filter-bar.scss +5 -0
  155. data/app/assets/stylesheets/festivity.scss +35 -0
  156. data/app/assets/stylesheets/skins/pghkids/_events.scss +17 -0
  157. data/app/assets/stylesheets/skins/pghkids/_footer.scss +22 -0
  158. data/app/assets/stylesheets/skins/pghkids/_global.scss +42 -0
  159. data/app/assets/stylesheets/skins/pghkids/_header.scss +27 -0
  160. data/app/assets/stylesheets/skins/pghkids/_home.scss +113 -0
  161. data/app/assets/stylesheets/skins/pghkids/skin.scss +8 -0
  162. data/app/assets/stylesheets/vars/_vars_color.scss +6 -0
  163. data/app/assets/stylesheets/vars/_vars_media-queries.scss +5 -0
  164. data/app/assets/stylesheets/vars/_vars_type.scss +1 -0
  165. data/app/controllers/admin/festivity_categories_controller.rb +31 -0
  166. data/app/controllers/admin/festivity_category_types_controller.rb +31 -0
  167. data/app/controllers/admin/festivity_performances_controller.rb +21 -0
  168. data/app/controllers/festivity_events_controller.rb +71 -0
  169. data/app/controllers/festivity_location_areas_controller.rb +17 -0
  170. data/app/controllers/festivity_locations_controller.rb +19 -0
  171. data/app/controllers/search_controller.rb +17 -0
  172. data/app/helpers/admin/festivity_performances_helper.rb +3 -0
  173. data/app/helpers/admin/snippets_helper.rb +3 -0
  174. data/app/helpers/festivity_events_helper.rb +12 -0
  175. data/app/helpers/festivity_locations_helper.rb +4 -0
  176. data/app/models/festivity_base_page.rb +23 -0
  177. data/app/models/festivity_category.rb +17 -0
  178. data/app/models/festivity_category_type.rb +14 -0
  179. data/app/models/festivity_event_list.rb +90 -0
  180. data/app/models/festivity_event_list/festivity_event.rb +40 -0
  181. data/app/models/festivity_event_list/festivity_event_performance.rb +10 -0
  182. data/app/models/festivity_event_list/festivity_location.rb +15 -0
  183. data/app/models/festivity_event_page.rb +55 -0
  184. data/app/models/festivity_location_area_page.rb +5 -0
  185. data/app/models/festivity_location_page.rb +3 -0
  186. data/app/models/festivity_market_page.rb +3 -0
  187. data/app/models/festivity_page_category.rb +4 -0
  188. data/app/models/festivity_performance.rb +29 -0
  189. data/app/views/admin/pages/_festivity_base_fields.html.haml +75 -0
  190. data/app/views/admin/pages/_festivity_featured_image_fields.html.haml +3 -0
  191. data/app/views/admin/pages/_festivity_includes.html.haml +2 -0
  192. data/app/views/admin/pages/_festivity_location_fields.html.haml +26 -0
  193. data/app/views/admin/pages/partials/_categories.html.haml +18 -0
  194. data/app/views/admin/pages/partials/_category.html.haml +4 -0
  195. data/app/views/admin/pages/partials/_featured_image.html.haml +18 -0
  196. data/app/views/admin/pages/partials/_performance.html.haml +13 -0
  197. data/app/views/admin/pages/partials/_performances.html.haml +11 -0
  198. data/app/views/admin/pages/partials/_performances_table.html.haml +15 -0
  199. data/app/views/admin/sites/_festivity_site_fields.html.haml +26 -0
  200. data/app/views/admin/sites/partials/_category.html.haml +7 -0
  201. data/app/views/admin/sites/partials/_category_popup.html.haml +19 -0
  202. data/app/views/admin/sites/partials/_category_popups.haml +27 -0
  203. data/app/views/admin/sites/partials/_category_section.html.haml +7 -0
  204. data/app/views/admin/sites/partials/_category_types.html.haml +23 -0
  205. data/app/views/admin/sites/partials/_filters.html.haml +25 -0
  206. data/app/views/admin/sites/partials/_new_category.html.haml +3 -0
  207. data/app/views/admin/sites/partials/_new_category_type.html.haml +3 -0
  208. data/app/views/festivity_events/_event_filters.html.haml +39 -0
  209. data/app/views/festivity_events/_event_list.html.haml +62 -0
  210. data/app/views/festivity_events/_filter_bar_mobile.html.haml +22 -0
  211. data/app/views/festivity_events/index.html.haml +34 -0
  212. data/app/views/festivity_events/show.html.haml +152 -0
  213. data/app/views/festivity_location_areas/show.html.haml +29 -0
  214. data/app/views/festivity_locations/show.html.haml +66 -0
  215. data/app/views/header/_meta_tags.html.haml +8 -0
  216. data/app/views/navigation/_subnav_one_column.html.haml +15 -0
  217. data/app/views/navigation/_subnav_three_column.html.haml +7 -0
  218. data/app/views/navigation/_three_column_item.html.haml +11 -0
  219. data/app/views/search/_page.html.haml +1 -0
  220. data/app/views/search/_pagination_links.html.haml +7 -0
  221. data/app/views/search/_result_item.html.haml +6 -0
  222. data/app/views/search/show.html.haml +19 -0
  223. data/config/initializers/pluralizations.rb +0 -0
  224. data/config/initializers/radiant_config.rb +1 -0
  225. data/config/locales/en.yml +16 -0
  226. data/config/routes.rb +14 -0
  227. data/config/trustygems.yml +2 -0
  228. data/db/content/layouts/base.html +174 -0
  229. data/db/content/layouts/normal.html +5 -0
  230. data/db/fixtures/home_pages.yml +40 -0
  231. data/db/fixtures/layouts.yml +2 -0
  232. data/db/fixtures/pages.yml +23 -0
  233. data/db/fixtures/sites.yml +57 -0
  234. data/db/fixtures/users.yml +8 -0
  235. data/db/migrate/200150325136087799_add_event_performances_view.rb +27 -0
  236. data/db/migrate/200150425136087799_update_event_performances_view_with_site.rb +27 -0
  237. data/db/migrate/20150123175758_add_site_fields.rb +15 -0
  238. data/db/migrate/20150127090858995_add_base_event_fields.rb +24 -0
  239. data/db/migrate/20150127091005232_add_market_and_event_fields.rb +29 -0
  240. data/db/migrate/20150204113325731_add_category_types_table.rb +15 -0
  241. data/db/migrate/20150204113427832_add_categories_table.rb +15 -0
  242. data/db/migrate/20150204113510326_add_page_categories_table.rb +12 -0
  243. data/db/migrate/20150226131727777_add_location_page_fields.rb +19 -0
  244. data/db/migrate/20150302135485569_add_performances_table.rb +19 -0
  245. data/db/migrate/20150324135487799_add_indexes.rb +21 -0
  246. data/festivity_extension.rb +25 -0
  247. data/lib/festivity/admin/assets_helper.rb +17 -0
  248. data/lib/festivity/engine.rb +9 -0
  249. data/lib/festivity/extensions/page_extensions.rb +61 -0
  250. data/lib/festivity/extensions/pages_helper_extensions.rb +11 -0
  251. data/lib/festivity/extensions/paperclipped_extensions.rb +22 -0
  252. data/lib/festivity/extensions/site_extensions.rb +40 -0
  253. data/lib/festivity/mixins/not_found.rb +10 -0
  254. data/lib/tags/header_tags.rb +41 -0
  255. data/lib/tags/navigation_tags.rb +55 -0
  256. data/lib/tasks/active_record_utils.rb +35 -0
  257. data/lib/tasks/festivity_extension_tasks.rake +7 -0
  258. data/lib/tasks/setup.rake +101 -0
  259. data/lib/trusty-festivity-extension.rb +8 -0
  260. data/trusty-festivity-extension.gemspec +37 -0
  261. metadata +442 -0
@@ -0,0 +1,27 @@
1
+ class AddEventPerformancesView < ActiveRecord::Migration
2
+ def up
3
+ execute <<-SQL
4
+ CREATE OR REPLACE VIEW festivity_event_performances AS
5
+ SELECT
6
+ performance.id AS performance_id, performance.start_date, performance.end_date,
7
+ event.id AS event_id, event.title AS event_title, event.short_description, event.buy_url,
8
+ event.featured_item, event.header, event.sub_header, location.id as location_id,
9
+ location.slug AS location_slug, location.title AS location_title, location.festivity_directions_url,
10
+ area.id AS area_id, area.slug as area_slug, area.title AS area_title
11
+ FROM festivity_performances performance
12
+ INNER JOIN pages event
13
+ ON event.id = performance.event_page_id
14
+ INNER JOIN pages location
15
+ ON location.id = performance.location_page_id
16
+ INNER JOIN pages area
17
+ ON area.id = location.parent_id
18
+ SQL
19
+
20
+ end
21
+
22
+ def down
23
+ execute 'DROP VIEW festivity_event_performances'
24
+ end
25
+ end
26
+
27
+
@@ -0,0 +1,27 @@
1
+ class UpdateEventPerformancesViewWithSite < ActiveRecord::Migration
2
+ def up
3
+ execute <<-SQL
4
+ CREATE OR REPLACE VIEW festivity_event_performances AS
5
+ SELECT
6
+ performance.id AS performance_id, performance.start_date, performance.end_date,
7
+ event.id AS event_id, event.title AS event_title, event.short_description, event.buy_url,
8
+ event.featured_item, event.header, event.sub_header, event.site_id, location.id as location_id,
9
+ location.slug AS location_slug, location.title AS location_title, location.festivity_directions_url,
10
+ area.id AS area_id, area.slug as area_slug, area.title AS area_title
11
+ FROM festivity_performances performance
12
+ INNER JOIN pages event
13
+ ON event.id = performance.event_page_id
14
+ INNER JOIN pages location
15
+ ON location.id = performance.location_page_id
16
+ INNER JOIN pages area
17
+ ON area.id = location.parent_id
18
+ SQL
19
+
20
+ end
21
+
22
+ def down
23
+ execute 'DROP VIEW festivity_event_performances'
24
+ end
25
+ end
26
+
27
+
@@ -0,0 +1,15 @@
1
+ class AddSiteFields < ActiveRecord::Migration
2
+ def up
3
+ add_column :sites, :festivity_start_date, :date
4
+ add_column :sites, :festivity_end_date, :date
5
+ add_column :sites, :festivity_festival_name, :string
6
+ add_column :sites, :festivity_google_api_key, :string
7
+ end
8
+
9
+ def down
10
+ remove_column :sites, :festivity_start_date
11
+ remove_column :sites, :festivity_end_date
12
+ remove_column :sites, :festivity_festival_name
13
+ remove_column :sites, :festivity_google_api_key
14
+ end
15
+ end
@@ -0,0 +1,24 @@
1
+ class AddBaseEventFields < ActiveRecord::Migration
2
+ def up
3
+
4
+ add_column :pages, :short_description, :string
5
+ add_column :pages, :artist_twitter, :string
6
+ add_column :pages, :artist_facebook, :string
7
+ add_column :pages, :artist_instagram, :string
8
+ add_column :pages, :artist_homepage, :string
9
+ add_column :pages, :header, :string
10
+ add_column :pages, :sub_header, :string
11
+ add_column :pages, :redirect_url, :string
12
+ end
13
+
14
+ def down
15
+
16
+ remove_column :pages, :short_description
17
+ remove_column :pages, :artist_twitter
18
+ remove_column :pages, :artist_facebook
19
+ remove_column :pages, :artist_instagram
20
+ remove_column :pages, :artist_homepage
21
+ remove_column :pages, :header
22
+ remove_column :pages, :sub_header
23
+ end
24
+ end
@@ -0,0 +1,29 @@
1
+ class AddMarketAndEventFields < ActiveRecord::Migration
2
+ def up
3
+
4
+ # Event Fields
5
+ add_column :pages, :featured_item, :boolean
6
+ add_column :pages, :buy_url, :string
7
+
8
+ # Market Fields
9
+ add_column :pages, :booth_number, :string
10
+ add_column :pages, :area_id, :integer
11
+ add_column :pages, :maket_start_date, :date
12
+ add_column :pages, :market_end_date, :date
13
+
14
+ end
15
+
16
+ def down
17
+
18
+ # Event Fields
19
+ remove_column :pages, :featured_item
20
+ remove_column :pages, :buy_url
21
+
22
+ # Market Fields
23
+ remove_column :pages, :booth_number
24
+ remove_column :pages, :area_id
25
+ remove_column :pages, :market_start_date
26
+ remove_column :pages, :market_end_date
27
+
28
+ end
29
+ end
@@ -0,0 +1,15 @@
1
+ class AddCategoryTypesTable < ActiveRecord::Migration
2
+ def up
3
+ create_table :festivity_category_types do |t|
4
+ t.string :name
5
+ t.integer :site_id
6
+ t.integer :position
7
+ t.string :page_class
8
+ t.boolean :inactive, default: false
9
+ end
10
+ end
11
+
12
+ def down
13
+ drop_table :festivity_category_types
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ class AddCategoriesTable < ActiveRecord::Migration
2
+ def up
3
+ create_table :festivity_categories do |t|
4
+ t.string :name
5
+ t.integer :festivity_category_type_id
6
+ t.integer :parent_id
7
+ t.integer :position
8
+ t.boolean :inactive, default: false
9
+ end
10
+ end
11
+
12
+ def down
13
+ drop_table :festivity_categories
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ class AddPageCategoriesTable < ActiveRecord::Migration
2
+ def up
3
+ create_table :festivity_page_categories do |t|
4
+ t.integer :page_id
5
+ t.integer :festivity_category_id
6
+ end
7
+ end
8
+
9
+ def down
10
+ drop_table :festivity_page_categories
11
+ end
12
+ end
@@ -0,0 +1,19 @@
1
+ class AddLocationPageFields < ActiveRecord::Migration
2
+ def up
3
+
4
+ add_column :pages, :festivity_address, :string
5
+ add_column :pages, :festivity_city, :string
6
+ add_column :pages, :festivity_state, :string
7
+ add_column :pages, :festivity_zip, :string
8
+ add_column :pages, :festivity_directions_url, :string
9
+ end
10
+
11
+ def down
12
+
13
+ remove_column :pages, :festivity_address
14
+ remove_column :pages, :festivity_city
15
+ remove_column :pages, :festivity_state
16
+ remove_column :pages, :festivity_zip
17
+ remove_column :pages, :festivity_directions_url
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ class AddPerformancesTable < ActiveRecord::Migration
2
+ def up
3
+
4
+ create_table :festivity_performances do |t|
5
+ t.integer :event_page_id
6
+ t.datetime :start_date
7
+ t.datetime :end_date
8
+ t.integer :location_page_id
9
+ t.string :notes, default: ""
10
+ t.timestamps null: false
11
+ end
12
+ end
13
+
14
+ def down
15
+ drop_table :festivity_performances
16
+ end
17
+ end
18
+
19
+
@@ -0,0 +1,21 @@
1
+ class AddIndexes < ActiveRecord::Migration
2
+ def up
3
+ # add performance indexes
4
+ add_index :festivity_performances, :event_page_id
5
+ add_index :festivity_performances, :location_page_id
6
+
7
+ # add category indexes
8
+ add_index :festivity_page_categories, [:page_id, :festivity_category_id], unique: true, name: "event_categories"
9
+
10
+ end
11
+
12
+ def down
13
+ remove_index :festivity_performances, :event_page_id
14
+ remove_index :festivity_performances, :location_page_id
15
+
16
+ # add category indexes
17
+ remove_index :festivity_page_categories, [:page_id, :festivity_category_id], unique: true, name: "event_categories"
18
+ end
19
+ end
20
+
21
+
@@ -0,0 +1,25 @@
1
+ # Uncomment this if you reference any of your controllers in activate
2
+ # require_dependency "application_controller"
3
+ require "trusty-festivity-extension"
4
+ class FestivityExtension < TrustyCms::Extension
5
+ version TrustyFestivityExtension::VERSION
6
+ description TrustyFestivityExtension::DESCRIPTION
7
+ url TrustyFestivityExtension::URL
8
+
9
+ def activate
10
+ require 'fog'
11
+ admin.page.edit.add(:form, "festivity_includes", :before => 'edit_page_parts')
12
+ admin.page.edit.add(:form, "festivity_featured_image_fields", :after => 'edit_page_parts')
13
+ admin.page.edit.add(:form, "festivity_base_fields", :after => 'edit_page_parts')
14
+ admin.page.edit.add(:form, "festivity_location_fields", :after => 'edit_page_parts')
15
+ admin.site.edit.add(:form, "festivity_site_fields", :after => 'edit_homepage')
16
+
17
+ Admin::AssetsController.send :include, Festivity::Extensions::PaperclippedExtensions
18
+ Site.send :include, Festivity::Extensions::SiteExtensions
19
+ Page.send :include, Festivity::Extensions::PageExtensions
20
+ Admin::PagesHelper.send :include, Festivity::Extensions::PagesHelperExtensions
21
+ Page.send :include, Tags::NavigationTags
22
+ Page.send :include, Tags::HeaderTags
23
+ end
24
+
25
+ end
@@ -0,0 +1,17 @@
1
+ module Festivity
2
+ module Admin
3
+ module AssetsHelper
4
+
5
+ def image_url(title)
6
+ image = assets.find_by_title(title) if assets.size > 0
7
+ image.thumbnail(:normal) unless image.nil?
8
+ end
9
+
10
+ def image_url_from_all_assets title
11
+ image = Asset.find_by_title(title)
12
+ image.thumbnail(:normal) unless image.blank?
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ module Festivity
2
+ class Engine < Rails::Engine
3
+ paths["app/helpers"] = []
4
+
5
+ initializer "trusty_cms.assets.precompile" do |app|
6
+ app.config.assets.precompile += %w(admin/festivity_admin.css admin/festivity_admin.js festivity.css festivity_app.js skins/pghkids/skin.css)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,61 @@
1
+ module Festivity
2
+ module Extensions
3
+ module PageExtensions
4
+
5
+ def self.included(base)
6
+ base.class_eval {
7
+
8
+ before_save :set_page_defaults
9
+ after_create :create_page_defaults
10
+
11
+ has_many :festivity_category_types
12
+ has_many :festivity_page_categories
13
+ has_many :festivity_categories, through: :festivity_page_categories
14
+
15
+ include ActsAsTree::InstanceMethods
16
+ include Festivity::Extensions::PageExtensions::PageMethods
17
+ include Festivity::Admin::AssetsHelper
18
+ }
19
+
20
+ end
21
+
22
+ module PageMethods
23
+
24
+ def create_page_defaults
25
+ self.save if festivity_base_page?
26
+ end
27
+
28
+ def set_page_defaults
29
+ if festivity_base_page? && self.id
30
+ self.slug = self.id unless self.slug == self.id
31
+ parts.create(:name => 'video_embed', :content => "") unless parts.any? { |part| part.name == 'video_embed' }
32
+ parts.create(:name => 'sponsor_logo', :content => "") unless parts.any? { |part| part.name == 'sponsor_logo' }
33
+ end
34
+ end
35
+
36
+ def image
37
+ image_url('featured_image')
38
+ end
39
+
40
+ def organization
41
+ page_organization = nil
42
+ page_parent = self.parent
43
+ while page_organization == nil
44
+ page_organization = page_parent.site
45
+ page_parent = page_parent.parent
46
+ end
47
+ page_organization
48
+ end
49
+
50
+ private
51
+
52
+ def festivity_base_page?
53
+ (self.class_name == "FestivityEventPage") | (self.class_name == "FestivityMarketPage")
54
+ end
55
+
56
+ end
57
+
58
+ end
59
+ end
60
+ end
61
+
@@ -0,0 +1,11 @@
1
+ module Festivity::Extensions::PagesHelperExtensions
2
+
3
+ def self.included(base)
4
+ base.class_eval do
5
+ def format_date(date)
6
+ date.strftime('%m/%d/%Y %I:%M %p') if date
7
+ end
8
+ end
9
+ end
10
+
11
+ end
@@ -0,0 +1,22 @@
1
+ module Festivity
2
+ module Extensions
3
+ module PaperclippedExtensions
4
+
5
+ def async_create
6
+ @asset = Asset.new(params[:asset])
7
+ if @asset.save
8
+ if params[:page]
9
+ @page = Page.find(params[:page])
10
+ existing_asset = @page.assets.find_by_title(@asset.title)
11
+ @page.assets.delete(existing_asset) if not existing_asset.nil?
12
+ @asset.pages << @page
13
+ end
14
+ render :text => @asset.thumbnail(:thumbnail)
15
+ else
16
+ head :internal_server_error
17
+ end
18
+ end
19
+
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,40 @@
1
+ module Festivity
2
+ module Extensions
3
+ module SiteExtensions
4
+
5
+ def self.included(base)
6
+ base.class_eval {
7
+ has_many :festivity_category_types
8
+ include Festivity::Extensions::SiteExtensions::SiteMethods
9
+ }
10
+ end
11
+
12
+ module SiteMethods
13
+
14
+ def festivity_active_category_types
15
+ self.festivity_category_types.where(["inactive = false"])
16
+ end
17
+
18
+ def date_during_festival?(date)
19
+ self.festival_dates.include?(date)
20
+ end
21
+
22
+ def festival_dates
23
+ @festival_dates ||= calculate_festival_dates
24
+ end
25
+
26
+ def calculate_festival_dates
27
+ dates = [self.festivity_start_date]
28
+ until dates.last >= self.festivity_end_date do
29
+ dates << dates.last.advance(days: 1)
30
+ end
31
+ dates
32
+ rescue
33
+ []
34
+ end
35
+
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,10 @@
1
+ module Festivity::Mixins::NotFound
2
+
3
+ def file_not_found_for_site
4
+ not_found_page = FileNotFoundPage.where(site_id: current_site.id).first
5
+ not_found_page.process(request, response)
6
+ @performed_render ||= true
7
+ render 'site/show_page', layout: false
8
+ end
9
+
10
+ end