sibu 0.7.0 → 0.7.1

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: b9ddba74b9a3e07f92b235acc1e3e55296b4a089
4
- data.tar.gz: 3bf94af416c1228aa9f9f2f364ff1ebfafdba401
3
+ metadata.gz: 79b8c645e996992425e16b7924eb117876e1a384
4
+ data.tar.gz: 1559fee638b9202a90943d78e5d46f8f02863f45
5
5
  SHA512:
6
- metadata.gz: 9feac3ec7a28165c73edb37cd9c2c3dc47e2a81b8b7efbfab5253fc87e3fc12c3f44fa19f1ba0f653e2e93dc7ce7521ddce3b3153ae8091019809a958acfb9b6
7
- data.tar.gz: 24c55a51899aa8c68b7fda529dfa50b469a14a072df6a86329c8adfffd633bd83271fc407b9a7239c9639d76ca59dfba41b6cfaa81b26f7a810fa912b6911b20
6
+ metadata.gz: '008f5a4d18179071c4c88c88672c22fe8397e313cf6231df29b67ef879c82fedeaa7c43e78001521ad6b5f99dc7e48b89a27207779d301d79df7c597c032a4aa'
7
+ data.tar.gz: 4022d3df1a8cab73907f41f94d289c4e7fa0bed5b1d9ffe11343e06e0f612cb29b079fb30ed3ab2bd0ba912d1bbf453143e82be89a38b92d5aa2001a997bb69b
@@ -27,6 +27,7 @@ module Sibu
27
27
  @links = @site.pages_path_by_id
28
28
  view_template = 'show'
29
29
  else
30
+ @site = Sibu::Site.where(domain: request.host).first
30
31
  view_template = Rails.application.config.sibu[:not_found]
31
32
  return_code = :not_found
32
33
  end
@@ -17,7 +17,3 @@ module Sibu
17
17
  end
18
18
  end
19
19
  end
20
-
21
- # ['beds-green.svg', 'camp-white.svg', 'doc-green.svg', 'doc-white.svg', 'earth-white.svg', 'family-sec_blue.svg',
22
- # 'family-white.svg', 'flag.svg', 'hands-green.svg', 'home-green.svg', 'house-white.svg', 'marker.svg', 'men-green.svg',
23
- # 'money-blue.svg', 'money-green.svg', 'quotes.svg', 'tel-green.svg', 'tel-white.svg', 'tv-green.svg']
@@ -4,6 +4,7 @@ module Sibu
4
4
 
5
5
  belongs_to :site, :class_name => 'Sibu::Site'
6
6
 
7
+ store :custom_data, accessors: [:header_code, :footer_code], coder: JSON
7
8
  store :metadata, accessors: [:title, :description, :keywords], coder: JSON
8
9
 
9
10
  before_save :update_path
@@ -4,7 +4,8 @@ module Sibu
4
4
  include Sibu::SectionsConcern
5
5
  extend Sibu::UserConcern
6
6
 
7
- store :custom_data, accessors: [:primary_font, :secondary_font, :primary_color, :secondary_color], coder: JSON
7
+ store :custom_data, accessors: [:primary_font, :secondary_font, :primary_color, :secondary_color, :header_code, :footer_code],
8
+ coder: JSON
8
9
  store :metadata, accessors: [:analytics_id], coder: JSON
9
10
 
10
11
  belongs_to :site_template, :class_name => 'Sibu::SiteTemplate'
@@ -20,6 +20,12 @@
20
20
  <% end %>
21
21
  <% end %>
22
22
  <%= csrf_meta_tags %>
23
+ <% if @site && !@site.header_code.blank? %>
24
+ <%= raw @site.header_code %>
25
+ <% end %>
26
+ <% if @page && !@page.header_code.blank? %>
27
+ <%= raw @page.header_code %>
28
+ <% end %>
23
29
  <%= yield :included_styles %>
24
30
  <%= yield :included_scripts %>
25
31
  </head>
@@ -27,7 +33,13 @@
27
33
 
28
34
  <%= yield %>
29
35
 
30
- <%= yield :site_scripts %>
31
36
  <%= yield :page_scripts %>
37
+ <%= yield :site_scripts %>
38
+ <% if @page && !@page.footer_code.blank? %>
39
+ <%= raw @page.footer_code %>
40
+ <% end %>
41
+ <% if @site && !@site.footer_code.blank? %>
42
+ <%= raw @site.footer_code %>
43
+ <% end %>
32
44
  </body>
