promethee 1.4.23 → 1.4.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '082d1b521cc56683500dc8633efaed60cb7dcfa1'
4
- data.tar.gz: c6d9fd94b9d69f71e417243ce012bdd1881e891d
3
+ metadata.gz: 5a597dfe16dab27efd0c0e90fc07e5ec42642023
4
+ data.tar.gz: '08e1e470475c6611400ff6933a17f18cabe93040'
5
5
  SHA512:
6
- metadata.gz: 33ef9d15dc92c98284bc0e6c729aa328466ef9db996f31d1a849e4928e86c94be8270d6264aea0f4d16e30eab41cd02cf4b1f3a089b4b4912980fa57f5fe6cfa
7
- data.tar.gz: d1e5c0049c0096853fde305cd8066e37af9647d955f019ab5d2bc9ed0f93122d0b5ac2140869b763d64ef555115e05ed5d9c2fedf162fb535afd2fed15a4cd0f
6
+ metadata.gz: aff244c67c8453f09b08af514df1414926ae0f86334bb9c9d11550470d3462eaa8d2f2910ce189b14fd1c7555f2e265993b4e3dc67872f5a083f5639add90e75
7
+ data.tar.gz: b3e5fdbb1fbbe0e80e15a72a55176aaa5452b9a95ef1b528158a28f4b869f4e641fdcc90aa6da2425c2e4757dce9ecc2721e496a52bd179fd25b2f6c84513853
data/README.md CHANGED
@@ -188,6 +188,12 @@ To register a component, the code is:
188
188
  To be able to preview responsivity, there is a POST "promethee/preview" route.
189
189
  When you send your data, it renders the page in the default layout.
190
190
 
191
+ If you want to use a different layout, specify it in your editor's options :
192
+
193
+ ```erb
194
+ <%= promethee_editor :page, :data, value: @page.data, back_url: root_path, preview_layout: 'layouts/my-preview' %>
195
+ ```
196
+
191
197
  This is used to generate a live responsive preview.
192
198
 
193
199
  ### Render localized (l10n)
@@ -4,6 +4,7 @@ class PrometheeController < ApplicationController
4
4
 
5
5
  def preview
6
6
  @data = params[:data]
7
+ render 'preview', layout: params[:preview_layout] if params.include? :preview_layout
7
8
  end
8
9
 
9
10
  def blob_create
@@ -103,6 +103,15 @@ promethee.controller('PrometheeController', ['$scope', 'summernoteConfig', 'pres
103
103
  input.value = JSON.stringify($scope.promethee.data);
104
104
  input.name = 'data';
105
105
  form.appendChild(input);
106
+
107
+ <% if preview_layout.present? %>
108
+ var layoutInput = document.createElement('input');
109
+ layoutInput.type = 'text';
110
+ layoutInput.value = "<%= preview_layout %>";
111
+ layoutInput.name = 'preview_layout';
112
+ form.appendChild(layoutInput);
113
+ <% end %>
114
+
106
115
  form.submit();
107
116
  document.body.removeChild(form);
108
117
  }
@@ -6,10 +6,8 @@ module ActionView
6
6
  # https://github.com/rails/rails/blob/bdc581616b760d1e2be3795c6f0f3ab4b1e125a5/actionview/lib/action_view/helpers/tags/text_field.rb
7
7
  class PrometheeEditor < Base
8
8
  def render
9
- master_data = object.send @method_name unless object.nil?
10
- master_data = @options[:value] if @options.include? :value
11
- back_url = @options[:back_url]
12
- ApplicationController.renderer.render partial: 'promethee/edit', locals: { master_data: master_data, back_url: back_url }
9
+ @options[:master_data] = object.send @method_name unless object.nil? || @options.include? :value
10
+ ApplicationController.renderer.render partial: 'promethee/edit', locals: @options
13
11
  end
14
12
  end
15
13
 
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '1.4.23'
3
+ VERSION = '1.4.24'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promethee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.23
4
+ version: 1.4.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Dargelos
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2018-05-04 00:00:00.000000000 Z
16
+ date: 2018-05-14 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rails