scrivito_jr_form_widget 0.0.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/scripts/scrivito_jr_form_widget.js +1 -0
- data/app/assets/styles/scrivito_jr_form_widget.css +3 -0
- data/app/presenter/jr_form_presenter.rb +17 -4
- data/app/views/jr_form_widget/_jr_enum.html.erb +13 -0
- data/app/views/jr_form_widget/_jr_multienum.html.erb +6 -0
- data/app/views/jr_form_widget/details.html.erb +1 -1
- data/lib/scrivito_jr_form_widget/engine.rb +3 -0
- data/lib/scrivito_jr_form_widget/version.rb +1 -1
- metadata +19 -3
- data/app/views/jr_form_widget/_jr_multienum.ht.erb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ee1a72684b73e424602646e50c8f183ae492e9
|
4
|
+
data.tar.gz: 95caeeab2477e3d6073f87e192b91ad97af27338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce92c28efc8c6fdc7b4f010e6ddf081a11e74bb3dffed16cf679a1191a0705d760bdb7adc72fbdc733972f2cd9c5a0108863ccca7ba285c152e6fc3a7005704
|
7
|
+
data.tar.gz: 520e9a656460de6c73ae5605706eadc7011b9eb2d329de6480daa90080e10601067bb300138205125da5002e1bfb8b3de9cf5927628cdd673e5825efc0056dbb
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require scrivito_advanced_editors
|
@@ -1,4 +1,9 @@
|
|
1
1
|
class JrFormPresenter < JrFormAttributes
|
2
|
+
|
3
|
+
def attribute_names
|
4
|
+
@type.standard_attrs.keys + @type.custom_attrs.keys
|
5
|
+
end
|
6
|
+
|
2
7
|
def initialize(widget, request, controller)
|
3
8
|
@widget = widget
|
4
9
|
@activity = widget.activity
|
@@ -11,9 +16,19 @@ class JrFormPresenter < JrFormAttributes
|
|
11
16
|
end
|
12
17
|
|
13
18
|
def submit
|
14
|
-
contact =
|
19
|
+
contact = nil
|
20
|
+
|
21
|
+
if @params['custom_email'] && @params['custom_last_name']
|
22
|
+
contact = manipulate_or_create_user
|
23
|
+
end
|
24
|
+
|
25
|
+
if contact
|
26
|
+
set_params_for_activty(contact)
|
27
|
+
end
|
15
28
|
|
16
|
-
|
29
|
+
@params["title"] = @params[:title].empty? ? @activity.id : @params[:title]
|
30
|
+
@params["type_id"] = @activity.id
|
31
|
+
@params["state"] = 'created'
|
17
32
|
|
18
33
|
activity = JustRelate::Activity.create(@params)
|
19
34
|
|
@@ -50,8 +65,6 @@ class JrFormPresenter < JrFormAttributes
|
|
50
65
|
end
|
51
66
|
|
52
67
|
@params["contact_ids"] = contact.id
|
53
|
-
@params["type_id"] = @activity.id
|
54
|
-
@params["state"] = 'created'
|
55
68
|
end
|
56
69
|
|
57
70
|
def redirect_path(page, widget)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="form-group">
|
2
|
+
<%= form.label name.to_sym, class: "control-label col-sm-3 #{options[:mandatory] ? 'mandatory' : ''}" %>
|
3
|
+
<div class="col-sm-9">
|
4
|
+
<% options['valid_values'].each do |value| %>
|
5
|
+
<div class="radio">
|
6
|
+
<%= form.label "#{name}_#{value.downcase}" do %>
|
7
|
+
<%= form.radio_button name.to_sym, value %>
|
8
|
+
<%= t("helpers.label.jr_form_presenter.#{name}_option.#{value.downcase}") %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
13
|
+
</div>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<div class="form-group">
|
2
|
+
<%= form.label name.to_sym, class: "control-label col-sm-3 #{options[:mandatory] ? 'mandatory' : ''}" %>
|
3
|
+
<div class="col-sm-9">
|
4
|
+
<%= form.select name.to_sym, options['valid_values'], {}, {multiple: true, class: 'form-control'} %>
|
5
|
+
</div>
|
6
|
+
</div>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
</div>
|
18
18
|
|
19
19
|
<div class="tab-panel" id="edit-tags">
|
20
|
-
<h4>Tags <abbr title="optional attribute. can be used to add tags to a contact like has_visited_event. contatc will be calculated by the custom attributes email and last_name of your selected activtiy. If this fields do not exist, this field has no effect." class="initialism"></abbr></h4>
|
20
|
+
<h4>Tags for Contact <abbr title="optional attribute. can be used to add tags to a contact like has_visited_event. contatc will be calculated by the custom attributes email and last_name of your selected activtiy. If this fields do not exist, this field has no effect." class="initialism"></abbr></h4>
|
21
21
|
<%= scrivito_tag :div, widget, :tags, data: {editor: 'scrivito-list-editor'} %>
|
22
22
|
</div>
|
23
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrivito_jr_form_widget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: active_attr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,12 +90,14 @@ files:
|
|
76
90
|
- LICENSE
|
77
91
|
- Rakefile
|
78
92
|
- app/assets/images/form.png
|
93
|
+
- app/assets/scripts/scrivito_jr_form_widget.js
|
94
|
+
- app/assets/styles/scrivito_jr_form_widget.css
|
79
95
|
- app/controllers/scrivito_jr_form_widget/application_controller.rb
|
80
96
|
- app/models/jr_form_widget.rb
|
81
97
|
- app/presenter/jr_form_presenter.rb
|
82
98
|
- app/views/jr_form_widget/_form.html.erb
|
83
99
|
- app/views/jr_form_widget/_jr_enum.html.erb
|
84
|
-
- app/views/jr_form_widget/_jr_multienum.
|
100
|
+
- app/views/jr_form_widget/_jr_multienum.html.erb
|
85
101
|
- app/views/jr_form_widget/_jr_string.html.erb
|
86
102
|
- app/views/jr_form_widget/_jr_text.html.erb
|
87
103
|
- app/views/jr_form_widget/details.html.erb
|
File without changes
|