sibu 0.7.1 → 0.7.2

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: 79b8c645e996992425e16b7924eb117876e1a384
4
- data.tar.gz: 1559fee638b9202a90943d78e5d46f8f02863f45
3
+ metadata.gz: f0f214aadf5875dec224d1cc6c1e10c12e60a116
4
+ data.tar.gz: b15f79841ef717bd4525d078dfa7ec6627cb5a3e
5
5
  SHA512:
6
- metadata.gz: '008f5a4d18179071c4c88c88672c22fe8397e313cf6231df29b67ef879c82fedeaa7c43e78001521ad6b5f99dc7e48b89a27207779d301d79df7c597c032a4aa'
7
- data.tar.gz: 4022d3df1a8cab73907f41f94d289c4e7fa0bed5b1d9ffe11343e06e0f612cb29b079fb30ed3ab2bd0ba912d1bbf453143e82be89a38b92d5aa2001a997bb69b
6
+ metadata.gz: 88be30374322ebae3217fb6768d18b1a8a58dc9fb93f2a6c688f909fe78b4fe4af2cb9e2a3b0e3c4f9b637caa25177cd78ba8abdee58aa071809623837a6ca04
7
+ data.tar.gz: 8436ac5241e41c4d3efe22dddf290846bff382d899a6013f9a510ab6701781678b2aae1958847e61af1e8e2105e3de1313502a1321d92d81600d8f0e9ff22917
@@ -36,6 +36,7 @@ module Sibu
36
36
  @page = Sibu::Page.find(params[:id])
37
37
  @links = @site.pages_path_by_id
38
38
  @query_path = params[:path]
39
+ @query_params = show_params.except(:controller, :action, :path).to_h
39
40
  view_template = 'show'
40
41
  end
41
42
 
@@ -5,7 +5,7 @@ module Sibu
5
5
  belongs_to :site, :class_name => 'Sibu::Site'
6
6
 
7
7
  store :custom_data, accessors: [:header_code, :footer_code], coder: JSON
8
- store :metadata, accessors: [:title, :description, :keywords], coder: JSON
8
+ store :metadata, accessors: [:title, :description, :keywords, :source, :external_id, :is_home], coder: JSON
9
9
 
10
10
  before_save :update_path
11
11
  validates_presence_of :name, :site
@@ -30,10 +30,13 @@ module Sibu
30
30
  save
31
31
  end
32
32
 
33
- # Todo : fix me (is_home flag ?)
34
33
  def update_path
35
34
  prefix = site.version == Sibu::Site::DEFAULT_VERSION ? '' : "#{site.version}/"
36
- self.path = "#{prefix}#{name != 'Accueil' ? name.parameterize : ''}" if self.path.blank?
35
+ if is_home == 'true'
36
+ self.path = ''
37
+ else
38
+ self.path = "#{prefix}#{name.parameterize}" if self.path.blank?
39
+ end
37
40
  end
38
41
 
39
42
  def site_template
@@ -13,6 +13,13 @@
13
13
  <small>L'adresse (ou URL) de la page, utilisée par les navigateurs web pour y accéder</small>
14
14
  </div>
15
15
  </div>
16
+ <div class="sibu_field">
17
+ <%= f.label :is_home, "Page d'accueil" %>
18
+ <div>
19
+ <%= f.check_box :is_home, {}, 'true', 'false' %><span>Cocher pour faire de cette page la page d'accueil.</span>
20
+ <small>Le chemin d'accès de la page d'accueil sera automatiquement mis à jour.</small>
21
+ </div>
22
+ </div>
16
23
  <div class="sibu_field">
17
24
  <%= f.label :title, 'Titre' %>
18
25
  <div>
@@ -8,6 +8,7 @@
8
8
  <tr>
9
9
  <th>Nom</th>
10
10
  <th>Chemin d'accès</th>
11
+ <th>Origine</th>
11
12
  <th>Mise à jour</th>
12
13
  <th></th>
13
14
  </tr>
@@ -17,6 +18,7 @@
17
18
  <tr>
18
19
  <td><%= p.name %></td>
19
20
  <td><%= p.path %></td>
21
+ <td><%= (p.source || '') + (p.external_id.blank? ? '' : " (#{p.external_id})") %></td>
20
22
  <td><%= l p.updated_at %></td>
21
23
  <td>
