workarea-youtube_playlists 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +21 -0
  3. data/Gemfile +17 -0
  4. data/LICENSE +52 -0
  5. data/README.md +40 -0
  6. data/Rakefile +56 -0
  7. data/app/assets/images/workarea/admin/youtube_playlists/.keep +0 -0
  8. data/app/assets/images/workarea/admin/youtube_playlists/content_block_types/youtube_playlists.svg +1 -0
  9. data/app/assets/images/workarea/storefront/youtube_playlists/.keep +0 -0
  10. data/app/assets/javascripts/workarea/admin/youtube_playlists/.keep +0 -0
  11. data/app/assets/javascripts/workarea/storefront/youtube_playlists/.keep +0 -0
  12. data/app/assets/stylesheets/workarea/admin/youtube_playlists/.keep +0 -0
  13. data/app/assets/stylesheets/workarea/storefront/youtube_playlists/.keep +0 -0
  14. data/app/assets/stylesheets/workarea/storefront/youtube_playlists/_list.scss +22 -0
  15. data/app/controllers/.keep +0 -0
  16. data/app/controllers/workarea/admin/youtube_videos_controller.rb +10 -0
  17. data/app/controllers/workarea/storefront/youtube_videos.rb +55 -0
  18. data/app/helpers/.keep +0 -0
  19. data/app/mailers/.keep +0 -0
  20. data/app/models/.keep +0 -0
  21. data/app/models/workarea/content/fields/playlist.rb +11 -0
  22. data/app/view_models/workarea/storefront/content_blocks/youtube_playlists_view_model.rb +34 -0
  23. data/app/views/.keep +0 -0
  24. data/app/views/workarea/admin/content_blocks/_playlist.html.haml +4 -0
  25. data/app/views/workarea/admin/youtube_videos/index.html.haml +3 -0
  26. data/app/views/workarea/admin/youtube_videos/index.json.jbuilder +4 -0
  27. data/app/views/workarea/storefront/content_blocks/_youtube_playlists.html.haml +18 -0
  28. data/app/views/workarea/storefront/youtube_videos/_pagination.html.haml +7 -0
  29. data/app/views/workarea/storefront/youtube_videos/_summary.html.haml +5 -0
  30. data/app/views/workarea/storefront/youtube_videos/index.html.haml +36 -0
  31. data/app/views/workarea/storefront/youtube_videos/show.haml +26 -0
  32. data/bin/rails +25 -0
  33. data/config/initializers/appends.rb +7 -0
  34. data/config/initializers/workarea.rb +7 -0
  35. data/config/initializers/youtube_configurations.rb +16 -0
  36. data/config/initializers/youtube_content_block_types.rb +11 -0
  37. data/config/locales/en.yml +13 -0
  38. data/config/routes.rb +10 -0
  39. data/lib/workarea/youtube_playlists.rb +33 -0
  40. data/lib/workarea/youtube_playlists/engine.rb +10 -0
  41. data/lib/workarea/youtube_playlists/version.rb +5 -0
  42. data/test/dummy/.ruby-version +1 -0
  43. data/test/dummy/Rakefile +6 -0
  44. data/test/dummy/app/assets/config/manifest.js +2 -0
  45. data/test/dummy/app/assets/images/.keep +0 -0
  46. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  47. data/test/dummy/app/controllers/application_controller.rb +2 -0
  48. data/test/dummy/app/controllers/concerns/.keep +0 -0
  49. data/test/dummy/app/helpers/application_helper.rb +2 -0
  50. data/test/dummy/app/javascript/packs/application.js +14 -0
  51. data/test/dummy/app/jobs/application_job.rb +7 -0
  52. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  53. data/test/dummy/app/models/concerns/.keep +0 -0
  54. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  55. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  56. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  57. data/test/dummy/bin/rails +4 -0
  58. data/test/dummy/bin/rake +4 -0
  59. data/test/dummy/bin/setup +25 -0
  60. data/test/dummy/config.ru +5 -0
  61. data/test/dummy/config/application.rb +33 -0
  62. data/test/dummy/config/boot.rb +5 -0
  63. data/test/dummy/config/environment.rb +5 -0
  64. data/test/dummy/config/environments/development.rb +53 -0
  65. data/test/dummy/config/environments/production.rb +101 -0
  66. data/test/dummy/config/environments/test.rb +47 -0
  67. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  68. data/test/dummy/config/initializers/assets.rb +12 -0
  69. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  70. data/test/dummy/config/initializers/content_security_policy.rb +28 -0
  71. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  72. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  73. data/test/dummy/config/initializers/inflections.rb +16 -0
  74. data/test/dummy/config/initializers/mime_types.rb +4 -0
  75. data/test/dummy/config/initializers/workarea.rb +5 -0
  76. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  77. data/test/dummy/config/locales/en.yml +33 -0
  78. data/test/dummy/config/puma.rb +38 -0
  79. data/test/dummy/config/routes.rb +5 -0
  80. data/test/dummy/config/spring.rb +6 -0
  81. data/test/dummy/db/seeds.rb +2 -0
  82. data/test/dummy/lib/assets/.keep +0 -0
  83. data/test/dummy/log/.keep +0 -0
  84. data/test/teaspoon_env.rb +6 -0
  85. data/test/test_helper.rb +10 -0
  86. data/workarea-youtube_playlists-0.1.0.gem +0 -0
  87. data/workarea-youtube_playlists.gemspec +19 -0
  88. metadata +89 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57789167a82acc3e4d6dc95291a9d10d2d0494d0bc0ea4fa4867683a5c0ac3fe
