redmine_crm 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/doc/CHANGELOG +5 -1
- data/lib/redmine_crm.rb +2 -0
- data/lib/redmine_crm/helpers/external_assets_helper.rb +0 -1
- data/lib/redmine_crm/helpers/form_tag_helper.rb +40 -0
- data/lib/redmine_crm/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92635e6f0499ac5b1796630c2f6cbfad4e4e7155
|
4
|
+
data.tar.gz: 0fc303aa0ea4ae0d62b5a309236f4c0a0fa08b98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89f55f9402861d004b5ab7b552bea9fe5854f61f18797333364c66f8b9473bc7ce3c949c15fbc2a3ca27d4a54881092cca33894a5516a58c2ea93dcfa7f12740
|
7
|
+
data.tar.gz: ada540ad5f9e398420e4c7d89fe66e4a21ff2fb238cd9cc0cf65b77c4dcf6565127efd54a80c54b46c89b1f8161ad8742495f775cdf25f3801b525634760a0f1
|
data/.gitignore
CHANGED
data/doc/CHANGELOG
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
== Redmine CRM gem changelog
|
2
2
|
|
3
3
|
Redmine crm gem - general functions for plugins (tags, vote, viewing, currency)
|
4
|
-
Copyright (C) 2011-
|
4
|
+
Copyright (C) 2011-2018 RedmineUP
|
5
5
|
https://www.redmineup.com/
|
6
6
|
|
7
|
+
== 2018-03-05 v0.0.35
|
8
|
+
|
9
|
+
* Added select2_tag helper
|
10
|
+
|
7
11
|
== 2017-12-22 v0.0.34
|
8
12
|
|
9
13
|
* Fixed bug with Redmine 2.x support
|
data/lib/redmine_crm.rb
CHANGED
@@ -24,6 +24,7 @@ require 'redmine_crm/liquid/drops/projects_drop'
|
|
24
24
|
require 'redmine_crm/liquid/drops/users_drop'
|
25
25
|
|
26
26
|
require 'redmine_crm/helpers/external_assets_helper'
|
27
|
+
require 'redmine_crm/helpers/form_tag_helper'
|
27
28
|
require 'redmine_crm/assets_manager'
|
28
29
|
|
29
30
|
if defined?(ActiveRecord::Base)
|
@@ -36,6 +37,7 @@ RedmineCrm::AssetsManager.install_assets
|
|
36
37
|
|
37
38
|
if defined?(ActionView::Base)
|
38
39
|
ActionView::Base.send :include, RedmineCrm::ExternalAssetsHelper
|
40
|
+
ActionView::Base.send :include, RedmineCrm::FormTagHelper
|
39
41
|
end
|
40
42
|
|
41
43
|
def requires_redmine_crm(arg)
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module RedmineCrm
|
2
|
+
module FormTagHelper
|
3
|
+
def select2_tag(name, option_tags = nil, options = {})
|
4
|
+
id = sanitize_to_id(name)
|
5
|
+
url = options[:url].to_s
|
6
|
+
data = options[:data] || []
|
7
|
+
placeholder = options[:placeholder] || 'Select ...'
|
8
|
+
|
9
|
+
data_source =
|
10
|
+
if url.empty?
|
11
|
+
"data: #{data.to_json}"
|
12
|
+
else
|
13
|
+
"ajax: {
|
14
|
+
url: '#{url}',
|
15
|
+
dataType: 'json',
|
16
|
+
delay: 250,
|
17
|
+
data: function (params) {
|
18
|
+
return { q: params.term };
|
19
|
+
},
|
20
|
+
processResults: function (data, params) {
|
21
|
+
return { results: data };
|
22
|
+
},
|
23
|
+
cache: true
|
24
|
+
}"
|
25
|
+
end
|
26
|
+
|
27
|
+
content_for(:header_tags) { select2_assets }
|
28
|
+
result = select_tag(name, option_tags, options)
|
29
|
+
result << javascript_tag(<<-JS)
|
30
|
+
$(function () {
|
31
|
+
$('select#' + '#{id}').select2({
|
32
|
+
#{data_source},
|
33
|
+
tags: #{options[:tags] || false},
|
34
|
+
placeholder: '#{placeholder}'
|
35
|
+
});
|
36
|
+
});
|
37
|
+
JS
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/redmine_crm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_crm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RedmineUP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- lib/redmine_crm/currency/heuristics.rb
|
59
59
|
- lib/redmine_crm/currency/loader.rb
|
60
60
|
- lib/redmine_crm/helpers/external_assets_helper.rb
|
61
|
+
- lib/redmine_crm/helpers/form_tag_helper.rb
|
61
62
|
- lib/redmine_crm/helpers/tags_helper.rb
|
62
63
|
- lib/redmine_crm/helpers/vote_helper.rb
|
63
64
|
- lib/redmine_crm/liquid/drops/issues_drop.rb
|