Skip to content

Commit

Permalink
Merge 5a761fa into d91634e
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Jan 28, 2020
2 parents d91634e + 5a761fa commit 8c558f2
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module ApplicationHelper
include ::Tramway::Admin::InputsHelper
include ::Tramway::Admin::FocusGeneratorHelper
include ::Tramway::Collections::Helper
include ::Tramway::Core::CopyToClipboardHelper

def object_type(object)
object_class_name = if object.class.ancestors.include? ::Tramway::Core::ApplicationDecorator
Expand Down
2 changes: 1 addition & 1 deletion tramway-admin/lib/tramway/admin/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Tramway
module Admin
VERSION = '1.21.1'
VERSION = '1.21.2'
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#= require bootstrap-datepicker-1.8.0
#= require bootstrap-datepicker-1.8.0.ru.min
#= require font_awesome5
#= require clipboard
#= require_tree .

window.i18n_locale = (locale) ->
Expand All @@ -28,3 +29,5 @@ $(document).ready ->
anchor = $(this).data('anchor')
unless $(anchor).offset() == undefined
$(window).scrollTop $(anchor).offset().top

clipboard = new Clipboard '.clipboard-btn'
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Tramway::Core::ApplicationDecorator
include ActionView::Helpers
include ActionView::Context
include ::FontAwesome5::Rails::IconHelper
include ::Tramway::Core::CopyToClipboardHelper

def initialize(object)
@object = object
Expand Down
13 changes: 13 additions & 0 deletions tramway-core/app/helpers/tramway/core/copy_to_clipboard_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Tramway
module Core
module CopyToClipboardHelper
def copy_to_clipboard(id)
button_tag class: 'btn btn-info clipboard-btn',
data: { clipboard_action: 'copy', clipboard_target: "##{id}" },
style: 'margin-left: 15px' do
fa_icon 'copy'
end
end
end
end
end
2 changes: 1 addition & 1 deletion tramway-core/lib/tramway/core/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Tramway
module Core
VERSION = '1.16'
VERSION = '1.16.1'
end
end
1 change: 1 addition & 0 deletions tramway-core/tramway-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency 'bootstrap', '>= 4.1.2'
s.add_dependency 'carrierwave'
s.add_dependency 'ckeditor', '4.2.4'
s.add_dependency 'clipboard-rails'
s.add_dependency 'enumerize', '~> 2.1', '>= 2.1.2'
s.add_dependency 'font_awesome5_rails'
s.add_dependency 'haml-rails', '~> 1.0', '>= 1.0.0'
Expand Down
9 changes: 3 additions & 6 deletions tramway-event/app/decorators/tramway/event/event_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ def events_link
event_link = Tramway::Event::Engine.routes.url_helpers.event_path object
event_url = ['molodoy.online', event_link].join
content_tag(:div) do
concat link_to event_url, event_url, id: "event#{object.id}"
concat(button_tag(class: 'btn btn-info clipboard-btn',
data: { clipboard_action: 'copy', clipboard_target: "#event#{object.id}" },
style: 'margin-left: 15px') do
fa_icon 'copy'
end)
id = "event#{object.id}"
concat link_to event_url, event_url, id: id
concat copy_to_clipboard id
end
end

Expand Down
2 changes: 1 addition & 1 deletion tramway-event/lib/tramway/event/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Tramway
module Event
VERSION = '1.9.26'
VERSION = '1.9.27'
end
end

0 comments on commit 8c558f2

Please sign in to comment.