scrivito_rich_snippet_widget 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +129 -0
  3. data/Rakefile +35 -0
  4. data/app/assets/images/widgets/scrivito_rich_snippet_widget.png +0 -0
  5. data/app/assets/javascripts/scrivito_rich_snippet_widget.js +41 -0
  6. data/app/models/rich_snippet/creative_work.rb +88 -0
  7. data/app/models/rich_snippet/event.rb +70 -0
  8. data/app/models/rich_snippet/job_posting.rb +47 -0
  9. data/app/models/rich_snippet/offer.rb +41 -0
  10. data/app/models/rich_snippet/organization.rb +33 -0
  11. data/app/models/rich_snippet/person.rb +70 -0
  12. data/app/models/rich_snippet/postal_address.rb +33 -0
  13. data/app/models/rich_snippet/product.rb +40 -0
  14. data/app/models/rich_snippet/recipe.rb +69 -0
  15. data/app/models/rich_snippet/thing.rb +43 -0
  16. data/app/models/rich_snippet_widget.rb +20 -0
  17. data/app/views/rich_snippet/creative_work/_details.html.erb +136 -0
  18. data/app/views/rich_snippet/creative_work/details.html.erb +1 -0
  19. data/app/views/rich_snippet/event/_details.html.erb +39 -0
  20. data/app/views/rich_snippet/event/details.html.erb +1 -0
  21. data/app/views/rich_snippet/job_posting/_details.html.erb +59 -0
  22. data/app/views/rich_snippet/job_posting/details.html.erb +1 -0
  23. data/app/views/rich_snippet/offer/_details.html.erb +35 -0
  24. data/app/views/rich_snippet/offer/details.html.erb +1 -0
  25. data/app/views/rich_snippet/organization/_details.html.erb +39 -0
  26. data/app/views/rich_snippet/organization/details.html.erb +1 -0
  27. data/app/views/rich_snippet/person/_details.html.erb +79 -0
  28. data/app/views/rich_snippet/person/details.html.erb +1 -0
  29. data/app/views/rich_snippet/postal_address/_details.html.erb +39 -0
  30. data/app/views/rich_snippet/postal_address/details.html.erb +1 -0
  31. data/app/views/rich_snippet/product/_details.html.erb +55 -0
  32. data/app/views/rich_snippet/product/details.html.erb +1 -0
  33. data/app/views/rich_snippet/recipe/_details.html.erb +91 -0
  34. data/app/views/rich_snippet/recipe/details.html.erb +1 -0
  35. data/app/views/rich_snippet/thing/_details.html.erb +17 -0
  36. data/app/views/rich_snippet_widget/details.html.erb +11 -0
  37. data/app/views/rich_snippet_widget/show.html.erb +21 -0
  38. data/app/views/rich_snippet_widget/thumbnail.html.erb +3 -0
  39. data/config/routes.rb +2 -0
  40. data/lib/scrivito_rich_snippet_widget.rb +5 -0
  41. data/lib/scrivito_rich_snippet_widget/engine.rb +5 -0
  42. data/lib/scrivito_rich_snippet_widget/version.rb +3 -0
  43. data/lib/tasks/scrivito_rich_snippet_widget_tasks.rake +4 -0
  44. metadata +100 -0
