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 +4 -4
- data/app/assets/javascripts/tramway/core/application.js.coffee +3 -0
- data/app/controllers/tramway/core/application_controller.rb +1 -3
- data/app/decorators/tramway/core/application_decorator.rb +1 -0
- data/app/helpers/tramway/core/copy_to_clipboard_helper.rb +13 -0
- data/app/models/tramway/core/application_record.rb +2 -2
- data/lib/tramway/collections/helper.rb +1 -1
- data/lib/tramway/core.rb +2 -2
- data/lib/tramway/core/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90e0f6addfaa061388a54435ff519ba09544d1948dc8a2130f51457b23bef215
|
4
|
+
data.tar.gz: eb50727af2688a79eaa59b64320b1d127deb02658d2f0fc3587e7c6f43069217
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
@@ -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, ->
|
23
|
-
scope :admin_scope, ->
|
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"
|
data/lib/tramway/core.rb
CHANGED
data/lib/tramway/core/version.rb
CHANGED
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:
|
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-
|
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
|