trusty-festivity-extension 2.4.6 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/{traf-internalpage-bg-pattern.svg → skins/traf/traf-internalpage-bg-pattern.svg} +0 -0
  3. data/app/assets/images/{traf-internalpage-bg.svg → skins/traf/traf-internalpage-bg.svg} +0 -0
  4. data/app/assets/javascripts/modal.js +5 -4
  5. data/app/assets/stylesheets/rad_social/rad_screen.scss +154 -0
  6. data/app/assets/stylesheets/{traf-stylesheets → skins/traf}/contexts/_traf.scss +2 -2
  7. data/app/assets/stylesheets/{traf-stylesheets → skins/traf}/library/_general-mixins.scss +0 -0
  8. data/app/assets/stylesheets/{traf-stylesheets → skins/traf}/library/_icons.scss +0 -0
  9. data/app/assets/stylesheets/{traf-stylesheets → skins/traf}/library/_variables.scss +0 -0
  10. data/app/assets/stylesheets/skins/traf/skin.scss +36 -0
  11. data/app/assets/stylesheets/traf.scss +10 -5
  12. data/app/controllers/concerns/festivity_custom_page.rb +12 -0
  13. data/app/controllers/concerns/festivity_search_caching.rb +11 -0
  14. data/app/controllers/concerns/festivity_sql_builder.rb +25 -0
  15. data/app/controllers/festivity_events_controller.rb +4 -18
  16. data/app/controllers/festivity_location_areas_controller.rb +1 -3
  17. data/app/controllers/festivity_locations_controller.rb +2 -4
  18. data/app/controllers/festivity_markets_controller.rb +67 -0
  19. data/app/controllers/search_controller.rb +1 -2
  20. data/app/helpers/festivity_events_helper.rb +26 -1
  21. data/app/models/concerns/festivity_artist_methods.rb +28 -0
  22. data/app/models/festivity_event_list.rb +21 -15
  23. data/app/models/festivity_event_page.rb +3 -21
  24. data/app/models/festivity_market_list.rb +76 -0
  25. data/app/models/festivity_market_list/festivity_market_detail.rb +24 -0
  26. data/app/models/festivity_market_page.rb +7 -0
  27. data/app/views/admin/pages/_festivity_base_fields.html.haml +30 -7
  28. data/app/views/festivity_events/_filters.html.haml +1 -1
  29. data/app/views/festivity_events/show.html.haml +6 -4
  30. data/app/views/festivity_markets/_filters.html.haml +46 -0
  31. data/app/views/festivity_markets/_market.html.haml +40 -0
  32. data/app/views/festivity_markets/_market_filters.html.haml +0 -0
  33. data/app/views/festivity_markets/_market_list.html.haml +5 -0
  34. data/app/views/festivity_markets/index.html.haml +15 -0
  35. data/app/views/festivity_markets/show.html.haml +63 -0
  36. data/app/views/navigation/_subnav.html.haml +2 -1
  37. data/app/views/social/_share_modal.html.haml +10 -0
  38. data/config/routes.rb +1 -0
  39. data/db/content/layouts/base.html +178 -128
  40. data/db/migrate/201603212551012359_add_hide_from_subnav_to_pages.rb +9 -0
  41. data/db/migrate/201604025593337427_fix_typo_in_market_start.rb +13 -0
  42. data/db/migrate/201604031236563245_add_market_details_view.rb +22 -0
  43. data/db/migrate/201604031638542262_change_market_dates_to_datetime.rb +21 -0
  44. data/lib/festivity/engine.rb +1 -1
  45. data/lib/festivity/extensions/page_extensions.rb +8 -0
  46. data/lib/festivity/extensions/site_extensions.rb +5 -1
  47. data/lib/trusty-festivity-extension.rb +1 -1
  48. metadata +28 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f30ecb7c596c9f68d075213459d1ac56ef672862
4
- data.tar.gz: eabd423568421400937021dc41efc3e724cd824c
3
+ metadata.gz: 0bf1679e53bf07b9e983c1a2b7513bf9c6b9a83b
4
+ data.tar.gz: 4d917522b54572e5a5168d14c678031fc4525b13
5
5
  SHA512:
