sibu 1.0.17 → 1.0.18
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e913afa40651591876a68f2f23dade0fb309c410
|
|
4
|
+
data.tar.gz: bca620a625fdbc2cfd19a536e387f1841587af4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 492a6fda285b61ed431cbb30c8f61ec9b55e98bb15d69f5671b5c9520bf260caec02b44834a15323650111075d96b0826e76e76ce3df0f18e281ab3f379c212f
|
|
7
|
+
data.tar.gz: 859ccb722dd7fe498ec580bdd3ccb76a7a22c0831865c25299fe3c6af04f8658aa29670b3e839e2c0a9151061dd26ca3e8d4fb5ef911b52c2e59873cf30854d8
|
|
@@ -20,11 +20,15 @@ module Sibu
|
|
|
20
20
|
p = Sibu::Page.find(@page_id)
|
|
21
21
|
entity = @entity_type == 'site' ? p.site : p
|
|
22
22
|
ids = (@section_id.split('|') + @element_id.split('|')).uniq[0...-1]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
if entity.has_section?(ids.first)
|
|
24
|
+
elt = entity.update_element(*ids, {"id" => @img_id, "src" => @image.file_url(@size.to_sym), "alt" => @image.alt})
|
|
25
|
+
if elt.nil?
|
|
26
|
+
msg = {alert: "Une erreur s'est produite lors de la mise à jour de l'image."}
|
|
27
|
+
else
|
|
28
|
+
msg = {notice: "L'image a bien été mise à jour."}
|
|
29
|
+
end
|
|
26
30
|
else
|
|
27
|
-
msg = {
|
|
31
|
+
msg = {alert: "L'image n'a pas pu être ajoutée à la section."}
|
|
28
32
|
end
|
|
29
33
|
redirect_to site_page_edit_content_path(p.site_id, @page_id), msg
|
|
30
34
|
else
|
|
@@ -11,6 +11,8 @@ module Sibu
|
|
|
11
11
|
:child_element, :new_section, :create_section, :edit_section,
|
|
12
12
|
:update_section, :delete_section]
|
|
13
13
|
before_action :set_online, only: [:show, :edit]
|
|
14
|
+
before_action :check_section, only: [:edit_element, :update_element, :clone_element, :delete_element,
|
|
15
|
+
:child_element, :edit_section, :update_section, :delete_section]
|
|
14
16
|
|
|
15
17
|
skip_before_action Rails.application.config.sibu[:auth_filter], only: [:show]
|
|
16
18
|
|
|
@@ -197,6 +199,13 @@ module Sibu
|
|
|
197
199
|
params.permit!
|
|
198
200
|
end
|
|
199
201
|
|
|
202
|
+
def check_section
|
|
203
|
+
section_id = params[:section_id]
|
|
204
|
+
unless @entity && @entity.has_section?(section_id)
|
|
205
|
+
redirect_to main_app.root_url, alert: "L'opération n'a pas pu aboutir."
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
200
209
|
def compile_assets
|
|
201
210
|
Sibu::DynamicStyle.new(params[:site_id]).compile if Rails.env.development? && conf[:custom_styles] && !params[:site_id].blank?
|
|
202
211
|
end
|
data/lib/sibu/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sibu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jean-Baptiste Vilain
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-06-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|