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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b05a60d81fa656ebd71d75aa3871db0025c63242
4
- data.tar.gz: 3ce1eb527b7b90f316bf5d0883b8d129b12d5045
3
+ metadata.gz: 92635e6f0499ac5b1796630c2f6cbfad4e4e7155
4
+ data.tar.gz: 0fc303aa0ea4ae0d62b5a309236f4c0a0fa08b98
5
5
  SHA512:
6
- metadata.gz: 8673d2669a5948e9cc52cf1a294f3d4c6aafa8ff60a3c8346e02ceb03347909b15d5bfb70aa5cca9b7a8e0700f8dd9766924e4612b9cc4beb59e41b5f7d4b3c1
7
- data.tar.gz: c99defa93349703c1e4bb22c87bb86de377a1c12b073f091e71da2246c64137684aac82d667bb9c6056d62c54ba928a4592f169f298d311605fdbd81c7e0a22d
6
+ metadata.gz: 89f55f9402861d004b5ab7b552bea9fe5854f61f18797333364c66f8b9473bc7ce3c949c15fbc2a3ca27d4a54881092cca33894a5516a58c2ea93dcfa7f12740
7
+ data.tar.gz: ada540ad5f9e398420e4c7d89fe66e4a21ff2fb238cd9cc0cf65b77c4dcf6565127efd54a80c54b46c89b1f8161ad8742495f775cdf25f3801b525634760a0f1
data/.gitignore CHANGED
@@ -15,4 +15,5 @@ mkmf.log
15
15
  /Guardfile
16
16
  /Gemfile.local
17
17
  /Gemfile.local.lock
18
- *.gem
18
+ *.gem
19
+ /.idea/*
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-2017 RedmineUP
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)
@@ -1,7 +1,6 @@
1
1
  module RedmineCrm
2
2
  module ExternalAssetsHelper
3
3
  include ActionView::Helpers::JavaScriptHelper
4
- include ActionView::Helpers::JavaScriptHelper
5
4
 
6
5
  def select2_assets
7
6
  return if @select2_tag_included
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RedmineCrm
2
- VERSION = "0.0.34"
2
+ VERSION = "0.0.35"
3
3
  end
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.34
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: 2017-12-22 00:00:00.000000000 Z
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