tramway-core 1.16 → 1.16.1

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
  SHA256:
3
- metadata.gz: b65406e59a86c298559e164d9e16a55b62f83b20ecba159b86b682aa9af037bc
4
- data.tar.gz: 7a4177835f457e7b5c48f59c0980965c3c05052d75d3f52b2c1f7a9a4f270ca9
3
+ metadata.gz: 90e0f6addfaa061388a54435ff519ba09544d1948dc8a2130f51457b23bef215
4
+ data.tar.gz: eb50727af2688a79eaa59b64320b1d127deb02658d2f0fc3587e7c6f43069217
5
5
  SHA512:
6
- metadata.gz: 480f307ce1de6c9202e5a9d42539df4f34b8374037c5d643ab61592374f592fddeb63890eb094e61ee6c667660088121feb0158bf7b374c605d3a3236ac4bf77
7
- data.tar.gz: 5e96737dabbb4aace66cc0123ea1d59c0b7cd11aad65ce544153213394c359accd6544d6f3515dbbd4a98b5ec7d5639e4a2c208b79d3f452639630b5591ac919
6
+ metadata.gz: 7a22b749b982662f6c9aace0e951d5d408107501311143312bd38240d0a8fe33d0f4bfa9c9c58c4766ff4362944b0fc74a402e2bfc228f5729606297ffea7268
7
+ data.tar.gz: 8cfa52bb4c944ec0fb3f60875eaa7be874905d58be07943ae93775556bf4e651e6207d91f7216df717af657fae1121e7771e611c2e88c65ddd0ba22eccc2fc8c
@@ -4,6 +4,7 @@
4
4
  #= require bootstrap-datepicker-1.8.0
5
5
  #= require bootstrap-datepicker-1.8.0.ru.min
6
6
  #= require font_awesome5
7
+ #= require clipboard
7
8
  #= require_tree .
8
9
 
9
10
  window.i18n_locale = (locale) ->
@@ -28,3 +29,5 @@ $(document).ready ->
28
29
  anchor = $(this).data('anchor')
29
30
  unless $(anchor).offset() == undefined
30
31
  $(window).scrollTop $(anchor).offset().top
32
+
33
+ clipboard = new Clipboard '.clipboard-btn'
@@ -11,9 +11,7 @@ module Tramway
11
11
  end
12
12
 
13
13
  def load_extensions
14
- if defined? ::Tramway::Extensions
15
- ::Tramway::Extensions.load
16
- end
14
+ ::Tramway::Extensions.load if defined? ::Tramway::Extensions
17
15
  end
18
16
  end
19
17
  end
@@ -6,6 +6,7 @@ class Tramway::Core::ApplicationDecorator
6
6
  include ActionView::Helpers
7
7
  include ActionView::Context
8
8
  include ::FontAwesome5::Rails::IconHelper
9
+ include ::Tramway::Core::CopyToClipboardHelper
9
10
 
10
11
  def initialize(object)
11
12
  @object = object
@@ -0,0 +1,13 @@
1
+ module Tramway
2
+ module Core
3
+ module CopyToClipboardHelper
4
+ def copy_to_clipboard(id)
5
+ button_tag class: 'btn btn-info clipboard-btn',
6
+ data: { clipboard_action: 'copy', clipboard_target: "##{id}" },
7
+ style: 'margin-left: 15px' do
8
+ fa_icon 'copy'
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -19,8 +19,8 @@ module Tramway
19
19
  end
20
20
 
21
21
  scope :active, -> { where state: :active }
22
- scope :created_by_user, -> (user_id) { joins(:audits).where('audits.action = \'create\' AND audits.user_id = ?', user_id) }
23
- scope :admin_scope, -> (_arg) { all }
22
+ scope :created_by_user, ->(user_id) { joins(:audits).where('audits.action = \'create\' AND audits.user_id = ?', user_id) }
23
+ scope :admin_scope, ->(_arg) { all }
24
24
 
25
25
  include ::PgSearch::Model
26
26
 
@@ -4,7 +4,7 @@ module Tramway
4
4
  module Collections
5
5
  module Helper
6
6
  def collection_list_by(name:)
7
- begin
7
+ begin
8
8
  require name # needed to load class name with collection
9
9
  rescue LoadError
10
10
  raise "No such file #{name}. You should create file in the `lib/#{name}.rb` or elsewhere you want"
@@ -23,11 +23,11 @@ module Tramway
23
23
  if @application&.model_class.present?
24
24
  begin
25
25
  @application.model_class.first
26
- rescue
26
+ rescue StandardError
27
27
  nil
28
28
  end
29
29
  else
30
- @application
30
+ @application
31
31
  end
32
32
  end
33
33
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Core
5
- VERSION = '1.16'
5
+ VERSION = '1.16.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.16'
4
+ version: 1.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-26 00:00:00.000000000 Z
11
+ date: 2020-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: audited
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.2.4
69
+ - !ruby/object:Gem::Dependency
70
+ name: clipboard-rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: enumerize
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -346,6 +360,7 @@ files:
346
360
  - app/forms/tramway/core/extendable_form.rb
347
361
  - app/forms/tramway/core/extended_application_form.rb
348
362
  - app/forms/tramway/core/form_creator.rb
363
+ - app/helpers/tramway/core/copy_to_clipboard_helper.rb
349
364
  - app/helpers/tramway/core/title_helper.rb
350
365
  - app/inputs/date_picker_input.rb
351
366
  - app/models/tramway/core/application_record.rb