sibu 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/sibu/sibu.js.erb +17 -3
  3. data/app/assets/javascripts/tabs/van11y-accessible-tab-panel-aria.js +122 -124
  4. data/app/assets/javascripts/tarteaucitron/advertising.js +1 -0
  5. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.cs.js +75 -0
  6. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.de.js +75 -0
  7. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.el.js +75 -0
  8. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.en.js +75 -0
  9. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.es.js +75 -0
  10. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.fr.js +75 -0
  11. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.it.js +75 -0
  12. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.nl.js +75 -0
  13. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.pl.js +76 -0
  14. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.pt.js +73 -0
  15. data/app/assets/javascripts/tarteaucitron/lang/tarteaucitron.ru.js +75 -0
  16. data/app/assets/javascripts/tarteaucitron/tarteaucitron.js.erb +1480 -0
  17. data/app/assets/javascripts/tarteaucitron/tarteaucitron.services.js +2627 -0
  18. data/app/assets/stylesheets/sibu/defaults.scss +118 -61
  19. data/app/assets/stylesheets/sibu/sibu.css +8 -0
  20. data/app/assets/stylesheets/tarteaucitron/tarteaucitron.css +749 -0
  21. data/app/controllers/sibu/application_controller.rb +8 -0
  22. data/app/controllers/sibu/pages_controller.rb +4 -3
  23. data/app/controllers/sibu/sites_controller.rb +4 -0
  24. data/app/helpers/sibu/pages_helper.rb +89 -25
  25. data/app/models/sibu/page.rb +3 -3
  26. data/app/models/sibu/site.rb +15 -1
  27. data/app/models/sibu/site_template.rb +4 -1
  28. data/app/views/layouts/sibu/edit_content.html.erb +176 -119
  29. data/app/views/layouts/sibu/site.html.erb +42 -6
  30. data/app/views/sibu/images/edit.js.erb +5 -3
  31. data/app/views/sibu/pages/_code_edit_panel.html.erb +2 -2
  32. data/app/views/sibu/pages/_link_edit_panel.html.erb +6 -6
  33. data/app/views/sibu/pages/_map_edit_panel.html.erb +2 -2
  34. data/app/views/sibu/pages/_media_edit_panel.html.erb +6 -6
  35. data/app/views/sibu/pages/_new_section_panel.html.erb +1 -1
  36. data/app/views/sibu/pages/_paragraph_edit_panel.html.erb +2 -2
  37. data/app/views/sibu/pages/_text_edit_panel.html.erb +2 -2
  38. data/app/views/sibu/pages/child_element.js.erb +2 -2
  39. data/app/views/sibu/pages/clone_element.js.erb +2 -2
  40. data/app/views/sibu/pages/create_section.js.erb +1 -1
  41. data/app/views/sibu/pages/delete_element.js.erb +1 -1
  42. data/app/views/sibu/pages/delete_section.js.erb +1 -1
  43. data/app/views/sibu/pages/edit_element.js.erb +68 -66
  44. data/app/views/sibu/pages/edit_section.js.erb +6 -5
  45. data/app/views/sibu/pages/index.html.erb +1 -1
  46. data/app/views/sibu/pages/new_section.js.erb +22 -13
  47. data/app/views/sibu/pages/update_element.js.erb +2 -2
  48. data/app/views/sibu/pages/update_section.js.erb +3 -3
  49. data/config/initializers/assets.rb +1 -0
  50. data/config/initializers/constants.rb +5 -3
  51. data/config/routes.rb +3 -0
  52. data/db/migrate/20200401130601_add_ref_to_site_templates.rb +5 -0
  53. data/lib/sibu/engine.rb +0 -2
  54. data/lib/sibu/version.rb +1 -1
  55. metadata +19 -18
  56. data/app/views/sibu/pages/destroy.html.erb +0 -2
  57. data/app/views/sibu/pages/update.html.erb +0 -2
@@ -31,7 +31,7 @@
31
31
  <% end %>
32
32
  <% if @pages.empty? %>
33
33
  <tr>
34
- <td colspan="4">Aucune page créée pour le moment.</td>
34
+ <td colspan="5">Aucune page créée pour le moment.</td>
35
35
  </tr>
36
36
  <% end %>
37
37
  </tbody>
@@ -1,16 +1,25 @@
1
- var sectionsPanel = $("#sections_panel");
2
- if (sectionsPanel.size()) {
3
- sectionsPanel.html("<%= j(render 'new_section_panel') %>");
4
- van11yAccessibleTabPanelAria($(".sibu_sections_tabs")[0]);
5
- var sections = sectionsPanel.find(".sibu_sections [data-sb-template]");
6
- sections.click(function() {
7
- if(!$(this).hasClass('selected')) {
8
- sections.removeClass('selected');
9
- $(this).addClass('selected');
10
- $("#section_template").val($(this).data("sb-template"));
11
- $("#section_category").val($(this).data("sb-category"));
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
- $("#edit_panel #edit_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>");
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
- $("#edit_panel").slideUp();
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
- $("#edit_panel").slideUp();
3
- refreshAfterEdit(true, '<%= @section_id %>');
2
+ document.querySelector("#edit_panel").classList.remove("active");
3
+ refreshAfterEdit(true, '<%= @section_id %>');
4
4
  <% else %>
5
- $("#edit_panel #edit_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>");
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
- DEFAULT_TEXT = "Lorem ipsum"
2
- 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."
3
- DEFAULT_IMG = "/default.jpg"
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
@@ -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
 
@@ -0,0 +1,5 @@
1
+ class AddRefToSiteTemplates < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :sibu_site_templates, :ref, :string
4
+ end
5
+ end
@@ -1,5 +1,3 @@
1
- require 'jquery-rails'
2
-
3
1
  module Sibu
4
2
  class Engine < ::Rails::Engine
5
3
  isolate_namespace Sibu
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.9.0'
2
+ VERSION = '1.0.0'
3
3
  end
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.9.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: 2019-08-28 00:00:00.000000000 Z
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
@@ -1,2 +0,0 @@
1
- <h1>Pages#destroy</h1>
2
- <p>Find me in app/views/sibu/pages/destroy.html.erb</p>
@@ -1,2 +0,0 @@
1
- <h1>Pages#update</h1>
2
- <p>Find me in app/views/sibu/pages/update.html.erb</p>