22
24
  <%= link_to 'Voir', site_page_path(@site.id, p), target: '_blank' %> |
@@ -28,40 +28,41 @@
28
28
  </div>
29
29
  </div>
30
30
  <% if conf[:custom_styles] && @site.persisted? %>
31
- <div class="sibu_field sibu_colors">
32
- <%= f.label :primary_color, 'Couleur principale' %>
33
- <div>
34
- <% primary_colors.each do |c| %>
35
- <span class="sibu_color <%= 'selected' if f.object.primary_color == c %>" data-color="<%= c %>" style="background-color: <%= c %>;"></span>
36
- <% end %>
37
- <small>Couleur principale appliquée au modèle choisi</small>
31
+ <div class="sibu_field sibu_colors">
32
+ <%= f.label :primary_color, 'Couleur principale' %>
33
+ <div>
34
+ <% primary_colors.each do |c| %>
35
+ <span class="sibu_color <%= 'selected' if f.object.primary_color == c %>" data-color="<%= c %>" style="background-color: <%= c %>;"></span>
36
+ <% end %>
37
+ <small>Couleur principale appliquée au modèle choisi</small>
38
+ </div>
39
+ <%= f.hidden_field :primary_color %>
38
40
  </div>
39
- <%= f.hidden_field :primary_color %>
40
- </div>
41
- <div class="sibu_field sibu_colors">
42
- <%= f.label :secondary_color, 'Couleur secondaire' %>
43
- <div>
44
- <% secondary_colors.each do |c| %>
45
- <span class="sibu_color <%= 'selected' if f.object.secondary_color == c %>" data-color="<%= c %>" style="background-color: <%= c %>;"></span>
46
- <% end %>
47
- <small>Couleur secondaire appliquée au modèle choisi</small>
41
+ <div class="sibu_field sibu_colors">
42
+ <%= f.label :secondary_color, 'Couleur secondaire' %>
43
+ <div>
44
+ <% secondary_colors.each do |c| %>
45
+ <span class="sibu_color <%= 'selected' if f.object.secondary_color == c %>" data-color="<%= c %>" style="background-color: <%= c %>;"></span>
46
+ <% end %>
47
+ <small>Couleur secondaire appliquée au modèle choisi</small>
48
+ </div>
49
+ <%= f.hidden_field :secondary_color %>
48
50
  </div>
49
- <%= f.hidden_field :secondary_color %>
50
- </div>
51
- <div class="sibu_field sibu_fonts">
52
- <%= f.label :name, 'Police de caractères (titres)' %>
53
- <div>
54
- <%= f.select :primary_font, primary_fonts %>
55
- <small>Police de caractère utilisée pour les titres du modèle choisi</small>
51
+ <div class="sibu_field sibu_fonts">
52
+ <%= f.label :name, 'Police de caractères (titres)' %>
53
+ <div>
54
+ <%= f.select :primary_font, primary_fonts %>
55
+ <small>Police de caractère utilisée pour les titres du modèle choisi</small>
56
+ </div>
56
57
  </div>
57
- </div>
58
- <div class="sibu_field sibu_fonts">
59
- <%= f.label :name, 'Police de caractères (corps)' %>
60
- <div>
61
- <%= f.select :secondary_font, secondary_fonts %>
62
- <small>Police de caractère utilisée pour les corps de texte du modèle choisi</small>
58
+ <div class="sibu_field sibu_fonts">
59
+ <%= f.label :name, 'Police de caractères (corps)' %>
60
+ <div>
61
+ <%= f.select :secondary_font, secondary_fonts %>
62
+ <small>Police de caractère utilisée pour les corps de texte du modèle choisi</small>
63
+ </div>
63
64
  </div>
64
- </div>
65
+ <% end %>
65
66
  <div class="sibu_field">
66
67
  <%= f.label :analytics_id, "Statistiques d'audience" %>
67
68
  <div>
@@ -83,7 +84,6 @@
83
84
  <small>Ce code javascript ou CSS sera inséré juste avant la balide fermante &lt;/body&gt; pour toutes les pages</small>
84
85
  </div>
85
86
  </div>
86
- <% end %>
87
87
  <%= f.hidden_field :user_id %>
88
88
  <div class="sibu_actions">
89
89
  <%= f.submit 'Valider', data: {disable_with: 'Enregistrement en cours...'} %>
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
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.1
4
+ version: 0.7.2
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-01-10 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails