promethee 1.3.21 → 1.3.22

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: 23a1fe1befc2ac6c712512507c0093c3eed0ec20
4
- data.tar.gz: 5515851c16fcb7205890358baf48062dbd75cb60
3
+ metadata.gz: 97e33bc3865783e2c979d9ba89d5e624bfe36844
4
+ data.tar.gz: 48397ea537c3bf6124bc9c0b139e0b54fb6f5872
5
5
  SHA512:
6
- metadata.gz: 6f8f8993748c5c5ea21ae5aab28fff8f59a1d8c63a1df92eecee793aaab470f6fbce46d9710f053d43e2a963b76c213fa2d8269e48d88c18e523b1328f7e765b
7
- data.tar.gz: 7233de7cd3046ba978ae7fbc29e170afa233159906c7a6a6c50302b75caae052d11f86518a87cc41d279ff721a69945924b14d773603ace5fe32c7072d5e5db5
6
+ metadata.gz: 2430971b5b06d08d95e0dc9d996b74af4803dbc3d55e12f0e21652dee5cd18066c52d3c9e664fef6daba1b79c6039cfa901bc5cd3a6d3e1b18f90e8c6bd2a4c8
7
+ data.tar.gz: 0b0ad04179dc43eacca66925a43859293e4654f8dfdd43dbb7cd8aa68d438bafdcf8a1c0a13bccf2ee152b141967f3b08d5ed906811313c7294eb6e8979c40b6
data/README.md CHANGED
@@ -121,6 +121,15 @@ This would do quite the same thing:
121
121
  </form>
122
122
  ```
123
123
 
124
+ You can specify a back link url to go to when closing the editor without saving:
125
+
126
+ ```erb
127
+ <%= form_for @page do |f| %>
128
+ <%= f.promethee :data, back_url: root_path %>
129
+ <%= f.submit %>
130
+ <% end %>
131
+ ```
132
+
124
133
  With javascript set:
125
134
  ```
126
135
  //= require jquery
@@ -1,5 +1,6 @@
1
1
  <%
2
2
  promethee_data = Promethee::Data.new master_data
3
+ back_url ||= nil
3
4
  logo = File.read "#{__dir__}/../../assets/images/icon-promethee.svg"
4
5
  %>
5
6
 
@@ -132,7 +133,11 @@ promethee.controller('PrometheeController', ['$scope', 'summernoteConfig', 'pres
132
133
  </ul>
133
134
  </li>
134
135
  <li ng-click="submit()"><a><%= fa_icon :save %></a></li>
135
- <li ng-click="promethee.fullscreen = false"><a><%= fa_icon :close %></a></li>
136
+ <% if back_url.present? %>
137
+ <li><%= link_to fa_icon(:close).html_safe, back_url %></li>
138
+ <% else %>
139
+ <li ng-click="promethee.fullscreen = false"><a><%= fa_icon :close %></a></li>
140
+ <% end %>
136
141
  </ul>
137
142
  </div>
138
143
  </div>
@@ -8,7 +8,8 @@ module ActionView
8
8
  def render
9
9
  master_data = object.send @method_name unless object.nil?
10
10
  master_data = @options[:value] if @options.include? :value
11
- ApplicationController.renderer.render partial: 'promethee/edit', locals: { master_data: master_data }
11
+ back_link = @options[:back_url]
12
+ ApplicationController.renderer.render partial: 'promethee/edit', locals: { master_data: master_data, back_url: back_url }
12
13
  end
13
14
  end
14
15
 
@@ -17,12 +18,12 @@ module ActionView
17
18
  localization_data = object.send @method_name unless object.nil?
18
19
  localization_data = @options[:value] if @options.include? :value
19
20
  master_data = @options[:master]
20
- ApplicationController.renderer.render partial: 'promethee/localize',
21
- locals: {
21
+ ApplicationController.renderer.render partial: 'promethee/localize',
22
+ locals: {
22
23
  object_name: @object_name,
23
24
  method_name: @method_name,
24
- localization_data: localization_data,
25
- master_data: master_data
25
+ localization_data: localization_data,
26
+ master_data: master_data
26
27
  }
27
28
  end
28
29
  end
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '1.3.21'
3
+ VERSION = '1.3.22'
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.3.21
4
+ version: 1.3.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Dargelos