33
45
  </html>
@@ -34,6 +34,20 @@
34
34
  <small>Une liste de mots-clé décrivant le contenu de votre site (optionnelle)</small>
35
35
  </div>
36
36
  </div>
37
+ <div class="sibu_field">
38
+ <%= f.label :header_code, "Code d'entête personnalisé" %>
39
+ <div>
40
+ <%= f.text_area :header_code, placeholder: "Code JS ou CSS (avec les balises <script> ou <style>)", rows: 6 %>
41
+ <small>Ce code javascript ou CSS sera inséré dans l'entête du site pour cette page uniquement</small>
42
+ </div>
43
+ </div>
44
+ <div class="sibu_field">
45
+ <%= f.label :footer_code, 'Code de pied de page personnalisé' %>
46
+ <div>
47
+ <%= f.text_area :footer_code, placeholder: "Code JS ou CSS (avec les balises <script> ou <style>)", rows: 6 %>
48
+ <small>Ce code javascript ou CSS sera inséré juste avant la balide fermante &lt;/body&gt; pour cette page uniquement</small>
49
+ </div>
50
+ </div>
37
51
  <%= f.hidden_field :site_id %>
38
52
  <div class="sibu_actions">
39
53
  <%= f.submit 'Valider' %>
@@ -27,13 +27,6 @@
27
27
  <small>Langue du site</small>
28
28
  </div>
29
29
  </div>
30
- <div class="sibu_field">
31
- <%= f.label :analytics_id, "Statistiques d'audience" %>
32
- <div>
33
- <%= f.text_field :analytics_id, placeholder: "UA-XXXXXX" %>
34
- <small>Renseignez l'identifiant Google Analytics pour suivre les statistiques d'audience du site</small>
35
- </div>
36
- </div>
37
30
  <% if conf[:custom_styles] && @site.persisted? %>
38
31
  <div class="sibu_field sibu_colors">
39
32
  <%= f.label :primary_color, 'Couleur principale' %>
@@ -69,6 +62,27 @@
69
62
  <small>Police de caractère utilisée pour les corps de texte du modèle choisi</small>
70
63
  </div>
71
64
  </div>
65
+ <div class="sibu_field">
66
+ <%= f.label :analytics_id, "Statistiques d'audience" %>
67
+ <div>
68
+ <%= f.text_field :analytics_id, placeholder: "UA-XXXXXX" %>
69
+ <small>Renseignez l'identifiant Google Analytics pour suivre les statistiques d'audience du site</small>
70
+ </div>
71
+ </div>
72
+ <div class="sibu_field">
73
+ <%= f.label :header_code, "Code d'entête personnalisé" %>
74
+ <div>
75
+ <%= f.text_area :header_code, placeholder: "Code JS ou CSS (avec les balises <script> ou <style>)", rows: 6 %>
76
+ <small>Ce code javascript ou CSS sera inséré dans l'entête du site pour toutes les pages</small>
77
+ </div>
78
+ </div>
79
+ <div class="sibu_field">
80
+ <%= f.label :footer_code, 'Code de pied de page personnalisé' %>
81
+ <div>
82
+ <%= f.text_area :footer_code, placeholder: "Code JS ou CSS (avec les balises <script> ou <style>)", rows: 6 %>
83
+ <small>Ce code javascript ou CSS sera inséré juste avant la balide fermante &lt;/body&gt; pour toutes les pages</small>
84
+ </div>
85
+ </div>
72
86
  <% end %>
73
87
  <%= f.hidden_field :user_id %>
74
88
  <div class="sibu_actions">
@@ -0,0 +1,5 @@
1
+ class AddCustomDataToSibuPages < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :sibu_pages, :custom_data, :text
4
+ end
5
+ end
data/lib/sibu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
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.7.0
4
+ version: 0.7.1
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-12-05 00:00:00.000000000 Z
11
+ date: 2019-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -227,6 +227,7 @@ files:
227
227
  - db/migrate/20180321144021_move_images_to_user_level.rb
228
228
  - db/migrate/20180321170310_add_version_to_sibu_sites.rb
229
229
  - db/migrate/20180405095448_create_sibu_documents.rb
230
+ - db/migrate/20190110204854_add_custom_data_to_sibu_pages.rb
230
231
  - lib/sibu.rb
231
232
  - lib/sibu/engine.rb
232
233
  - lib/sibu/utils.rb