itsf_backend 3.1.0 → 3.1.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f1b86c4aa65634b90349e3fbc673e04a9b816ec
|
4
|
+
data.tar.gz: 2b08e227d30f8f6f2a849c4a40e198aaef55576a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.
|
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.
|
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
|
data/lib/itsf/backend/version.rb
CHANGED