4
- data.tar.gz: f691b992b9955e9c10e1a4a6ee284f2ce305ef94b4e54485cf8bd85f752e0013
3
+ metadata.gz: 8b99f5b5e4b54223a3f424415aed255614bfa8a449053ebe40de3cd9b4f635bb
4
+ data.tar.gz: c1b2bd6a7d178c4f0ab010573c323d48026c0624273be3bef00e9bda507aef88
5
5
  SHA512:
6
- metadata.gz: a8cf91e4847fe63a20e7ccf63288fc6a89195583d3ab913647a651c695a9fb22543ba954b0d7d5e4796e93e308b226d8eaa6702a4b5c23de043e54be5a2e025e
7
- data.tar.gz: 1fa2318d5c5ae37bdc67160c8f54bf3a21a4fdfb2b812ac41298edca0ad9f1cfde9754af81c715bec6f98b1582759d15614bf41cedd46c40d0c91e3e943c3e89
6
+ metadata.gz: 00d977cc30a02ed43c39e89d232258a848b670cd3cba12c01aeda793a88ad67c8d87496e3fad1ad39ba1e8f5962a02a437593a7bba67f89f7d945e8676848bcd
7
+ data.tar.gz: 5ea47128721b6c7cc2ad22ae8534fdb29fe796e95070478b10d4c620dc69c58380ca997c2f5a68f21ce96774ea04bffd99e8f9db21aa0b5940c621ae159fe6df
@@ -0,0 +1,21 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ test/dummy/log/*.log
5
+ test/dummy/tmp/
6
+ .DS_Store
7
+ .byebug_history
8
+ .bundle/
9
+ .sass-cache/
10
+ Gemfile.lock
11
+ pkg/
12
+ test/dummy/tmp/
13
+ test/dummy/public/
14
+ log/*.log
15
+ test/dummy/log/*.log
16
+ test/dummy/db/*.sqlite3
17
+ test/dummy/db/*.sqlite3-journal
18
+ node_modules
19
+ yarn.lock
20
+ yarn-error.log
21
+ package-lock.json
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ # Declare your gem's dependencies in youtube_playlists.gemspec.
5
+ # Bundler will treat runtime dependencies like base dependencies, and
6
+ # development dependencies will be added by default to the :development group.
7
+ gemspec
8
+
9
+ # Declare any dependencies that are still in development here instead of in
10
+ # your gemspec. These might include edge Rails or gems from your path or
11
+ # Git. Remember to move these dependencies to your gemspec before releasing
12
+ # your gem to rubygems.org.
13
+
14
+ # To use a debugger
15
+ # gem 'byebug', group: [:development, :test]
16
+
17
+ gem 'workarea', github: 'workarea-commerce/workarea'
data/LICENSE ADDED
@@ -0,0 +1,52 @@
1
+ WebLinc
2
+ Business Source License
3
+
4
+ Licensor: WebLinc Corporation, 22 S. 3rd Street, 2nd Floor, Philadelphia PA 19106
5
+
6
+ Licensed Work: Workarea Commerce Platform
7
+ The Licensed Work is (c) 2019 WebLinc Corporation
8
+
9
+ Additional Use Grant:
10
+ You may make production use of the Licensed Work without an additional license agreement with WebLinc so long as you do not use the Licensed Work for a Commerce Service.
11
+
12
+ A "Commerce Service" is a commercial offering that allows third parties (other than your employees and contractors) to access the functionality of the Licensed Work by creating or managing commerce functionality, the products, taxonomy, assets and/or content of which are controlled by such third parties.
13
+
14
+ For information about obtaining an additional license agreement with WebLinc, contact licensing@workarea.com.
15
+
16
+ Change Date: 2019-08-20
17
+
18
+ Change License: Version 2.0 or later of the GNU General Public License as published by the Free Software Foundation
19
+
20
+ Terms
21
+
22
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
23
+
24
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
25
+
26
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
27
+
28
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
29
+
30
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
31
+
32
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
33
+
34
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this License’s text to license your works and to refer to it using the trademark "Business Source License" as long as you comply with the Covenants of Licensor below.
35
+
36
+ Covenants of Licensor
37
+ In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
38
+
39
+ To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
40
+
41
+ To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None."
42
+
43
+ To specify a Change Date.
44
+
45
+ Not to modify this License in any other way.
46
+
47
+ Notice
48
+ The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
49
+
50
+ For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
51
+
52
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. "Business Source License" is a trademark of MariaDB Corporation Ab.
@@ -0,0 +1,40 @@
1
+ Workarea Youtube Playlists
2
+ ================================================================================
3
+
4
+ Youtube Playlists plugin for the Workarea platform.
5
+
6
+ Overview
7
+ --------------------------------------------------------------------------------
8
+
9
+ 1. TODO
10
+
11
+ Getting Started
12
+ --------------------------------------------------------------------------------
13
+
14
+ This gem contains a Rails engine that must be mounted onto a host Rails application.
15
+
16
+ Then add the gem to your application's Gemfile specifying the source:
17
+
18
+ # ...
19
+ gem 'workarea-youtube_playlists'
20
+ # ...
21
+
22
+ Update your application's bundle.
23
+
24
+ cd path/to/application
25
+ bundle
26
+
27
+ Features
28
+ --------------------------------------------------------------------------------
29
+
30
+ ### TODO
31
+
32
+ Workarea Platform Documentation
33
+ --------------------------------------------------------------------------------
34
+
35
+ See [https://developer.workarea.com](https://developer.workarea.com) for Workarea platform documentation.
36
+
37
+ License
38
+ --------------------------------------------------------------------------------
39
+
40
+ Workarea Youtube Playlists is released under the [Business Software License](LICENSE)
@@ -0,0 +1,56 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+ RDoc::Task.new(:rdoc) do |rdoc|
9
+ rdoc.rdoc_dir = 'rdoc'
10
+ rdoc.title = 'Youtube Playlists'
11
+ rdoc.options << '--line-numbers'
12
+ rdoc.rdoc_files.include('README.md')
13
+ rdoc.rdoc_files.include('lib/**/*.rb')
14
+ end
15
+
16
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
17
+ load 'rails/tasks/engine.rake'
18
+ load 'rails/tasks/statistics.rake'
19
+ load 'workarea/changelog.rake'
20
+
21
+ require 'rake/testtask'
22
+ Rake::TestTask.new(:test) do |t|
23
+ t.libs << 'lib'
24
+ t.libs << 'test'
25
+ t.pattern = 'test/**/*_test.rb'
26
+ t.verbose = false
27
+ end
28
+ task default: :test
29
+
30
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
31
+ require 'workarea/youtube_playlists/version'
32
+
33
+ desc "Release version #{Workarea::YoutubePlaylists::VERSION} of the gem"
34
+ task :release do
35
+ Rake::Task['workarea:changelog'].execute
36
+ system 'git add CHANGELOG.md'
37
+ system 'git commit -m "Update CHANGELOG"'
38
+
39
+ system "git tag -a v#{Workarea::YoutubePlaylists::VERSION} -m 'Tagging #{Workarea::YoutubePlaylists::VERSION}'"
40
+ system 'git push origin HEAD --follow-tags'
41
+
42
+ system "gem build workarea-youtube_playlists.gemspec"
43
+ system "gem push workarea-youtube_playlists-#{Workarea::YoutubePlaylists::VERSION}.gem"
44
+ system "rm workarea-youtube_playlists-#{Workarea::YoutubePlaylists::VERSION}.gem"
45
+ end
46
+
47
+ desc 'Run the JavaScript tests'
48
+ ENV['TEASPOON_RAILS_ENV'] = File.expand_path('../test/dummy/config/environment', __FILE__)
49
+ task teaspoon: 'app:teaspoon'
50
+
51
+ desc 'Start a server at http://localhost:3000/teaspoon for JavaScript tests'
52
+ task :teaspoon_server do
53
+ Dir.chdir("test/dummy")
54
+ teaspoon_env = File.expand_path('../test/teaspoon_env.rb', __FILE__)
55
+ system "RAILS_ENV=test TEASPOON_ENV=#{teaspoon_env} rails s"
56
+ end
@@ -0,0 +1 @@
1
+ <svg width="125" height="125" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="m80 70h-60v-37h9v-7h16v7h12v-7h16v7h7z" fill-rule="evenodd"/></svg>
@@ -0,0 +1,22 @@
1
+ $full_black: #000 !default;
2
+
3
+ .youtube-playlist {
4
+ &__items {
5
+ padding: $vertical-margin;
6
+ background-color: $table-gray-1;
7
+ &:nth-child(even) {
8
+ background-color: $table-gray-2;
9
+ }
10
+ }
11
+ &__video-image {
12
+ cursor: pointer;
13
+ position: relative;
14
+ background-color: $full_black;
15
+ .video-testimonials-content-block__play-icon {
16
+ z-index: 2;
17
+ }
18
+ .youtube-playlist_image {
19
+ opacity: 0.8;
20
+ }
21
+ }
22
+ }
File without changes
@@ -0,0 +1,10 @@
1
+ module Workarea
2
+ module Admin
3
+ class YoutubeVideosController < Admin::ApplicationController
4
+ def index
5
+ response = JSON.parse(YoutubePlaylists.get_list_data({:maxResults => 300}).read)
6
+ @search = response["items"]
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,55 @@
1
+ module Workarea
2
+ module Storefront
3
+ class YoutubeVideosController < Storefront::ApplicationController
4
+ include DisplayContent
5
+ before_action :cache_page
6
+
7
+ def content_lookup
8
+ 'Cart'
9
+ end
10
+
11
+ def index
12
+ all_playlists
13
+ if @all_playlists && @all_playlists["kind"] == "youtube#playlistListResponse"
14
+ @all_playlists["items"].each do |playlist|
15
+ playlist["video"]= get_video_data(playlist["id"], {maxResults: 3})
16
+ end
17
+ @youtube = @all_playlists
18
+ else
19
+ @youtube = false
20
+ end
21
+ # @youtube = false
22
+ end
23
+
24
+ def show
25
+ overrides = {
26
+ maxResults: Workarea.config.youtube_video_per_page
27
+ }
28
+ overrides[:pageToken] = params[:page_id]
29
+ @videos = get_video_data(params[:id], overrides)
30
+ # @videos = false
31
+ end
32
+
33
+ def get_playlists(ids)
34
+ list_data = get_list_data({:id => ids})
35
+ list_data["items"].each do |playlist|
36
+ playlist["video"]= get_video_data(playlist["id"], {maxResults: 3})
37
+ end
38
+ list_data
39
+ end
40
+
41
+ def all_playlists
42
+ overrides = {pageToken: params[:page_id] }
43
+ @all_playlists ||= get_list_data(overrides)
44
+ end
45
+
46
+ def get_video_data(id, overrides)
47
+ response = JSON.parse(YoutubePlaylists.get_video_data(id, overrides).read)
48
+ end
49
+
50
+ def get_list_data(overrides)
51
+ response = JSON.parse(YoutubePlaylists.get_list_data(overrides).read)
52
+ end
53
+ end
54
+ end
55
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,11 @@
1
+ module Workarea
2
+ class Content
3
+ module Fields
4
+ class Playlist < Field
5
+ def typecast(value)
6
+ Array(value).map(&:to_s)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,34 @@
1
+ module Workarea
2
+ module Storefront
3
+ module ContentBlocks
4
+ class YoutubePlaylistsViewModel < ContentBlockViewModel
5
+ # Custom local variables passed into the view template.
6
+ #
7
+ # @return [Hash]
8
+ def locals
9
+ super.merge(type: 'Youtube Playlists')
10
+ end
11
+
12
+ def lists
13
+ id_list = data[:lists].reject { |e| e.to_s.empty? }
14
+ get_list_data({:id => id_list.join(",")})
15
+ @all_playlists["items"].each do |playlist|
16
+ playlist["video"]= get_video_data(playlist["id"], {maxResults: 3})
17
+ end
18
+ @all_playlists
19
+ end
20
+
21
+ private
22
+
23
+ def get_video_data(id, overrides)
24
+ response = JSON.parse(YoutubePlaylists.get_video_data(id, overrides).read)
25
+ end
26
+
27
+ def get_list_data(overrides)
28
+ @all_playlists ||= JSON.parse(YoutubePlaylists.get_list_data(overrides).read)
29
+ end
30
+ # TODO: Add more custom view model logic.
31
+ end
32
+ end
33
+ end
34
+ end
File without changes
@@ -0,0 +1,4 @@
1
+ .property{ class: ('property--required' if field.required?) }
2
+ = label_tag dom_id(block, field.slug), field.name, class: 'property__name'
3
+ = select_tag "block[data][#{field.slug}]", "", id: dom_id(block, 'blog_search'), title: t('workarea.admin.content_blocks.blog_id.search_field_placeholder'), tabindex: '1', class: 'text-box', include_blank: true, multiple: true, data: { remote_select: { source: youtube_videos_path, options: { placeholder: t('workarea.admin.content_blocks.blog_id.search_field_placeholder') } } }
4
+ = hidden_field_tag "block[data][id]", block.data[:id], id: dom_id(block, 'blogs')
@@ -0,0 +1,3 @@
1
+ %ul
2
+ - @search.each do |item|
3
+ %li= item["text"]
@@ -0,0 +1,4 @@
1
+ json.results @search do |item|
2
+ json.label item["snippet"]["title"]
3
+ json.value item["id"]
4
+ end
@@ -0,0 +1,18 @@
1
+ .youtube-playlists-content-block
2
+ - view_model.lists["items"].each do |item|
3
+ .youtube-playlist__items
4
+ .grid
5
+ .grid__cell.grid__cell--50.grid__cell--75-at-medium
6
+ %h2.heading.heading--4
7
+ #{item["snippet"]["localized"]["title"]}
8
+ .grid__cell.grid__cell--50.grid__cell--25-at-medium.align-right
9
+ - if (item["video"]["items"].length > 2)
10
+ = link_to t('workarea.storefront.play_lists.view_all'), youtube_video_path(item["id"], {list_name: item["snippet"]["localized"]["title"]}), class: "button button--secondary"
11
+ -if item["snippet"]["localized"]["description"] != ""
12
+ %p= item["snippet"]["localized"]["description"]
13
+ .grid.youtube-playlist__video-items
14
+ - item["video"] && item["video"]["items"].each do |video_item|
15
+ -if video_item["snippet"]["title"] != "Private video"
16
+ .grid__cell.grid__cell--33-at-medium
17
+ = render 'workarea/storefront/youtube_videos/summary', video_item: video_item
18
+
@@ -0,0 +1,7 @@
1
+ - if data["prevPageToken"] || data["nextPageToken"]
2
+ %p.align-right
3
+ %span= t('workarea.storefront.play_lists.pagination.message', per_page: data["pageInfo"]["resultsPerPage"])
4
+ - if data["prevPageToken"]
5
+ = link_to t('workarea.storefront.play_lists.pagination.prev'), "#{url_path}?page_id=#{data['prevPageToken']}&list_name=#{params[:list_name]}", class: "button"
6
+ - if data["nextPageToken"]
7
+ = link_to t('workarea.storefront.play_lists.pagination.next'), "#{url_path}?page_id=#{data['nextPageToken']}&list_name=#{params[:list_name]}", class: "button"
@@ -0,0 +1,5 @@
1
+ - iframe= "<iframe style='margin-bottom:20px;' src='https://www.youtube.com/embed/#{video_item["snippet"]["resourceId"]["videoId"]}?autoplay=1' frameborder='0' allowfullscreen></iframe>"
2
+ .youtube-playlist__video-image{data: { youtube_popup_video: iframe}}
3
+ .video-testimonials-content-block__play-icon= inline_svg('workarea/storefront/icons/SVG/video_play.svg', class: 'link svg-icon svg-icon--big svg-icon--white')
4
+ = image_tag(video_item["snippet"]["thumbnails"]["high"]["url"], class: "youtube-playlist_image")
5
+ %h3.heading.heading--5= video_item["snippet"]["title"]
@@ -0,0 +1,36 @@
1
+ - @title = t('workarea.storefront.play_lists.play_list')
2
+
3
+ - content_for :breadcrumbs do
4
+ %p.breadcrumbs__node-group
5
+ %span.breadcrumbs__node
6
+ = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
+ %span.breadcrumbs__node
8
+ %span.breadcrumbs__text= t('workarea.storefront.play_lists.youtude_videos')
9
+
10
+ .view.youtube-playlist
11
+
12
+ - if @youtube
13
+ .grid
14
+ .grid__cell.grid__cell--60-at-medium
15
+ %h1.heading.heading--3.heading--upcase= t('workarea.storefront.play_lists.play_list')
16
+ .grid__cell.grid__cell--40-at-medium
17
+ = render 'workarea/storefront/youtube_videos/pagination', data: @youtube, url_path: youtube_videos_path()
18
+ - @youtube["items"].each do |item|
19
+ .youtube-playlist__items
20
+ .grid
21
+ .grid__cell.grid__cell--50.grid__cell--75-at-medium
22
+ %h2.heading.heading--4
23
+ #{item["snippet"]["localized"]["title"]}
24
+ .grid__cell.grid__cell--50.grid__cell--25-at-medium.align-right
25
+ - if (item["video"]["items"].length > 2)
26
+ = link_to t('workarea.storefront.play_lists.view_all'), youtube_video_path(item["id"], {list_name: item["snippet"]["localized"]["title"]}), class: "button button--secondary"
27
+ -if item["snippet"]["localized"]["description"] != ""
28
+ %p= item["snippet"]["localized"]["description"]
29
+ .grid.youtube-playlist__video-items
30
+ - item["video"] && item["video"]["items"].each do |video_item|
31
+ -if video_item["snippet"]["title"] != "Private video"
32
+ .grid__cell.grid__cell--33-at-medium
33
+ = render 'workarea/storefront/youtube_videos/summary', video_item: video_item
34
+ = render 'workarea/storefront/youtube_videos/pagination', data: @youtube, url_path: youtube_videos_path()
35
+ - else
36
+ %p= t('workarea.storefront.play_lists.no_videos')