scrivito_crm_event_widget 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6d9e09e76b6b68e66d0710ffd266150ef327481b
4
+ data.tar.gz: df48b9e576ef5e68b5a02c59e7709259e3166f42
5
+ SHA512:
6
+ metadata.gz: 7f61b72dad44a5b00bb72f50629e9fe9dd9c1a3b154a68caa1cd9e46d1b5eb1ec6b75698125cad0e4e6b4af9cdd9ddf1c61e43c7a80666ac3a6f883bcda008af
7
+ data.tar.gz: ea9ba70fda8a8eae2bae3940e2398dd6000f218f6f57eb14fff4b2b5f683f8604a0d1f1830bacc2baf4ac567318bd528b6dc61f4b2ccb0d9fa77def5e366196b
data/LICENSE ADDED
@@ -0,0 +1,4 @@
1
+ Copyright (c) 2009 - 2014 Infopark AG (http://www.infopark.com)
2
+
3
+ This software can be used and modified under the LGPL-3.0. Please refer to
4
+ http://www.gnu.org/licenses/lgpl-3.0.html for the license text.
data/Rakefile ADDED
@@ -0,0 +1,21 @@
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
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'ScrivitoCrmEvent'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
@@ -0,0 +1,24 @@
1
+ .crm_event {
2
+ margin: 10px 0;
3
+ }
4
+ .crm_event h4 {
5
+ font-size: 18px;
6
+ font-weight: bold;
7
+ }
8
+ .crm_event .date .title {
9
+ font-weight: bold;
10
+ border: none;
11
+ margin: 0;
12
+ }
13
+ .crm_event .date .value {
14
+ margin-bottom: 10px;
15
+ }
16
+
17
+ .crm_event .location .title {
18
+ font-weight: bold;
19
+ border: none;
20
+ margin: 0;
21
+ }
22
+ .crm_event .location .value {
23
+ margin-bottom: 10px;
24
+ }
@@ -0,0 +1,34 @@
1
+ class CrmEventWidget < Widget
2
+
3
+ def crm_event
4
+ self.event
5
+ end
6
+
7
+ def event_title
8
+ self.overwrite_title ? self.overwrite_title : crm_event_obj.title
9
+ end
10
+
11
+ def crm_event_obj
12
+ @event ||= Infopark::Crm::Event.find(crm_event)
13
+ rescue # no crm event found or no event set
14
+ nil
15
+ end
16
+
17
+ def location?
18
+ self.crm_event_obj && self.crm_event_obj.location
19
+ end
20
+
21
+ def start_time
22
+ format_time(self.crm_event_obj.dtstart_at)
23
+ end
24
+
25
+ def end_time
26
+ format_time(self.crm_event_obj.dtend_at)
27
+ end
28
+
29
+ private
30
+
31
+ def format_time(time)
32
+ I18n.l(time.to_date, format: :long)
33
+ end
34
+ end
@@ -0,0 +1,3 @@
1
+ <div class="alert alert-info">
2
+ An event must be selected on the edit view.
3
+ </div>
@@ -0,0 +1,33 @@
1
+ <div class="crm_event" itemsope="<%= true %>" itemtype="https://schema.org/Event">
2
+ <h4 itemprop="name">
3
+ <%= widget.event_title %>
4
+ </h4>
5
+ <div class="date">
6
+ <div class="start" content="<%= widget.crm_event_obj.dtstart_at %>" itemprop="startDate">
7
+ <div class="title">
8
+ Start
9
+ </div>
10
+ <div class="value">
11
+ <%= widget.start_time %>
12
+ </div>
13
+ </div>
14
+ <div class="end" content="<%= widget.crm_event_obj.dtend_at %>" itemprop="endDate">
15
+ <div class="title">
16
+ End
17
+ </div>
18
+ <div class="value" content="<%= widget.crm_event_obj.dtend_at %>" itemprop="endDate">
19
+ <%= widget.end_time %>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <% if widget.location? %>
24
+ <div class="location" itemprop="Location" itemscope="<%= true %>" itemtype="http://schema.org/Place">
25
+ <div class="title">
26
+ Location
27
+ </div>
28
+ <div class="value" itemprop="name">
29
+ <%= widget.crm_event_obj.location %>
30
+ </div>
31
+ </div>
32
+ <% end %>
33
+ </div>
@@ -0,0 +1,5 @@
1
+ <h4>Title of Event to overwrite Title from CRM if needed</h4>
2
+ <%= scrivito_tag(:div, widget, :overwrite_title) %>
3
+
4
+ <h4>Event ID from CRM</h4>
5
+ <%= scrivito_tag(:div, widget, :event) %>
@@ -0,0 +1,5 @@
1
+ <% if widget.event.blank? %>
2
+ <%= render "crm_event_widget/alert" %>
3
+ <% else %>
4
+ <%= render "crm_event_widget/content", widget: widget %>
5
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <div class="editing-dialog-thumbnail">
2
+ <div class="visualization">
3
+ <span class="icon editing-icon-ip"></span>
4
+ </div>
5
+
6
+ <div class="title">
7
+ CRM Event
8
+ </div>
9
+
10
+ <div class="description">
11
+ Shows Data from an Event from Infopark CRM.
12
+ </div>
13
+ </div>
@@ -0,0 +1,4 @@
1
+ require "scrivito_crm_event_widget/engine"
2
+
3
+ module ScrivitoCrmEventWidget
4
+ end
@@ -0,0 +1,5 @@
1
+ module ScrivitoCrmEventWidget
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace ScrivitoCrmEventWidget
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module ScrivitoCrmEventWidget
2
+ VERSION = "1.0.1"
3
+ end
@@ -0,0 +1,14 @@
1
+ class CreateCrmEventWidget < ::Scrivito::Migration
2
+ def up
3
+ Scrivito::ObjClass.create(
4
+ name: 'CrmEventWidget',
5
+ type: 'publication',
6
+ is_binary: false,
7
+ title: 'CRM Event',
8
+ attributes: [
9
+ {name: "event", type: "string"},
10
+ {name: "overwrite_title", type: "string"}
11
+ ]
12
+ )
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scrivito_crm_event_widget
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Scrivito
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
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
+ - !ruby/object:Gem::Dependency
28
+ name: scrivito_sdk
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: infopark_crm_connector
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Scrivito CRM Event Widget
70
+ email:
71
+ - support@scrivito.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - LICENSE
77
+ - Rakefile
78
+ - app/assets/stylesheets/crm_event_widget/application.css
79
+ - app/models/crm_event_widget.rb
80
+ - app/views/crm_event_widget/_alert.html.erb
81
+ - app/views/crm_event_widget/_content.html.erb
82
+ - app/views/crm_event_widget/details.html.erb
83
+ - app/views/crm_event_widget/show.html.erb
84
+ - app/views/crm_event_widget/thumbnail.html.erb
85
+ - lib/scrivito_crm_event_widget.rb
86
+ - lib/scrivito_crm_event_widget/engine.rb
87
+ - lib/scrivito_crm_event_widget/version.rb
88
+ - scrivito/migrate/0_create_crm_event_widget.rb
89
+ homepage: https://www.scrivito.com
90
+ licenses:
91
+ - LGPL-3.0
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.3.0
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Scrivito CRM Event Widget
113
+ test_files: []