pagelet_rails 0.1.8 → 0.2.0
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/app/helpers/pagelets_helper.rb +1 -1
- data/bin/rails +13 -0
- data/lib/pagelet_rails/concerns/controller.rb +19 -4
- data/lib/pagelet_rails/version.rb +1 -1
- data/pagelet_rails.gemspec +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4e4d6d941dd7ae780bb1e934f157e092fa3a09c
|
4
|
+
data.tar.gz: 59f346de0c8ae0a2b8c909d6e15baad70fd73179
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f834814d7a35ffe3e71079961fee5225fa51516a9c152565372d43924f8df8ea7b3cfc0e94320a4cd4d77801ba84202fad58fa0ec89dc778d9b0bb6de98e9be
|
7
|
+
data.tar.gz: 9ebfd6f85d0481e4878285f0d165d9207e29903b514dfcf4a0dd08a5355400657c414c5156b7c4222b412cd0ecf6bfaff7a23fd1bb1edd4ee771aa9c9ee03a6b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
### 0.2.0
|
2
|
+
|
3
|
+
- Fixed bug when original html class is lost (#12)
|
4
|
+
- Simplified rendering, now it always renders outside div container
|
5
|
+
- New feature to trigger refresh of other pagelets on the page (`identified_by` and `trigger_change` methods)
|
6
|
+
- `redirect_to` inside pagelet does not affect the main page when redirect destination is also pagelet
|
7
|
+
|
1
8
|
### 0.1.8
|
2
9
|
|
3
10
|
- Fix executable "rails" conflicts with railties (#11)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module PageletsHelper
|
2
2
|
|
3
3
|
def html_container_attributes
|
4
|
-
html_opts = pagelet_options.html || {}
|
4
|
+
html_opts = pagelet_options.html.deep_dup || {}
|
5
5
|
classes = html_opts.fetch(:class, '').split(' ')
|
6
6
|
classes << "pagelet-#{controller_name}"
|
7
7
|
classes << "pagelet-#{controller_name}-#{action_name}"
|
data/bin/rails
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
3
|
+
# installed from the root of your application.
|
4
|
+
|
5
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
6
|
+
ENGINE_PATH = File.expand_path('../../lib/pagelet_rails/engine', __FILE__)
|
7
|
+
|
8
|
+
# Set up gems listed in the Gemfile.
|
9
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
10
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
11
|
+
|
12
|
+
require 'rails/all'
|
13
|
+
require 'rails/engine/commands'
|
@@ -60,7 +60,8 @@ module PageletRails::Concerns::Controller
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def pagelet_encoded_original_options new_opts = {}
|
63
|
-
encode_data = pagelet_options.original_options.to_h
|
63
|
+
encode_data = pagelet_options.original_options.to_h
|
64
|
+
.with_indifferent_access.except('remote').deep_merge(new_opts)
|
64
65
|
PageletRails::Encryptor.encode(encode_data)
|
65
66
|
end
|
66
67
|
|
@@ -84,9 +85,23 @@ module PageletRails::Concerns::Controller
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def redirect_to *args
|
87
|
-
|
88
|
-
|
88
|
+
begin
|
89
|
+
redirect_url = url_for(*args)
|
90
|
+
path_opts = Rails.application.routes.recognize_path(redirect_url)
|
91
|
+
rescue ActionController::RoutingError
|
92
|
+
return super
|
93
|
+
end
|
94
|
+
|
95
|
+
controller_class = path_opts[:controller].camelize.concat('Controller').safe_constantize
|
96
|
+
is_pagelet = controller_class && controller_class.include?(PageletRails::Concerns::Controller)
|
97
|
+
|
98
|
+
if is_pagelet
|
99
|
+
options = args.extract_options!
|
100
|
+
new_params = options.merge(original_pagelet_options: pagelet_encoded_original_options)
|
89
101
|
|
90
|
-
|
102
|
+
render plain: pagelet(url_for(*args, new_params))
|
103
|
+
else
|
104
|
+
super
|
105
|
+
end
|
91
106
|
end
|
92
107
|
end
|
data/pagelet_rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagelet_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Katunin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -165,6 +165,7 @@ files:
|
|
165
165
|
- app/views/layouts/pagelet_rails/container.erb
|
166
166
|
- app/views/layouts/pagelet_rails/inner.erb
|
167
167
|
- app/views/layouts/pagelet_rails/loading_placeholder.erb
|
168
|
+
- bin/rails
|
168
169
|
- config/routes.rb
|
169
170
|
- gemfiles/rails_4.2.8.gemfile
|
170
171
|
- gemfiles/rails_5.0.2.gemfile
|