sibu 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/sibu/sibu.js.erb +17 -3
- data/app/assets/javascripts/tabs/van11y-accessible-tab-panel-aria.js +122 -124
- data/app/assets/javascripts/tarteaucitron/advertising.js +1 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.cs.js +75 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.de.js +75 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.el.js +75 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.en.js +75 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.es.js +75 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.fr.js +75 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.it.js +75 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.nl.js +75 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.pl.js +76 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.pt.js +73 -0
- data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.ru.js +75 -0
- data/app/assets/javascripts/tarteaucitron/tarteaucitron.js.erb +1480 -0
- data/app/assets/javascripts/tarteaucitron/tarteaucitron.services.js +2627 -0
- data/app/assets/stylesheets/sibu/defaults.scss +118 -61
- data/app/assets/stylesheets/sibu/sibu.css +8 -0
- data/app/assets/stylesheets/tarteaucitron/tarteaucitron.css +749 -0
- data/app/controllers/sibu/application_controller.rb +8 -0
- data/app/controllers/sibu/pages_controller.rb +4 -3
- data/app/controllers/sibu/sites_controller.rb +4 -0
- data/app/helpers/sibu/pages_helper.rb +89 -25
- data/app/models/sibu/page.rb +3 -3
- data/app/models/sibu/site.rb +15 -1
- data/app/models/sibu/site_template.rb +4 -1
- data/app/views/layouts/sibu/edit_content.html.erb +176 -119
- data/app/views/layouts/sibu/site.html.erb +42 -6
- data/app/views/sibu/images/edit.js.erb +5 -3
- data/app/views/sibu/pages/_code_edit_panel.html.erb +2 -2
- data/app/views/sibu/pages/_link_edit_panel.html.erb +6 -6
- data/app/views/sibu/pages/_map_edit_panel.html.erb +2 -2
- data/app/views/sibu/pages/_media_edit_panel.html.erb +6 -6
- data/app/views/sibu/pages/_new_section_panel.html.erb +1 -1
- data/app/views/sibu/pages/_paragraph_edit_panel.html.erb +2 -2
- data/app/views/sibu/pages/_text_edit_panel.html.erb +2 -2
- data/app/views/sibu/pages/child_element.js.erb +2 -2
- data/app/views/sibu/pages/clone_element.js.erb +2 -2
- data/app/views/sibu/pages/create_section.js.erb +1 -1
- data/app/views/sibu/pages/delete_element.js.erb +1 -1
- data/app/views/sibu/pages/delete_section.js.erb +1 -1
- data/app/views/sibu/pages/edit_element.js.erb +68 -66
- data/app/views/sibu/pages/edit_section.js.erb +6 -5
- data/app/views/sibu/pages/index.html.erb +1 -1
- data/app/views/sibu/pages/new_section.js.erb +22 -13
- data/app/views/sibu/pages/update_element.js.erb +2 -2
- data/app/views/sibu/pages/update_section.js.erb +3 -3
- data/config/initializers/assets.rb +1 -0
- data/config/initializers/constants.rb +5 -3
- data/config/routes.rb +3 -0
- data/db/migrate/20200401130601_add_ref_to_site_templates.rb +5 -0
- data/lib/sibu/engine.rb +0 -2
- data/lib/sibu/version.rb +1 -1
- metadata +19 -18
- data/app/views/sibu/pages/destroy.html.erb +0 -2
- data/app/views/sibu/pages/update.html.erb +0 -2
@@ -1,16 +1,25 @@
|
|
1
|
-
var sectionsPanel =
|
2
|
-
if (sectionsPanel
|
3
|
-
sectionsPanel.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
1
|
+
var sectionsPanel = document.querySelector("#sections_panel");
|
2
|
+
if (sectionsPanel) {
|
3
|
+
sectionsPanel.innerHTML = "<%= j(render 'new_section_panel') %>";
|
4
|
+
try {
|
5
|
+
sibuVan11yAccessibleTabPanelAria(document.querySelector(".sibu_sections_tabs"));
|
6
|
+
} catch (e) {
|
7
|
+
console.log('Sibu sections - Tabs init error : ' + e);
|
8
|
+
}
|
9
|
+
var sections = sectionsPanel.querySelectorAll(".sibu_sections [data-sb-template]");
|
10
|
+
for (var i = 0; i < sections.length; i++) {
|
11
|
+
sections[i].addEventListener("click", function(evt) {
|
12
|
+
if(!evt.currentTarget.classList.contains('selected')) {
|
13
|
+
var selected = sectionsPanel.querySelector(".sibu_sections [data-sb-template].selected");
|
14
|
+
if (selected) {
|
15
|
+
selected.classList.remove('selected');
|
16
|
+
}
|
17
|
+
evt.currentTarget.classList.add('selected');
|
18
|
+
document.querySelector("#section_template").value = evt.currentTarget.getAttribute('data-sb-template');
|
19
|
+
document.querySelector("#section_category").value = evt.currentTarget.getAttribute('data-sb-category');
|
20
|
+
}
|
21
|
+
});
|
22
|
+
}
|
14
23
|
if(typeof initSectionsForm === "function") {
|
15
24
|
initSectionsForm();
|
16
25
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% if @updated.nil? %>
|
2
|
-
|
2
|
+
document.querySelector("#edit_panel #edit_msg").innerHTML = "<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>";
|
3
3
|
<% else %>
|
4
|
-
|
4
|
+
document.querySelector("#edit_panel").classList.remove("active");
|
5
5
|
refreshAfterEdit(true, '<%= @section_id %>');
|
6
6
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% if @updated %>
|
2
|
-
|
3
|
-
refreshAfterEdit(true, '<%= @section_id %>');
|
2
|
+
document.querySelector("#edit_panel").classList.remove("active");
|
3
|
+
refreshAfterEdit(true, '<%= @section_id %>');
|
4
4
|
<% else %>
|
5
|
-
|
5
|
+
document.querySelector("#edit_panel #edit_msg").innerHTML = "<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>";
|
6
6
|
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.precompile += %w( tarteaucitron/tarteaucitron.css tarteaucitron/tarteaucitron.js )
|
@@ -1,3 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Sibu
|
2
|
+
DEFAULT_TEXT = "Lorem ipsum"
|
3
|
+
DEFAULT_PARAGRAPH = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut."
|
4
|
+
DEFAULT_IMG = "/default.jpg"
|
5
|
+
end
|
data/config/routes.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
Sibu::Engine.routes.draw do
|
2
2
|
|
3
|
+
scope format: true, constraints: { format: /jpg|png|gif|svg/ } do
|
4
|
+
get '/*missed', to: proc { [404, {}, ['']] }
|
5
|
+
end
|
3
6
|
get '/', to: 'pages#show', constraints: lambda {|req| req.host != Rails.application.config.sibu[:host]}
|
4
7
|
get '*path', to: 'pages#show', constraints: lambda {|req| req.host != Rails.application.config.sibu[:host]}
|
5
8
|
|
data/lib/sibu/engine.rb
CHANGED
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.
|
4
|
+
version: 1.0.0
|
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:
|
11
|
+
date: 2020-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '4.3'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: jquery-rails
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '4.3'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '4.3'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: sass-rails
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,11 +116,26 @@ files:
|
|
130
116
|
- app/assets/javascripts/sibu/common.js
|
131
117
|
- app/assets/javascripts/sibu/sibu.js.erb
|
132
118
|
- app/assets/javascripts/tabs/van11y-accessible-tab-panel-aria.js
|
119
|
+
- app/assets/javascripts/tarteaucitron/advertising.js
|
120
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.cs.js
|
121
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.de.js
|
122
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.el.js
|
123
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.en.js
|
124
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.es.js
|
125
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.fr.js
|
126
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.it.js
|
127
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.nl.js
|
128
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.pl.js
|
129
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.pt.js
|
130
|
+
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.ru.js
|
131
|
+
- app/assets/javascripts/tarteaucitron/tarteaucitron.js.erb
|
132
|
+
- app/assets/javascripts/tarteaucitron/tarteaucitron.services.js
|
133
133
|
- app/assets/stylesheets/cropper/cropper.css
|
134
134
|
- app/assets/stylesheets/quill/quill.snow.css
|
135
135
|
- app/assets/stylesheets/sibu/defaults.scss
|
136
136
|
- app/assets/stylesheets/sibu/icons.scss
|
137
137
|
- app/assets/stylesheets/sibu/sibu.css
|
138
|
+
- app/assets/stylesheets/tarteaucitron/tarteaucitron.css
|
138
139
|
- app/controllers/sibu/application_controller.rb
|
139
140
|
- app/controllers/sibu/documents_controller.rb
|
140
141
|
- app/controllers/sibu/images_controller.rb
|
@@ -187,7 +188,6 @@ files:
|
|
187
188
|
- app/views/sibu/pages/create_section.js.erb
|
188
189
|
- app/views/sibu/pages/delete_element.js.erb
|
189
190
|
- app/views/sibu/pages/delete_section.js.erb
|
190
|
-
- app/views/sibu/pages/destroy.html.erb
|
191
191
|
- app/views/sibu/pages/edit.html.erb
|
192
192
|
- app/views/sibu/pages/edit_content.html.erb
|
193
193
|
- app/views/sibu/pages/edit_element.js.erb
|
@@ -196,7 +196,6 @@ files:
|
|
196
196
|
- app/views/sibu/pages/new.html.erb
|
197
197
|
- app/views/sibu/pages/new_section.js.erb
|
198
198
|
- app/views/sibu/pages/show.html.erb
|
199
|
-
- app/views/sibu/pages/update.html.erb
|
200
199
|
- app/views/sibu/pages/update_element.js.erb
|
201
200
|
- app/views/sibu/pages/update_section.js.erb
|
202
201
|
- app/views/sibu/sites/_form.html.erb
|
@@ -207,6 +206,7 @@ files:
|
|
207
206
|
- app/views/sibu/sites/new.html.erb
|
208
207
|
- app/views/sibu/sites/show.html.erb
|
209
208
|
- app/views/sibu/sites/update.html.erb
|
209
|
+
- config/initializers/assets.rb
|
210
210
|
- config/initializers/constants.rb
|
211
211
|
- config/initializers/shrine.rb
|
212
212
|
- config/routes.rb
|
@@ -229,6 +229,7 @@ files:
|
|
229
229
|
- db/migrate/20180321170310_add_version_to_sibu_sites.rb
|
230
230
|
- db/migrate/20180405095448_create_sibu_documents.rb
|
231
231
|
- db/migrate/20190110204854_add_custom_data_to_sibu_pages.rb
|
232
|
+
- db/migrate/20200401130601_add_ref_to_site_templates.rb
|
232
233
|
- lib/sibu.rb
|
233
234
|
- lib/sibu/engine.rb
|
234
235
|
- lib/sibu/utils.rb
|