6
- metadata.gz: 4e5a6cb155bf4458e4ccb38122af57cf50212d59aa84511242f12516ba887693dcc5c0f71bb16f23c769896e44be8704b4ba329f1a1ea980594def59e64efb2c
7
- data.tar.gz: ee528910a5c01720e1b8c9b0776a4a2d726d195c30b65c2bd8b3ff1e1ba3be908d2273096e52000e5511b8bf0babe4b08215e7c0ed56d2f5771b4868ef7f2002
6
+ metadata.gz: ad2194131c0a7bb0e2356caaa1f1409db5bf41bd34ba535aab3b743e42f3ef3ee7e827cd43a521b9706239e1d00d0304badf67c0a3114a69602fd0e947a4e301
7
+ data.tar.gz: ca6ba667cb67d97d5c08b6add31e14b245bcb25e258d703ed467762f8510e0d587eae3851383f9d602afbe468b52cb97cf0bd236e781e36e655e6f2b1caac252
@@ -1,17 +1,18 @@
1
1
  $(document).ready(function(){
2
2
  function showModal() {
3
3
  $('.modal-link').on("click", function(e) {
4
- $(this).next('.modal').addClass('is-visible');
4
+ e.preventDefault();
5
+ $('.modal').addClass('is-visible');
5
6
  });
6
- };
7
+ }
7
8
 
8
9
  function hideModal() {
9
10
  $('.modal .close-btn, .modal .close-link, .modal .add-to-cart').on("click", function(e) {
10
11
  e.preventDefault();
11
12
  $('.modal').removeClass('is-visible');
12
- })
13
+ });
13
14
  }
14
15
 
15
16
  showModal();
16
17
  hideModal();
