trusty-festivity-extension 2.3.30 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/contexts/_location.scss +1 -0
- data/app/assets/stylesheets/contexts/_subnav.scss +53 -0
- data/app/assets/stylesheets/contexts/_subnav_one_column.scss +31 -0
- data/app/assets/stylesheets/contexts/_subnav_three_column.scss +0 -41
- data/app/assets/stylesheets/contexts/_subnav_two_column.scss +11 -0
- data/app/assets/stylesheets/first-night.scss +3 -0
- data/app/assets/stylesheets/main.scss +3 -0
- data/app/assets/stylesheets/modules/_event.scss +19 -14
- data/app/models/vanity_url_page.rb +28 -0
- data/app/views/admin/pages/_festivity_vanity_url_fields.html.haml +23 -0
- data/app/views/navigation/_subnav.html.haml +3 -0
- data/app/views/navigation/{_three_column_item.html.haml → _subnav_item.html.haml} +1 -1
- data/db/migrate/201601231255101234_create_vanity_url_pages.rb +11 -0
- data/festivity_extension.rb +2 -1
- data/lib/festivity/extensions/page_extensions.rb +11 -0
- data/lib/festivity/extensions/site_controller_extensions.rb +27 -0
- data/lib/tags/navigation_tags.rb +15 -9
- data/lib/trusty-festivity-extension.rb +1 -1
- metadata +11 -6
- data/app/views/navigation/_mobile_menus.html.haml +0 -0
- data/app/views/navigation/_subnav_one_column.html.haml +0 -15
- data/app/views/navigation/_subnav_three_column.html.haml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25cbd6ac174c98114c89ec39479ea0faa321ec3c
|
4
|
+
data.tar.gz: 46ffd1cb6a41bdbb55ce9479ab0b9984518f262f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e18db3d404a06616b162a59ede39e2a1a042528d885735734f7fbdf1bf753025146b3be381ddaed90a2ac2c889b1dcb64763e151aed087336f203cee9496f65c
|
7
|
+
data.tar.gz: 25e9fd0d52df46944ff5f50b33a2228640f661773e607687cd1afdf96de2ec482983b5f6045aa6c0d4d6e992dea550138497dd198bbff8d697c01c233abf3564
|
@@ -0,0 +1,53 @@
|
|
1
|
+
.subnav {
|
2
|
+
@include divider-top;
|
3
|
+
@include pie-clearfix;
|
4
|
+
clear: both;
|
5
|
+
|
6
|
+
@include breakpoint($breakpoint-l) {
|
7
|
+
margin-top: 4em;
|
8
|
+
border-bottom: 0 none;
|
9
|
+
padding-bottom: 0;
|
10
|
+
}
|
11
|
+
|
12
|
+
.subnav-item {
|
13
|
+
@include divider-bottom;
|
14
|
+
}
|
15
|
+
|
16
|
+
.subnav-item-media {
|
17
|
+
margin-bottom: 1.5em;
|
18
|
+
}
|
19
|
+
|
20
|
+
.subnav-item-title {
|
21
|
+
@include heading-2;
|
22
|
+
margin-bottom:0.15em;
|
23
|
+
}
|
24
|
+
|
25
|
+
.subnav-item-tags {
|
26
|
+
list-style: none;
|
27
|
+
margin: 0;
|
28
|
+
|
29
|
+
li {
|
30
|
+
margin-bottom: 0.5em;
|
31
|
+
@include breakpoint($breakpoint-xxs) {
|
32
|
+
display: inline-block;
|
33
|
+
margin-right: 0.5em;
|
34
|
+
margin-bottom:0;
|
35
|
+
}
|
36
|
+
|
37
|
+
@include breakpoint($breakpoint-l) {
|
38
|
+
display: block;
|
39
|
+
margin-right: 0;
|
40
|
+
}
|
41
|
+
|
42
|
+
@include breakpoint($breakpoint-xl) {
|
43
|
+
display: inline-block;
|
44
|
+
margin-right: 1em;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
a {
|
49
|
+
@include button-subtle-list;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
.subnav-one-column {
|
2
|
+
|
3
|
+
.subnav-item {
|
4
|
+
|
5
|
+
@include breakpoint($breakpoint-l) {
|
6
|
+
@include column(12);
|
7
|
+
}
|
8
|
+
|
9
|
+
.subnav-item-media {
|
10
|
+
@include breakpoint($breakpoint-l) {
|
11
|
+
@include column(3);
|
12
|
+
border-bottom: 0 none;
|
13
|
+
padding-bottom: 0;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.subnav-item-title {
|
18
|
+
padding-bottom: 1em;
|
19
|
+
}
|
20
|
+
|
21
|
+
.subnav-item-body {
|
22
|
+
@include breakpoint($breakpoint-l) {
|
23
|
+
@include column(8);
|
24
|
+
border-bottom: 0 none;
|
25
|
+
padding-bottom: 0;
|
26
|
+
}
|
27
|
+
margin-bottom: 1.5em;
|
28
|
+
}
|
29
|
+
|
30
|
+
}
|
31
|
+
}
|
@@ -1,51 +1,10 @@
|
|
1
1
|
.subnav-three-column {
|
2
|
-
@include divider-top;
|
3
|
-
@include pie-clearfix;
|
4
|
-
clear: both;
|
5
|
-
|
6
|
-
@include breakpoint($breakpoint-l) {
|
7
|
-
margin-top: 4em;
|
8
|
-
}
|
9
2
|
|
10
3
|
.subnav-item {
|
11
|
-
@include divider-bottom;
|
12
4
|
|
13
5
|
@include breakpoint($breakpoint-l) {
|
14
6
|
@include column(4);
|
15
7
|
@include last-col3;
|
16
|
-
border-bottom: 0 none;
|
17
|
-
padding-bottom: 0;
|
18
|
-
}
|
19
|
-
.subnav-item-media {
|
20
|
-
margin-bottom: 1.5em;
|
21
|
-
}
|
22
|
-
|
23
|
-
.subnav-item-tags {
|
24
|
-
list-style: none;
|
25
|
-
margin: 0;
|
26
|
-
|
27
|
-
li {
|
28
|
-
margin-bottom: 0.5em;
|
29
|
-
@include breakpoint($breakpoint-xxs) {
|
30
|
-
display: inline-block;
|
31
|
-
margin-right: 0.5em;
|
32
|
-
margin-bottom:0;
|
33
|
-
}
|
34
|
-
|
35
|
-
@include breakpoint($breakpoint-l) {
|
36
|
-
display: block;
|
37
|
-
margin-right: 0;
|
38
|
-
}
|
39
|
-
|
40
|
-
@include breakpoint($breakpoint-xl) {
|
41
|
-
display: inline-block;
|
42
|
-
margin-right: 1em;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
a {
|
47
|
-
@include button-subtle-list;
|
48
|
-
}
|
49
8
|
}
|
50
9
|
|
51
10
|
}
|
@@ -22,6 +22,9 @@
|
|
22
22
|
@import "contexts/location";
|
23
23
|
@import "contexts/related-events";
|
24
24
|
@import "contexts/callouts";
|
25
|
+
@import "contexts/subnav";
|
26
|
+
@import "contexts/subnav_one_column";
|
27
|
+
@import "contexts/subnav_two_column";
|
25
28
|
@import "contexts/subnav_three_column";
|
26
29
|
|
27
30
|
@import "modules/navigation";
|
@@ -20,6 +20,9 @@
|
|
20
20
|
@import "contexts/location";
|
21
21
|
@import "contexts/related-events";
|
22
22
|
@import "contexts/callouts";
|
23
|
+
@import "contexts/subnav";
|
24
|
+
@import "contexts/subnav_one_column";
|
25
|
+
@import "contexts/subnav_two_column";
|
23
26
|
@import "contexts/subnav_three_column";
|
24
27
|
|
25
28
|
@import "modules/navigation";
|
@@ -50,22 +50,27 @@
|
|
50
50
|
}
|
51
51
|
.event-tags {
|
52
52
|
li {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
margin-bottom: 0.5em;
|
54
|
+
@include breakpoint($breakpoint-xxs) {
|
55
|
+
display: inline-block;
|
56
|
+
margin-right: 0.5em;
|
57
|
+
margin-bottom:0;
|
58
|
+
}
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
}
|
60
|
+
@include breakpoint($breakpoint-m) {
|
61
|
+
margin-top: 1em;
|
62
|
+
}
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
64
|
+
@include breakpoint($breakpoint-l) {
|
65
|
+
display: block;
|
66
|
+
margin-right: 0;
|
67
|
+
}
|
68
|
+
|
69
|
+
@include breakpoint($breakpoint-xl) {
|
70
|
+
display: inline-block;
|
71
|
+
margin-right: 1em;
|
72
|
+
margin-top: 0;
|
73
|
+
}
|
69
74
|
}
|
70
75
|
|
71
76
|
a {
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class VanityUrlPage < Page
|
2
|
+
|
3
|
+
def clean_target_url
|
4
|
+
(self.target_url.match('http://') || self.target_url.match('https://')) ? self.target_url : VanityUrlPage.clean_path(self.target_url)
|
5
|
+
end
|
6
|
+
|
7
|
+
class << self
|
8
|
+
|
9
|
+
def find_vanity_url_by_path(path, live = true)
|
10
|
+
vanity_url_page = Page.current_site.homepage.children.find_by_slug('vanity-urls')
|
11
|
+
vanity_pages = vanity_url_page.children.where("vanity_url like '%#{path}%'")
|
12
|
+
vanity_pages.each do |vanity_page|
|
13
|
+
return vanity_page if clean_comparison_path(path).downcase == clean_comparison_path(vanity_page.vanity_url).downcase
|
14
|
+
end
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def clean_comparison_path(path)
|
19
|
+
"#{clean_path(path)}/"
|
20
|
+
end
|
21
|
+
|
22
|
+
def clean_path(path)
|
23
|
+
"/#{path.to_s.strip}".gsub(%r{//+}, '/')
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
- unless @page.is_a?(VanityUrlPage)
|
2
|
+
.fieldset#content
|
3
|
+
%label Page Redirect
|
4
|
+
%br
|
5
|
+
%em
|
6
|
+
If this page has expired and you would like all traffic redirected to a new page, please enter the new url below:
|
7
|
+
%br
|
8
|
+
= label :page, :redirect_url, "Redirect URL"
|
9
|
+
= text_field :page, :redirect_url, :size => 100
|
10
|
+
%br
|
11
|
+
|
12
|
+
- if @page.is_a?(VanityUrlPage)
|
13
|
+
%br
|
14
|
+
%hr
|
15
|
+
.vanity_url
|
16
|
+
= label :page, :vanity_url, "Vanity URL"
|
17
|
+
= text_field :page, :vanity_url, :size => 100
|
18
|
+
%br
|
19
|
+
.target_url
|
20
|
+
= label :page, :target_url, "Target URL"
|
21
|
+
= text_field :page, :target_url, :size => 100
|
22
|
+
%br
|
23
|
+
%br
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateVanityUrlPages < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :pages, :vanity_url, :string
|
4
|
+
add_column :pages, :target_url, :string
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_column :pages, :vanity_url
|
9
|
+
remove_column :pages, :target_url
|
10
|
+
end
|
11
|
+
end
|
data/festivity_extension.rb
CHANGED
@@ -14,10 +14,11 @@ class FestivityExtension < TrustyCms::Extension
|
|
14
14
|
admin.page.edit.add(:form, "festivity_base_fields", :after => 'edit_page_parts')
|
15
15
|
admin.page.edit.add(:form, "festivity_location_fields", :after => 'edit_page_parts')
|
16
16
|
admin.site.edit.add(:form, "festivity_site_fields", :after => 'edit_homepage')
|
17
|
+
admin.page.edit.add(:form, "festivity_vanity_url_fields", :before => 'form_bottom')
|
17
18
|
|
18
19
|
Admin::AssetsController.send :include, Festivity::Extensions::PaperclippedExtensions
|
19
20
|
Site.send :include, Festivity::Extensions::SiteExtensions
|
20
|
-
Page.send :include, Festivity::Extensions::PageExtensions
|
21
|
+
#Page.send :include, Festivity::Extensions::PageExtensions
|
21
22
|
Admin::PagesHelper.send :include, Festivity::Extensions::PagesHelperExtensions
|
22
23
|
SitesHelper.send :include, Festivity::Extensions::PagesHelperExtensions
|
23
24
|
Page.send :include, Tags::NavigationTags
|
@@ -15,6 +15,8 @@ module Festivity
|
|
15
15
|
include ActsAsTree::InstanceMethods
|
16
16
|
include Festivity::Extensions::PageExtensions::PageMethods
|
17
17
|
include Festivity::Admin::AssetsHelper
|
18
|
+
|
19
|
+
alias_method_chain :find_by_path, :vanity_urls
|
18
20
|
}
|
19
21
|
|
20
22
|
end
|
@@ -47,6 +49,15 @@ module Festivity
|
|
47
49
|
page_organization
|
48
50
|
end
|
49
51
|
|
52
|
+
def find_by_path_with_vanity_urls(path, live = true, clean = true)
|
53
|
+
raise MissingRootPageError unless root
|
54
|
+
page = self.find_by_path_without_vanity_urls(path, live, clean)
|
55
|
+
if page.is_a?(FileNotFoundPage)
|
56
|
+
vanity_url = VanityUrlPage.find_vanity_url_by_path(path, live)
|
57
|
+
end
|
58
|
+
vanity_url ? vanity_url : page
|
59
|
+
end
|
60
|
+
|
50
61
|
private
|
51
62
|
|
52
63
|
def festivity_base_page?
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Festivity
|
2
|
+
module Extensions
|
3
|
+
module SiteControllerExtensions
|
4
|
+
|
5
|
+
def self.included(base)
|
6
|
+
base.class_eval do
|
7
|
+
alias_method_chain :process_page, :redirection
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
def process_page_with_redirection(page)
|
13
|
+
if page.is_a?(VanityUrlPage)
|
14
|
+
false if redirect_to page.clean_target_url
|
15
|
+
|
16
|
+
elsif !page.redirect_url.nil? && !page.redirect_url.empty?
|
17
|
+
false if redirect_to page.redirect_url
|
18
|
+
else
|
19
|
+
process_page_without_redirection(page)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
data/lib/tags/navigation_tags.rb
CHANGED
@@ -8,9 +8,11 @@ module Tags::NavigationTags
|
|
8
8
|
<pre><r:subnav_one_column /></pre>
|
9
9
|
}
|
10
10
|
tag "subnav_one_column" do |tag|
|
11
|
-
request.env["action_controller.instance"].render_to_string :partial => "navigation/
|
12
|
-
:locals => {
|
13
|
-
|
11
|
+
request.env["action_controller.instance"].render_to_string :partial => "navigation/subnav",
|
12
|
+
:locals => {
|
13
|
+
:subnav_class => 'subnav-one-column',
|
14
|
+
:current_page => tag.locals.page,
|
15
|
+
:top_level_page => top_level_page(tag.locals.page)}
|
14
16
|
end
|
15
17
|
|
16
18
|
desc %{Two Column Subnavigation Tag
|
@@ -19,9 +21,11 @@ module Tags::NavigationTags
|
|
19
21
|
<pre><r:subnav_two_column /></pre>
|
20
22
|
}
|
21
23
|
tag "subnav_two_column" do |tag|
|
22
|
-
request.env["action_controller.instance"].render_to_string :partial => "navigation/
|
23
|
-
:locals => {
|
24
|
-
|
24
|
+
request.env["action_controller.instance"].render_to_string :partial => "navigation/subnav",
|
25
|
+
:locals => {
|
26
|
+
:subnav_class => 'subnav-two-column',
|
27
|
+
:current_page => tag.locals.page,
|
28
|
+
:top_level_page => top_level_page(tag.locals.page)}
|
25
29
|
end
|
26
30
|
|
27
31
|
desc %{Three Column Subnavigation Tag
|
@@ -32,9 +36,11 @@ module Tags::NavigationTags
|
|
32
36
|
}
|
33
37
|
tag "subnav_three_column" do |tag|
|
34
38
|
|
35
|
-
request.env["action_controller.instance"].render_to_string :partial => "navigation/
|
36
|
-
:locals => {
|
37
|
-
|
39
|
+
request.env["action_controller.instance"].render_to_string :partial => "navigation/subnav",
|
40
|
+
:locals => {
|
41
|
+
:subnav_class => 'subnav-three-column',
|
42
|
+
:current_page => tag.locals.page,
|
43
|
+
:top_level_page => top_level_page(tag.locals.page)}
|
38
44
|
end
|
39
45
|
|
40
46
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trusty-festivity-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Sipple
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trusty-cms
|
@@ -477,7 +477,10 @@ files:
|
|
477
477
|
- app/assets/stylesheets/contexts/_related-events.scss
|
478
478
|
- app/assets/stylesheets/contexts/_site-footer.scss
|
479
479
|
- app/assets/stylesheets/contexts/_site-header.scss
|
480
|
+
- app/assets/stylesheets/contexts/_subnav.scss
|
481
|
+
- app/assets/stylesheets/contexts/_subnav_one_column.scss
|
480
482
|
- app/assets/stylesheets/contexts/_subnav_three_column.scss
|
483
|
+
- app/assets/stylesheets/contexts/_subnav_two_column.scss
|
481
484
|
- app/assets/stylesheets/events/_event-list-item.scss
|
482
485
|
- app/assets/stylesheets/events/_event_template.scss
|
483
486
|
- app/assets/stylesheets/events/_filter-bar.scss
|
@@ -586,6 +589,7 @@ files:
|
|
586
589
|
- app/models/festivity_market_page.rb
|
587
590
|
- app/models/festivity_page_category.rb
|
588
591
|
- app/models/festivity_performance.rb
|
592
|
+
- app/models/vanity_url_page.rb
|
589
593
|
- app/presenters/festivity_date_presenter.rb
|
590
594
|
- app/presenters/festivity_datetime_filter_presenter.rb
|
591
595
|
- app/presenters/festivity_datetime_presenter.rb
|
@@ -598,6 +602,7 @@ files:
|
|
598
602
|
- app/views/admin/pages/_festivity_featured_image_fields.html.haml
|
599
603
|
- app/views/admin/pages/_festivity_includes.html.haml
|
600
604
|
- app/views/admin/pages/_festivity_location_fields.html.haml
|
605
|
+
- app/views/admin/pages/_festivity_vanity_url_fields.html.haml
|
601
606
|
- app/views/admin/pages/partials/_categories.html.haml
|
602
607
|
- app/views/admin/pages/partials/_category.html.haml
|
603
608
|
- app/views/admin/pages/partials/_featured_image.html.haml
|
@@ -623,10 +628,8 @@ files:
|
|
623
628
|
- app/views/festivity_location_areas/show.html.haml
|
624
629
|
- app/views/festivity_locations/show.html.haml
|
625
630
|
- app/views/header/_meta_tags.html.haml
|
626
|
-
- app/views/navigation/
|
627
|
-
- app/views/navigation/
|
628
|
-
- app/views/navigation/_subnav_three_column.html.haml
|
629
|
-
- app/views/navigation/_three_column_item.html.haml
|
631
|
+
- app/views/navigation/_subnav.html.haml
|
632
|
+
- app/views/navigation/_subnav_item.html.haml
|
630
633
|
- app/views/search/_page.html.haml
|
631
634
|
- app/views/search/_pagination_links.html.haml
|
632
635
|
- app/views/search/_result_item.html.haml
|
@@ -658,12 +661,14 @@ files:
|
|
658
661
|
- db/migrate/20150324135487799_add_indexes.rb
|
659
662
|
- db/migrate/20151018190155_update_site_for_hourly_filters.rb
|
660
663
|
- db/migrate/20151105155407_add_buy_ticket_text_to_site.rb
|
664
|
+
- db/migrate/201601231255101234_create_vanity_url_pages.rb
|
661
665
|
- festivity_extension.rb
|
662
666
|
- lib/festivity/admin/assets_helper.rb
|
663
667
|
- lib/festivity/engine.rb
|
664
668
|
- lib/festivity/extensions/page_extensions.rb
|
665
669
|
- lib/festivity/extensions/pages_helper_extensions.rb
|
666
670
|
- lib/festivity/extensions/paperclipped_extensions.rb
|
671
|
+
- lib/festivity/extensions/site_controller_extensions.rb
|
667
672
|
- lib/festivity/extensions/site_extensions.rb
|
668
673
|
- lib/festivity/mixins/not_found.rb
|
669
674
|
- lib/tags/filter_and_menu_tags.rb
|
File without changes
|
@@ -1,15 +0,0 @@
|
|
1
|
-
.page-template
|
2
|
-
- current_page.children.each do |page|
|
3
|
-
.row.media-item
|
4
|
-
.col-xs-12.col-md-4
|
5
|
-
.map-thumb
|
6
|
-
%a{href: page.path}
|
7
|
-
%img{src: page.image, alt: page.title}
|
8
|
-
%h3.strong
|
9
|
-
.col-xs-12.col-md-8
|
10
|
-
%h3.strong
|
11
|
-
= page.title
|
12
|
-
%p
|
13
|
-
= page.short_description
|
14
|
-
%a.btn.btn-default{href: page.path}
|
15
|
-
Learn More
|