Skip to content

Commit 76b8b36

Browse files
committed
Merge branch 'develop'
2 parents ac961dc + 1b3d884 commit 76b8b36

40 files changed

+324
-149
lines changed

app/api/v1/entities/webpage.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ class Webpage < Grape::Entity
2020
expose :dynamic_yield_sku, documentation: { type: 'String', desc: "Dynamic Yield Webpage SKU/ID" }
2121
expose :dynamic_yield_category, documentation: { type: 'String', desc: "Dynamic Yield Webpage Category" }
2222

23+
expose :tables_widget_json, documentation: {type: 'Hash', is_array: true, desc: 'Tables Widget Data as JSON'}
24+
2325
with_options if: { full: true } do
2426
expose :user, with: '::V1::Entities::User', documentation: {type: 'User', desc: 'Owner'}
2527
expose :url, documentation: { type: 'String', desc: 'URL of Webpage' }
28+
29+
expose :tables_widget_yaml, documentation: {type: 'Hash', is_array: true, desc: 'Tables Widget Data as YAML'}
2630
end
2731
end
2832
end

app/api/v1/resources/media.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Media < Grape::API
2121

2222
@media = ::GetMultipleMedia.call(params: declared(clean_params(params), include_missing: false), tenant: current_tenant).media
2323
set_paginate_headers(@media)
24-
::V1::Entities::Media.represent @media
24+
::V1::Entities::Media.represent @media.to_a
2525
end
2626

2727
desc 'Show media tags'

app/api/v1/resources/posts.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Posts < Grape::API
2121
authorize! :view, ::Post
2222
@posts = ::GetPosts.call(params: declared(clean_params(params), include_missing: false), tenant: current_tenant).posts
2323
set_paginate_headers(@posts)
24-
::V1::Entities::Post.represent @posts
24+
::V1::Entities::Post.represent @posts.to_a
2525
end
2626

2727
desc 'Show published posts', { entity: ::V1::Entities::Post, nickname: "postFeed" }
@@ -61,7 +61,7 @@ class Posts < Grape::API
6161

6262
@posts = ::GetRelatedPosts.call(post: post, params: declared(clean_params(params), include_missing: false), tenant: current_tenant, published: true).posts
6363
set_paginate_headers(@posts)
64-
::V1::Entities::Post.represent @posts
64+
::V1::Entities::Post.represent @posts.to_a
6565
end
6666

6767
desc 'Show a published post', { entity: ::V1::Entities::Post, nickname: "showFeedPost" }

app/api/v1/resources/webpages.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Webpages < Grape::API
1818

1919
@webpages = ::GetWebpages.call(params: declared(clean_params(params), include_missing: false), tenant: current_tenant).webpages
2020
set_paginate_headers(@webpages)
21-
::V1::Entities::Webpage.represent @webpages, full: true
21+
::V1::Entities::Webpage.represent @webpages.to_a, full: true
2222
end
2323

2424
desc 'Show Webpage Snippets as public feed by URL', { entity: ::V1::Entities::Webpage, nickname: 'showWebpageFeed' }

app/assets/images/icons/add.svg

Lines changed: 59 additions & 0 deletions
Loading

app/assets/images/icons/blog.png

2.45 KB
Loading

app/assets/images/icons/media.png

3.58 KB
Loading

app/assets/javascripts/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
//= require datepicker_init
1818
//= require media_dialogs
1919
//= require sidebar-toggle
20+
//= require quick_links
2021

2122
// require turbolinks # temporarily disabled
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(function (global) {
2+
'use strict';
3+
4+
$(document).ready(function() {
5+
$('.quick-links .jumbo-button').hover(function () {
6+
$(this).find('.jumbo-button__content__icon').css('display', 'none');
7+
$(this).find('.jumbo-button__content__add').css('display', 'block');
8+
}, function () {
9+
$(this).find('.jumbo-button__content__icon').css('display', 'block');
10+
$(this).find('.jumbo-button__content__add').css('display', 'none');
11+
});
12+
});
13+
}(this));

app/assets/legacy_templates/webpages/edit.html

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<div class="form-group">
3030
<label for="description">Description (155 characters max)</label>
3131
<textarea id="seo_description" name="seo_description" class="form-control"
32-
ng-model="data.webpage.seo_description" placeholder="Page Description" required></textarea>
32+
ng-model="data.webpage.seo_description" placeholder="Page Description" required></textarea>
3333
</div>
3434