17
- });
18
+ });
@@ -0,0 +1,154 @@
1
+ .rad-icon {
2
+ display: inline-block;
3
+ .rad-facebook {
4
+ background-image: url('facebook.png');
5
+ background-repeat: no-repeat;
6
+ height: 25px;
7
+ width: 25px;
8
+ }
9
+ .rad-twitter {
10
+ background-image: url('twitter.png');
11
+ background-repeat: no-repeat;
12
+ height: 25px;
13
+ width: 25px;
14
+ }
15
+ .rad-email {
16
+ background-image: url('email.png');
17
+ background-repeat: no-repeat;
18
+ height: 25px;
19
+ width: 25px;
20
+ }
21
+ .rad-gplus {
22
+ visibility: hidden;
23
+ }
24
+ }
25
+ .rad-email-form {
26
+ position: relative;
27
+ padding: 15px;
28
+ }
29
+
30
+ .hidden {
31
+ display: none;
32
+ }
33
+
34
+ .rad-dialog-titlebar {
35
+ background: #EDEDED;
36
+ padding: .5em .3em .3em 1em;
37
+ height: 2em;
38
+ }
39
+
40
+ .rad-dialog-title {
41
+ float: left;
42
+ font-weight: bold;
43
+ margin: .3em 0 .2em;
44
+ }
45
+
46
+ #rad-social-email-form .form-row .form-fields {
47
+ width: 60%;
48
+ float: left;
49
+ }
50
+
51
+ #rad-social-email-form .form-row .input-textbox {
52
+ display: block;
53
+ font-size: 12px;
54
+ }
55
+
56
+ .rad-email-form #rad_email_submit {
57
+ float: right;
58
+ }
59
+
60
+ .rad-email-form .captcha-container {
61
+ padding: 10px 0;
62
+ }
63
+
64
+ .rad-email-form input.std_input {
65
+ margin-bottom: 10px;
66
+ }
67
+
68
+ .rad-email-form select {
69
+ margin-bottom: 10px;
70
+ background-color: #fff;
71
+ border: 1px solid #ccc;
72
+ font: 14px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
73
+ color: #6e6e6e;
74
+ }
75
+
76
+ #rad-social-email-form .form-label {
77
+ width: 15%;
78
+ float: left;
79
+ display: block;
80
+ text-align: left;
81
+ padding: 5px 10px 0 0;
82
+ }
83
+
84
+ #rad-social-email-form .form-row {
85
+ padding: 5px;
86
+ clear: both;
87
+ overflow: auto;
88
+ }
89
+
90
+ .rad-email-form input.std_input,
91
+ .rad-email-form textarea {
92
+ border: 1px solid #ccc;
93
+ width: 97%;
94
+ font: 15px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
95
+ padding: 5px;
96
+ color: #6e6e6e;
97
+ }
98
+
99
+ .rad-email-form table {
100
+ width: 100%;
101
+ }
102
+
103
+ .rad-email-form table input.std_input {
104
+ width: 93%;
105
+ }
106
+
107
+ .rad-email-form table.three-col input.std_input {
108
+ width: 90%;
109
+ }
110
+
111
+ .rad-email-form input.form_but {
112
+ margin-top: 10px;
113
+ background-color: #93ba31;
114
+ border: 3px solid #afdd39;
115
+ color: #fff;
116
+ font: bold 15px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
117
+ -webkit-border-radius: 5px;
118
+ -moz-border-radius: 5px;
119
+ padding: 5px 10px;
120
+ }
121
+
122
+ input.error {
123
+ border: 1px solid #CD0A0A !important;
124
+ color: #CD0A0A !important;
125
+ font-family: Arial, Helvetica, sans-serif !important;
126
+ }
127
+
128
+ .rad-email-error, label.error {
129
+ padding: 5px 0 !important;
130
+ color: #CD0A0A !important;
131
+ font-family: Arial, Helvetica, sans-serif !important;
132
+ display: block;
133
+ }
134
+
135
+ #rad-confirmation {
136
+ font-weight: bold;
137
+ text-align: center;
138
+ padding-top: 25px;
139
+ }
140
+
141
+ body .ajax-loader {
142
+ background: transparent none no-repeat 50% 50%;
143
+ background-image: url('ajax-loader.gif');
144
+ height: 35px;
145
+ }
146
+
147
+ body #rad-social-email-form .primary-button {
148
+ background: transparent none repeat-x scroll 0 0;
149
+ background-image: url('bg_primary-btn.png');
150
+ color: white !important;
151
+ border: 1px solid #924900;
152
+ }
153
+
154
+ /* @end */
@@ -214,7 +214,7 @@ button.search-submit {
214
214
 
215
215
  .internal {
216
216
  .site-header {
217
- background: url('/traf-internalpage-bg.svg') no-repeat $background-color-alt;
217
+ background: url(traf-internalpage-bg.svg) no-repeat $background-color-alt;
218
218
  @include breakpoint($breakpoint-s) {
219
219
  background: $background-color-alt;
220
220
  }
@@ -222,7 +222,7 @@ button.search-submit {
222
222
  .container {
223
223
  @include pie-clearfix;
224
224
  @include breakpoint($breakpoint-s) {
225
- background: url('/traf-internalpage-bg.svg') no-repeat $background-color-alt;
225
+ background: url(traf-internalpage-bg.svg) no-repeat $background-color-alt;
226
226
  }
227
227
  }
228
228
  }
@@ -0,0 +1,36 @@
1
+ $text-color: #00525b; //dark green
2
+ //$heading-color: #404242;
3
+ $heading-color: $text-color;
4
+ $text-color-subtle: tint($text-color, 30%);
5
+ $text-highlight-color: #fdcb36;//yellow
6
+
7
+ $link-color: #f06a33; //orange
8
+ $link-color-hover: darken($link-color, 15%);
9
+
10
+ $highlight-color: #d7df23; //light green
11
+ $highlight-color-hover: shade($highlight-color, 10%);
12
+
13
+ $link-color-reverse: #08B7BF; //light Blue
14
+ $link-color-reverse-hover: lighten($link-color-reverse, 10%);
15
+ $link-color-reverse-alt: $text-color;
16
+
17
+ $heading-highlight-color: #00afaa; //turquoise
18
+
19
+ $border-color: #cbcdc6;
20
+
21
+ $background-color: #fff;
22
+ $background-color-subtle: #cbcbcb;
23
+ $background-color-alt: #92d5e1;
24
+
25
+ $footer-color: $text-color;
26
+ $social-footer-color: $footer-color;
27
+
28
+ $search-placeholder-color: $link-color;
29
+
30
+ // icon color variations - overrides original value with this theme's contextual value
31
+
32
+ $icon-primary-color: #D7DF23;
33
+ $icon-secondary-color: #F06A33;
34
+ $icon-search-color: $highlight-color;
35
+
36
+ @import "../../traf"
@@ -1,15 +1,15 @@
1
1
  // from bower_components
2
- @import "breakpoint-sass/stylesheets/breakpoint";
2
+ @import "breakpoint";
3
3
 
4
4
  @import "library/reset";
5
5
  @import "library/grid";
6
- @import "traf-stylesheets/library/variables";
7
6
  @import "library/mediaqueries";
8
7
  @import "library/typographic-mixins";
9
8
  @import "library/general-mixins";
10
- @import "traf-stylesheets/library/general-mixins";
9
+ @import "skins/traf/library/general-mixins";
11
10
  @import "library/icons";
12
- @import "traf-stylesheets/library/icons";
11
+ @import "skins/traf/library/icons";
12
+ @import "library/modal";
13
13
 
14
14
  @import "globals/forms.scss";
15
15
  @import "globals/general.scss";
@@ -18,8 +18,13 @@
18
18
  @import "contexts/site-footer";
19
19
  @import "contexts/events-list";
20
20
  @import "contexts/event-detail";
21
+ @import "contexts/location";
21
22
  @import "contexts/related-events";
22
23
  @import "contexts/callouts";
24
+ @import "contexts/subnav";
25
+ @import "contexts/subnav_one_column";
26
+ @import "contexts/subnav_two_column";
27
+ @import "contexts/subnav_three_column";
23
28
 
24
29
  @import "modules/navigation";
25
30
  @import "modules/filters";
@@ -28,4 +33,4 @@
28
33
  @import "modules/callout";
29
34
 
30
35
  ///// This is an override file for the TRAF theme
31
- @import "traf-stylesheets/contexts/traf";
36
+ @import "skins/traf/contexts/traf";
@@ -0,0 +1,12 @@
1
+ module Concerns
2
+ module FestivityCustomPage
3
+
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ include Festivity::Mixins::NotFound
8
+ no_login_required
9
+ trusty_layout 'base'
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module Concerns
2
+ module FestivitySearchCaching
3
+
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ caches_action :index, cache_path: proc { |c| c.params.except(:_).merge(format: request.xhr?, base_domain: "#{request.subdomain}.#{request.domain}")}
8
+ caches_action :show
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,25 @@
1
+ module Concerns
2
+ module FestivitySqlBuilder
3
+
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+
8
+ def self.advance_by(filter_type)
9
+ advance_by_hash = {minutes: 59}
10
+ advance_by_hash[:hours] = 23 if filter_type == "date"
11
+ advance_by_hash
12
+ end
13
+
14
+ def self.parse_categories(category_ids)
15
+ grouped_ids = FestivityCategory.find(category_ids).group_by {|category| category.festivity_category_type}
16
+ category_clauses = grouped_ids.map do |categories|
17
+ "page_id IN (SELECT page_id FROM festivity_page_categories WHERE festivity_category_id IN (#{categories[1].map {|category| category.id}.join(",")}))"
18
+ end
19
+ "(#{category_clauses.join(" AND ")})"
20
+
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -1,10 +1,6 @@
1
1
  class FestivityEventsController < ApplicationController
2
- include Festivity::Mixins::NotFound
3
- no_login_required
4
- trusty_layout 'base'
5
-
6
- caches_action :index, cache_path: proc { |c| c.params.except(:_).merge(format: request.xhr?, base_domain: "#{request.subdomain}.#{request.domain}")}
7
- caches_action :show
2
+ include Concerns::FestivityCustomPage
3
+ include Concerns::FestivitySearchCaching
8
4
 
9
5
  def index
10
6
 
@@ -49,26 +45,16 @@ class FestivityEventsController < ApplicationController
49
45
  private
50
46
 
51
47
  def cache_key
52
- "#{params[:categories.to_s]}-#{params[:dates].to_s}-#{params[:sort].to_s}-#{request.xhr?}-#{request.subdomain}.#{request.domain}"
48
+ "events-#{params[:categories.to_s]}-#{params[:dates].to_s}-#{params[:sort].to_s}-#{request.xhr?}-#{request.subdomain}.#{request.domain}"
53
49
  end
54
50
 
55
51
  def search_dates
56
52
  if params[:dates]
57
53
  params[:dates].split(",")
58
54
  else
59
- collect_festival_dates
60
- end
61
-
62
- end
63
-
64
- def collect_festival_dates
65
- festival_dates = current_site.festival_datetimes
66
- if current_site.date_during_festival?(Time.now)
67
- festival_dates = festival_dates.select{ |date| date.datetime == Time.now }
55
+ FestivityEventList.collect_festival_dates(current_site)
68
56
  end
69
57
 
70
- festival_dates.map{ |date| date.to_s }
71
-
72
58
  end
73
59
 
74
60
 
@@ -1,7 +1,5 @@
1
1
  class FestivityLocationAreasController < ApplicationController
2
- include Festivity::Mixins::NotFound
3
- no_login_required
4
- trusty_layout "normal"
2
+ include Concerns::FestivityCustomPage
5
3
 
6
4
  def show
7
5
  @area = FestivityLocationAreaPage.find_by_slug_for_site(params[:id]).first
@@ -1,13 +1,11 @@
1
1
  class FestivityLocationsController < ApplicationController
2
- include Festivity::Mixins::NotFound
3
- no_login_required
4
- trusty_layout "base"
2
+ include Concerns::FestivityCustomPage
5
3
 
6
4
  def show
7
5
  @location = FestivityLocationPage.find_by_slug_for_site(params[:id]).first
8
6
  if @location
9
7
  @location_events = @title = Rails.cache.fetch("location-#{@location.slug}", expires_in: 2.hours) do
10
- FestivityEventList.find_by_location(@location.id)
8
+ FestivityEventList.find_by_location(@location.id, current_site)
11
9
  end
12
10
  @title = "#{current_site.festivity_festival_name}: #{@location.title}"
13
11
  else
@@ -0,0 +1,67 @@
1
+ class FestivityMarketsController < ApplicationController
2
+ include Concerns::FestivityCustomPage
3
+ include Concerns::FestivitySearchCaching
4
+
5
+ def index
6
+
7
+ order_by = params[:sort] ? params[:sort] : "start_date"
8
+ @title = "#{current_site.festivity_festival_name}: Artist's Market"
9
+ @filter_type = current_site.festivity_filter_type
10
+ @markets = Rails.cache.fetch("#{cache_key}", expires_in: 2.hours) do
11
+ FestivityMarketList.search(
12
+ {dates: search_dates.join(","),
13
+ categories: params[:categories],
14
+ filter_type: current_site.festivity_filter_type}, order_by
15
+ ).markets
16
+ end
17
+
18
+
19
+ @selected_dates = params[:dates] ? FestivityDatetimeFilterPresenter.parse(params[:dates].split(","), current_site.festivity_filter_type) : []
20
+ @selected_categories = params[:categories] ? params[:categories].split(",") : []
21
+ @selected_sort = order_by
22
+ # If the request is AJAX, only return the market list itself, not the full page
23
+ if request.xhr?
24
+ render partial: "market_list"
25
+ else
26
+ render 'index'
27
+ end
28
+
29
+ end
30
+
31
+ def show
32
+ @market = FestivityMarketPage.find_by_slug_and_status_id(params[:id], Status[:published].id)
33
+ if @market
34
+ @page = @market
35
+ @title = "#{current_site.festivity_festival_name}: #{@market.title}"
36
+ else
37
+ file_not_found_for_site
38
+ end
39
+
40
+ end
41
+
42
+ private
43
+
44
+ def cache_key
45
+ "markets-#{params[:categories.to_s]}-#{params[:dates].to_s}-#{params[:sort].to_s}-#{request.xhr?}-#{request.subdomain}.#{request.domain}"
46
+ end
47
+
48
+ def search_dates
49
+ if params[:dates]
50
+ params[:dates].split(",")
51
+ else
52
+ collect_festival_dates
53
+ end
54
+
55
+ end
56
+
57
+ def collect_festival_dates
58
+ festival_dates = current_site.festival_datetimes
59
+ if current_site.date_during_festival?(Time.now)
60
+ festival_dates = festival_dates.select{ |date| date.datetime == Time.now }
61
+ end
62
+
63
+ festival_dates.map{ |date| date.to_s }
64
+
65
+ end
66
+
67
+ end