@@ -0,0 +1 @@
1
+ <%= render 'rich_snippet/recipe/details', obj: @obj %>
@@ -0,0 +1,17 @@
1
+ <%= scrivito_details_for "Base attributes" do %>
2
+ <%= scrivito_details_for 'Title' do %>
3
+ <%= scrivito_tag :div, obj, :title %>
4
+ <% end %>
5
+
6
+ <%= scrivito_details_for 'Description' do %>
7
+ <%= scrivito_tag :div, obj, :description %>
8
+ <% end %>
9
+
10
+ <%= scrivito_details_for 'Image' do %>
11
+ <%= scrivito_tag :div, obj, :image, data: {scrivito_editors_filter_context: {image: true}} %>
12
+ <% end %>
13
+
14
+ <%= scrivito_details_for "Url #{url_is_mandatory ? '*' : ''}" do %>
15
+ <%= scrivito_tag :div, obj, :url %>
16
+ <% end %>
17
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%= scrivito_large_dialog do %>
2
+ <%= scrivito_details_for 'Snippet' do %>
3
+ <%= scrivito_tag :div, widget, :snippet, data: {scrivito_editors_reload: true, scrivito_editors_filter_context: {rich_snippet_filter: 'all'}} %>
4
+ <% end %>
5
+
6
+ <% if widget.snippet %>
7
+ <%= scrivito_details_for "Data fo selected #{widget.module}" do %>
8
+ <%= render "#{widget.type}/details", obj: widget.snippet %>
9
+ <% end %>
10
+ <% end %>
11
+ <% end %>
@@ -0,0 +1,21 @@
1
+ <% if scrivito_in_editable_view? %>
2
+ <div class="alert alert-info">
3
+ <strong>Rich Snippet Widget - Infos</strong>
4
+ <p>This is Widget has no visible view.</p>
5
+ </div>
6
+ <br>
7
+ <div class="alert alert-warning">
8
+ <strong>Rich Snippet Widget - Warnings</strong>
9
+ <ul>
10
+ <% widget.warnings.each do |w| %>
11
+ <li><%= w %></li>
12
+ <% end %>
13
+ </ul>
14
+ </div>
15
+ <% end %>
16
+
17
+ <% if widget.snippet %>
18
+ <script type="application/ld+json">
19
+ <%= raw(widget.to_json) %>
20
+ </script>
21
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= scrivito_thumbnail t('scrivito_rich_snippet_widget.thumbnail.title', default: 'Rich snippet'), image_tag("widgets/scrivito_rich_snippet_widget.png") do %>
2
+ <%= t('scrivito_rich_snippet_widget.thumbnail.description', default: 'Add a rich snippet to add more information for bots.') %>
3
+ <% end %>
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ ScrivitoRichSnippetWidget::Engine.routes.draw do
2
+ end
@@ -0,0 +1,5 @@
1
+ require "scrivito_rich_snippet_widget/engine"
2
+
3
+ module ScrivitoRichSnippetWidget
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,5 @@
1
+ module ScrivitoRichSnippetWidget
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace ScrivitoRichSnippetWidget
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module ScrivitoRichSnippetWidget
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :scrivito_rich_snippet_widget do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scrivito_rich_snippet_widget
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gert Geidel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: scrivito
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Add a rich snippet to your page
28
+ email:
29
+ - gert.geidel@infopark.de
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - README.md
35
+ - Rakefile
36
+ - app/assets/images/widgets/scrivito_rich_snippet_widget.png
37
+ - app/assets/javascripts/scrivito_rich_snippet_widget.js
38
+ - app/models/rich_snippet/creative_work.rb
39
+ - app/models/rich_snippet/event.rb
40
+ - app/models/rich_snippet/job_posting.rb
41
+ - app/models/rich_snippet/offer.rb
42
+ - app/models/rich_snippet/organization.rb
43
+ - app/models/rich_snippet/person.rb
44
+ - app/models/rich_snippet/postal_address.rb
45
+ - app/models/rich_snippet/product.rb
46
+ - app/models/rich_snippet/recipe.rb
47
+ - app/models/rich_snippet/thing.rb
48
+ - app/models/rich_snippet_widget.rb
49
+ - app/views/rich_snippet/creative_work/_details.html.erb
50
+ - app/views/rich_snippet/creative_work/details.html.erb
51
+ - app/views/rich_snippet/event/_details.html.erb
52
+ - app/views/rich_snippet/event/details.html.erb
53
+ - app/views/rich_snippet/job_posting/_details.html.erb
54
+ - app/views/rich_snippet/job_posting/details.html.erb
55
+ - app/views/rich_snippet/offer/_details.html.erb
56
+ - app/views/rich_snippet/offer/details.html.erb
57
+ - app/views/rich_snippet/organization/_details.html.erb
58
+ - app/views/rich_snippet/organization/details.html.erb
59
+ - app/views/rich_snippet/person/_details.html.erb
60
+ - app/views/rich_snippet/person/details.html.erb
61
+ - app/views/rich_snippet/postal_address/_details.html.erb
62
+ - app/views/rich_snippet/postal_address/details.html.erb
63
+ - app/views/rich_snippet/product/_details.html.erb
64
+ - app/views/rich_snippet/product/details.html.erb
65
+ - app/views/rich_snippet/recipe/_details.html.erb
66
+ - app/views/rich_snippet/recipe/details.html.erb
67
+ - app/views/rich_snippet/thing/_details.html.erb
68
+ - app/views/rich_snippet_widget/details.html.erb
69
+ - app/views/rich_snippet_widget/show.html.erb
70
+ - app/views/rich_snippet_widget/thumbnail.html.erb
71
+ - config/routes.rb
72
+ - lib/scrivito_rich_snippet_widget.rb
73
+ - lib/scrivito_rich_snippet_widget/engine.rb
74
+ - lib/scrivito_rich_snippet_widget/version.rb
75
+ - lib/tasks/scrivito_rich_snippet_widget_tasks.rake
76
+ homepage: https://scrivito.com
77
+ licenses:
78
+ - LPGL-3
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.5.1
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Add a rich snippet to your page
100
+ test_files: []