3535
<div class="keywords tags">
@@ -48,32 +48,38 @@
4848

4949
<div class="checkbox">
5050
<label>
51-
<input type="checkbox" name="noindex" id="noindex" ng-model="data.webpage.noindex"> Don't Index This Page In Search Engines (<strong>noindex</strong>)
51+
<input type="checkbox" name="noindex" id="noindex" ng-model="data.webpage.noindex"> Don't Index This Page
52+
In Search Engines (<strong>noindex</strong>)
5253
</label>
5354
</div>
5455
<div class="checkbox">
5556
<label>
56-
<input type="checkbox" name="nofollow" id="nofollow" ng-model="data.webpage.nofollow"> Don't Index Any Pages This Page Links To (<strong>nofollow</strong>)
57+
<input type="checkbox" name="nofollow" id="nofollow" ng-model="data.webpage.nofollow"> Don't Index Any
58+
Pages This Page Links To (<strong>nofollow</strong>)
5759
</label>
5860
</div>
5961
<div class="checkbox">
6062
<label>
61-
<input type="checkbox" name="nosnippet" id="nosnippet" ng-model="data.webpage.nosnippet"> Don't Show A Snippet in Google Search Results (<strong>nosnippet</strong>)
63+
<input type="checkbox" name="nosnippet" id="nosnippet" ng-model="data.webpage.nosnippet"> Don't Show A
64+
Snippet in Google Search Results (<strong>nosnippet</strong>)
6265
</label>
6366
</div>
6467
<div class="checkbox">
6568
<label>
66-
<input type="checkbox" name="noodp" id="noodp" ng-model="data.webpage.noodp"> Don't Show Description from ODP/DMOZ (<strong>noodp</strong>)
69+
<input type="checkbox" name="noodp" id="noodp" ng-model="data.webpage.noodp"> Don't Show Description from
70+
ODP/DMOZ (<strong>noodp</strong>)
6771
</label>
6872
</div>
6973
<div class="checkbox">
7074
<label>
71-
<input type="checkbox" name="noarchive" id="noarchive" ng-model="data.webpage.noarchive"> Don't Show "Cached" Link on Google Search Results (<strong>noarchive</strong>)
75+
<input type="checkbox" name="noarchive" id="noarchive" ng-model="data.webpage.noarchive"> Don't Show
76+
"Cached" Link on Google Search Results (<strong>noarchive</strong>)
7277
</label>
7378
</div>
7479
<div class="checkbox">
7580
<label>
76-
<input type="checkbox" name="noimageindex" id="noimageindex" ng-model="data.webpage.noimageindex"> Don't Show This Page As the Source For Images in Google Image Search (<strong>noimageindex</strong>)
81+
<input type="checkbox" name="noimageindex" id="noimageindex" ng-model="data.webpage.noimageindex"> Don't
82+
Show This Page As the Source For Images in Google Image Search (<strong>noimageindex</strong>)
7783
</label>
7884
</div>
7985
</form>
@@ -96,7 +102,21 @@
96102
</form>
97103
</div>
98104
</tab>
105+
<tab>
106+
<tab-heading><i class="fa fa-puzzle-piece"></i> Widgets</span></tab-heading>
107+
<div>
108+
<form novalidate name="webpageForm">
109+
<div class="form-group">
110+
<label for="tables_widget_yaml">Tables Data</label>
111+
<textarea id="tables_widget_yaml" name="tables_widget_yaml" class="form-control" rows="15"
112+
ng-model="data.webpage.tables_widget_yaml"
113+
placeholder="YAML-formatted table data"></textarea>
114+
</div>
115+
</form>
116+
</div>
117+
</tab>
99118
</tabset>
100119

101-
<iframe class="webpage-frame" id="webpage-frame" ng-src="{{ data.webpage.url + '?editing_mode=1' | trustAsResourceUrl }}" disabled></iframe>
120+
<iframe class="webpage-frame" id="webpage-frame"
121+
ng-src="{{ data.webpage.url + '?editing_mode=1' | trustAsResourceUrl }}" disabled></iframe>
102122
</div>

0 commit comments

Comments
 (0)