itsf_backend 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dba7df55da3a16d726325289495274aaaa991f6
4
- data.tar.gz: cd5b43538b9080d8b761df1a3959ccb8437501b2
3
+ metadata.gz: 2f1b86c4aa65634b90349e3fbc673e04a9b816ec
4
+ data.tar.gz: 2b08e227d30f8f6f2a849c4a40e198aaef55576a
5
5
  SHA512:
6
- metadata.gz: b24be68819b940e891f24b8b13fc629c4bf87aeea222121216274a03d5744bc5d74c78ce8f752756c40315abaefcecaf25e0aae28ebfad2b46b6670a95cd814a
7
- data.tar.gz: 85f12a5f32d79b7528629f6185a50e95d72f2cb2b9be2dca096f2105dea607604f0f85b5a2f825da8fbe50a426fae735cbc275aa64b3d722478d8721576b299c
6
+ metadata.gz: e540d7d6407761e2889a528cc60af49a6f776976a03b3e752bd5f97dca98d8a70f4b9c7a8e9ad434a0fa97d14ff2f699c2ec35226d61ccf0f4fdad066c2e223f
7
+ data.tar.gz: '01886d83618e7b581c36905c9f2166a01621f9887a4b70c7357d0f591a4ba09efa9051c7c3c78d6e60be23805227b7f3bd9534893abac2f9b4442f111fafd89d'
@@ -5,9 +5,15 @@ module Controller
5
5
  def toggle_published
6
6
  @resource = load_resource
7
7
  @resource.toggle_published!
8
+
8
9
  action_taken = @resource.published? ? 'published' : 'unpublished'
9
10
  resource_label = @resource.try_all(*Itsf::Backend::Configuration.resource_title_methods)
10
- redirect_to :back, notice: I18n.t("acts_as_published.notices.#{action_taken}", name: resource_label)
11
+ if Rails.version < '5.0.0'
12
+ redirect_to :back, notice: I18n.t("acts_as_published.notices.#{action_taken}", name: resource_label)
13
+ else
14
+ flash[:notice] = I18n.t("acts_as_published.notices.#{action_taken}", name: resource_label)
15
+ redirect_back(fallback_location: main_app.root_path)
16
+ end
11
17
  end
12
18
  end
13
19
  end
@@ -8,12 +8,12 @@ module ResourceRow
8
8
  link_path = view_context.controller.url_for(action: :toggle_published, id: resource.to_param)
9
9
  column(:column_published_actions) do |resource|
10
10
  if resource.published?
11
- view_context.link_to(link_path, class: 'btn btn-xs btn-danger btn-responsive', method: :post) do
11
+ view_context.button_to(link_path, class: 'btn btn-xs btn-danger btn-responsive', method: :post) do
12
12
  view_context.content_tag(:span, nil, class: 'glyphicon glyphicon-eye-close') +
13
13
  view_context.content_tag(:span, view_context.t('.unpublish', default: view_context.t('acts_as_published.actions.unpublish')), class: 'btn-text')
14
14
  end
15
15
  else
16
- view_context.link_to(link_path, class: 'btn btn-xs btn-success btn-responsive', method: :post) do
16
+ view_context.button_to(link_path, class: 'btn btn-xs btn-success btn-responsive', method: :post) do
17
17
  view_context.content_tag(:span, nil, class: 'glyphicon glyphicon-eye-open') +
18
18
  view_context.content_tag(:span, view_context.t('.publish', default: view_context.t('acts_as_published.actions.publish')), class: 'btn-text')
19
19
  end
@@ -1,5 +1,5 @@
1
1
  module Itsf
2
2
  module Backend
3
- VERSION = '3.1.0'
3
+ VERSION = '3.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itsf_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel