sibu 0.3.6 → 0.3.7
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: 8f0fc7bd3a2d8875fbef8b262138177995ddaf60
|
4
|
+
data.tar.gz: a7e217c76b663623b83544e2d795b5de6d6c608d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 651272394d1ea49918f25186a0bcc59eb5aa1bb2b73f7acd6108fa306a065e59dad20ce4c9c66993d4b6f14143119c7a4c3817ebd392f88cb44e4d92f66b0ba4
|
7
|
+
data.tar.gz: f2b7299c8b124e0ca763c873f8f9f81a1fd8009d16564a4b31e57bbffa64be4550cadd2889334063c77e6eebac448f48027e71e34b5336f353dc649a7a9427b6
|
@@ -96,6 +96,13 @@ module Sibu
|
|
96
96
|
content_tag(:div, capture(widget_type.new(content), &block), opts)
|
97
97
|
end
|
98
98
|
|
99
|
+
def embed(elt, opts = {})
|
100
|
+
defaults = {"id" => elt.is_a?(Hash) ? elt["id"] : elt, "code" => '<p>Contenu HTML personnalisé (iframe, etc...)</p>'}
|
101
|
+
content = defaults.merge(elt.is_a?(Hash) ? elt : (select_element(elt) || {}))
|
102
|
+
opts.merge!({data: {id: elt_id(elt), type: "embed"}}) if action_name != 'show'
|
103
|
+
content_tag(:div, content_tag(:p, raw(content["code"]).html_safe), opts)
|
104
|
+
end
|
105
|
+
|
99
106
|
# Note : see ActionView::OutputBuffer
|
100
107
|
def sb_page
|
101
108
|
@sb_entity = @page
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<h2>Modifier le contenu</h2>
|
2
|
+
<div id="edit_msg"></div>
|
3
|
+
<div class="sibu_edit_form">
|
4
|
+
<%= form_tag(update_element_site_page_path(@site.id, @page.id), method: :patch, remote: true) do |f| %>
|
5
|
+
<div class="sibu_field">
|
6
|
+
<%= label_tag 'element[code]', "Code d'intégration du contenu" %>
|
7
|
+
<%= text_area_tag 'element[code]', @element["code"], placeholder: ' ex: <iframe src="..."></iframe>' %>
|
8
|
+
</div>
|
9
|
+
<%= hidden_field_tag 'element[id]', @element["id"] %>
|
10
|
+
<%= hidden_field_tag :element_id, @element_id %>
|
11
|
+
<%= hidden_field_tag :section_id, @section_id %>
|
12
|
+
<%= hidden_field_tag :entity, @entity_type %>
|
13
|
+
<div class="sibu_actions">
|
14
|
+
<%= submit_tag 'Valider' %>
|
15
|
+
<%= link_to 'Annuler', '#', onclick: 'cancelEdit(); return false;' %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
@@ -3,6 +3,8 @@ editPanel.html("");
|
|
3
3
|
<% case @content_type %>
|
4
4
|
<% when 'text' %>
|
5
5
|
editPanel.html("<%= j(render 'text_edit_panel') %>");
|
6
|
+
<% when 'embed' %>
|
7
|
+
editPanel.html("<%= j(render 'code_edit_panel') %>");
|
6
8
|
<% when 'paragraph' %>
|
7
9
|
editPanel.html("<%= j(render 'paragraph_edit_panel') %>");
|
8
10
|
<% when 'media' %>
|
@@ -8,6 +8,8 @@
|
|
8
8
|
var updatedElt = $("[data-sb-id='<%= @section_id %>']").find("[data-id='<%= @element_id %>']");
|
9
9
|
<% if @updated["text"] %>
|
10
10
|
updatedElt.html("<%= j(raw @updated["text"]) %>");
|
11
|
+
<% elsif @updated["code"] %>
|
12
|
+
updatedElt.html("<%= j(raw @updated["code"]) %>");
|
11
13
|
<% end %>
|
12
14
|
<% unless @updated.except("id", "text", "value").blank? %>
|
13
15
|
var tag = updatedElt.prop("tagName").toLowerCase();
|
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: 0.3.
|
4
|
+
version: 0.3.7
|
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: 2018-
|
11
|
+
date: 2018-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -169,6 +169,7 @@ files:
|
|
169
169
|
- app/views/sibu/images/index.html.erb
|
170
170
|
- app/views/sibu/images/new.html.erb
|
171
171
|
- app/views/sibu/images/show.html.erb
|
172
|
+
- app/views/sibu/pages/_code_edit_panel.html.erb
|
172
173
|
- app/views/sibu/pages/_element_actions.html.erb
|
173
174
|
- app/views/sibu/pages/_error_panel.html.erb
|
174
175
|
- app/views/sibu/pages/_form.html.erb
|