sibu 0.1.24 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/sibu/sibu.css +5 -1
- data/app/controllers/sibu/pages_controller.rb +2 -2
- data/app/helpers/sibu/pages_helper.rb +2 -2
- data/app/views/layouts/sibu/edit_content.html.erb +2 -0
- data/app/views/sibu/pages/_map_edit_panel.html.erb +27 -0
- data/app/views/sibu/pages/edit_element.js.erb +2 -0
- data/app/views/sibu/pages/update_element.js.erb +3 -0
- data/lib/sibu/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 916acca3e25a345d957ff420f7fa164992dedeb0
|
4
|
+
data.tar.gz: 8c5332f2f016ad73c8f864c8b9ae4804bf1e7c13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aad71cc6b158cf274e9058530b7f01db7ee842bbf172cf6847ae4279e0de1a09253417597120bd3a1ecba9652897e44b4656df7223498bed869ee4ae5e6feb69
|
7
|
+
data.tar.gz: 69febad581a88ab80a797d5cf9f1d6ff2b7ab0925fb9a3ef31ade3b88c57a53f4ea0df9144bbb20ef3cd4d251a35a7ef984fbe07eb32874a28043ecf7a1198b9
|
@@ -9,10 +9,14 @@
|
|
9
9
|
|
10
10
|
.sb-editable {
|
11
11
|
cursor: pointer;
|
12
|
-
outline: dashed rgba(94, 219, 255, 0.8)
|
12
|
+
outline: dashed rgba(94, 219, 255, 0.8) 3px;
|
13
13
|
outline-offset: -3px;
|
14
14
|
}
|
15
15
|
|
16
|
+
.sb-editable[data-type='map'] {
|
17
|
+
border: dashed rgba(94, 219, 255, 0.8) 3px;
|
18
|
+
}
|
19
|
+
|
16
20
|
#edit_mode_overlay {
|
17
21
|
display: none;
|
18
22
|
}
|
@@ -81,6 +81,7 @@ module Sibu
|
|
81
81
|
def update_element
|
82
82
|
ids = (@section_id.split('|') + @element_id.split('|')).uniq[0...-1]
|
83
83
|
@updated = @entity.update_element(*ids, element_params)
|
84
|
+
@refresh = params[:refresh]
|
84
85
|
end
|
85
86
|
|
86
87
|
def clone_element
|
@@ -95,13 +96,12 @@ module Sibu
|
|
95
96
|
@added = @entity.child_element(*@section_id.split('|'), *@element_id.split('|'))
|
96
97
|
end
|
97
98
|
|
98
|
-
# Todo - init available sections properly and fix dynamic sections creation (init needed)
|
99
99
|
def new_section
|
100
100
|
@after = params[:after]
|
101
101
|
@links = @site.pages_path_by_id
|
102
102
|
@page.sections << {"id" => "sibu_template_free_text", "elements" => [{"id" => "paragraph0"}]}
|
103
103
|
@page.sections << {"id" => "sibu_template_gallery",
|
104
|
-
"elements" => [{"id" => "slide0"
|
104
|
+
"elements" => [{"id" => "slide0"}, {"id" => "slide1"}, {"id" => "slide2"}]}
|
105
105
|
@page.sections << {"id" => "sibu_template_table", "elements" => [
|
106
106
|
{"id" => "col0", "elements" => [{"id" => "row1"}, {"id" => "row2"}]},
|
107
107
|
{"id" => "col1", "elements" => [{"id" => "row1"}, {"id" => "row2"}]},
|
@@ -143,9 +143,9 @@ module Sibu
|
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
|
-
def interactive_map(elt, html_opts = {}
|
146
|
+
def interactive_map(elt, html_opts = {})
|
147
147
|
defaults = {"data-lat" => "45.68854", "data-lng" => "5.91587", "data-title" => DEFAULT_TEXT}
|
148
|
-
content = elt.is_a?(Hash) ?
|
148
|
+
content = defaults.merge(elt.is_a?(Hash) ? elt : (select_element(elt) || {"id" => elt}))
|
149
149
|
html_opts.merge!({data: {id: elt_id(elt), type: "map"}}) if action_name != 'show'
|
150
150
|
content_tag(:div, nil, content.merge(html_opts))
|
151
151
|
end
|
@@ -157,11 +157,13 @@
|
|
157
157
|
|
158
158
|
function cancelEdit() {
|
159
159
|
$("#edit_panel").slideUp("fast");
|
160
|
+
$("#edit_panel").html("");
|
160
161
|
document.body.style.overflow = "initial";
|
161
162
|
}
|
162
163
|
|
163
164
|
function cancelSectionsEdit() {
|
164
165
|
$("#sections_panel").slideUp("fast");
|
166
|
+
$("#sections_panel").html("");
|
165
167
|
document.body.style.overflow = "initial";
|
166
168
|
}
|
167
169
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h2>Modifier la carte</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[data-lat]', 'Latitude' %>
|
7
|
+
<%= text_field_tag 'element[data-lat]', @element["data-lat"] %>
|
8
|
+
</div>
|
9
|
+
<div class="sibu_field">
|
10
|
+
<%= label_tag 'element[data-lng]', 'Longitude' %>
|
11
|
+
<%= text_field_tag 'element[data-lng]', @element["data-lng"] %>
|
12
|
+
</div>
|
13
|
+
<div class="sibu_field">
|
14
|
+
<%= label_tag 'element[data-title]', 'Libellé' %>
|
15
|
+
<%= text_field_tag 'element[data-title]', @element["data-title"] %>
|
16
|
+
</div>
|
17
|
+
<%= hidden_field_tag 'element[id]', @element["id"] %>
|
18
|
+
<%= hidden_field_tag :element_id, @element_id %>
|
19
|
+
<%= hidden_field_tag :section_id, @section_id %>
|
20
|
+
<%= hidden_field_tag :entity, @entity_type %>
|
21
|
+
<%= hidden_field_tag :refresh, true %>
|
22
|
+
<div class="sibu_actions">
|
23
|
+
<%= submit_tag 'Valider' %>
|
24
|
+
<%= link_to 'Annuler', '#', onclick: 'cancelEdit(); return false;' %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
@@ -37,6 +37,8 @@ editPanel.html("");
|
|
37
37
|
});
|
38
38
|
<% when 'group' %>
|
39
39
|
editPanel.html("<%= j(render 'group_edit_panel') %>");
|
40
|
+
<% when 'map' %>
|
41
|
+
editPanel.html("<%= j(render 'map_edit_panel') %>");
|
40
42
|
<% else %>
|
41
43
|
editPanel.html("<%= j(render 'error_panel') %>");
|
42
44
|
<% end %>
|
@@ -1,5 +1,8 @@
|
|
1
1
|
<% if @updated.nil? %>
|
2
2
|
$("#edit_panel #edit_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>");
|
3
|
+
<% elsif @refresh %>
|
4
|
+
$("#edit_panel").slideUp();
|
5
|
+
location.reload(true);
|
3
6
|
<% else %>
|
4
7
|
$("#edit_panel").slideUp();
|
5
8
|
var updatedElt = $("[data-sb-id='<%= @section_id %>']").find("[data-id='<%= @element_id %>']");
|
data/lib/sibu/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sibu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Baptiste Vilain
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- app/views/sibu/pages/_form.html.erb
|
142
142
|
- app/views/sibu/pages/_group_edit_panel.html.erb
|
143
143
|
- app/views/sibu/pages/_link_edit_panel.html.erb
|
144
|
+
- app/views/sibu/pages/_map_edit_panel.html.erb
|
144
145
|
- app/views/sibu/pages/_media_edit_panel.html.erb
|
145
146
|
- app/views/sibu/pages/_new_section_panel.html.erb
|
146
147
|
- app/views/sibu/pages/_paragraph_edit_panel.html.erb
|