sibu 0.2.1 → 0.2.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: b7888abe9ddb32391de3695fe43f06a5e4d6cb95
4
- data.tar.gz: e14e12d53f591b8c2ca71599de672d56e8422d92
3
+ metadata.gz: 934b9f613b81fb385ed73df2a1dfb63ce04b94da
4
+ data.tar.gz: a53c1e98face2342fadcd839c082b98695e49342
5
5
  SHA512:
6
- metadata.gz: 5a06716af55ec6f6c0a12dcc4686bc7e549d0d13d02652c5b9b53f8626cfb054e22001629fe089f3dd382d3cc67c96eac03e330759584239ca64833103862408
7
- data.tar.gz: 6e0de7ab878681deaa8f35e3bcc5649511a52f986ea6787bf7b4e1ace4d4bdc06d1e2bfc0c6b70dbf0e7efc109430b25f7fb94040d99664b622a1f136ef35f66
6
+ metadata.gz: 1645cb2a37f41a54cba7a64a00f330da7d29b6966759f99fef3ac4eb0442841efcb58ab621cc88bfaac32a6a445a06f29756426734a96d8189f77b7063f688fd
7
+ data.tar.gz: 6777bfab052e0e700960124dda89d8e918e8890b49d634245a55028e1d954b00335dd61924b02bf9f8d458be9bfde39e36950b20be0785bd8a8f68ba0da1bc01
data/README.md CHANGED
@@ -26,6 +26,11 @@ $ gem install sibu
26
26
  - Use a specific controller & helper for site display
27
27
  - Move page templates to SiteTemplate model
28
28
 
29
+ ## Dependencies & inspiration
30
+ jQuery (for now)
31
+ Shrine
32
+ https://github.com/BLauris/custom-css-for-user (dynamic custom styles)
33
+
29
34
  ## Contributing
30
35
  Contribution directions go here.
31
36
 
@@ -81,6 +81,12 @@ module Sibu
81
81
  content_tag(wrapper, capture(self, &block), opts)
82
82
  end
83
83
 
84
+ def widget(elt, widget_type, opts = {}, &block)
85
+ content = elt.is_a?(Hash) ? elt : (select_element(elt) || {})
86
+ opts.merge!({data: {id: elt_id(elt), type: "widget_#{widget_type.to_s.underscore}"}}) if action_name != 'show'
87
+ content_tag(:div, capture(widget_type.new(content), &block), opts)
88
+ end
89
+
84
90
  # Note : see ActionView::OutputBuffer
85
91
  def sb_page
86
92
  @sb_entity = @page
@@ -29,6 +29,12 @@ module Sibu
29
29
  end
30
30
  end
31
31
 
32
+ def self.refresh_styles
33
+ Sibu::Site.all.each do |s|
34
+ Sibu::DynamicStyle.new(s.id).compile
35
+ end
36
+ end
37
+
32
38
  private
33
39
 
34
40
  def template_file_path
@@ -40,6 +40,8 @@ editPanel.html("");
40
40
  editPanel.html("<%= j(render 'group_edit_panel') %>");
41
41
  <% when 'map' %>
42
42
  editPanel.html("<%= j(render 'map_edit_panel') %>");
43
+ <% when /^widget/ %>
44
+ editPanel.html("<%= j(render "shared/sibu/#{@content_type}_panel") %>");
43
45
  <% else %>
44
46
  editPanel.html("<%= j(render 'error_panel') %>");
45
47
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <div id="pages" class="sibu_view">
2
2
  <div class="actions">
3
- <%= link_to 'Créer une page', new_site_page_path(@site.id) %> | <%= link_to 'Retour', :back %>
3
+ <%= link_to 'Créer une page', new_site_page_path(@site.id) %> <%= link_to 'Retour', :back %>
4
4
  </div>
5
5
  <h2>Pages du site "<%= @site.name %>"</h2>
6
6
  <table>
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.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.2.1
4
+ version: 0.2.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: 2018-03-02 00:00:00.000000000 Z
11
+ date: 2018-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails