phrasing 4.0.0rc1 → 4.0.0rc2
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/4.0.0_changes.md +1 -0
- data/CHANGELOG.md +8 -0
- data/README.md +0 -1
- data/Release_notes_version_4.md +1 -1
- data/app/controllers/phrasing_phrase_versions_controller.rb +1 -1
- data/app/controllers/phrasing_phrases_controller.rb +1 -1
- data/app/helpers/inline_helper.rb +4 -8
- data/lib/phrasing.rb +7 -24
- data/lib/phrasing/rails/engine.rb +19 -0
- data/lib/phrasing/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9dcfc2841ec28bd67e4753423cc4b95a6620b4f
|
4
|
+
data.tar.gz: 9979a2f18909e0e8acf2d1655cf7cc05c5a2f310
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 626fdf49d11632970a2f55c434dd92c9bbd2cdc25d5a7a58ab365455580d7e723bb24a6cc4f77ff56d82244be3d747ade1f588ad8300eb6bc77f8d56f7947769
|
7
|
+
data.tar.gz: 6026e75cf96b9b934fde9f798c47462a70de07d51026bfbfa4095eabe8a8cebc1977179040c9ef55083d44062d8d4f5608207da66ec7fa7fdc329a12ca6f3077
|
data/4.0.0_changes.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Changes
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Phrasing Change Log
|
2
2
|
|
3
|
+
## 3.2.7 (October 3rd, 2014)
|
4
|
+
|
5
|
+
Add a config option to set a parent controller to Phrasing Engine Controllers.
|
6
|
+
|
7
|
+
## 3.2.6 (September 15th, 2014)
|
8
|
+
|
9
|
+
Show Home page only when view responds to :root_path.
|
10
|
+
|
3
11
|
## 3.2.5 (June 17th, 2014)
|
4
12
|
|
5
13
|
Added index for phrasing_phrase_id in versions table.
|
data/README.md
CHANGED
@@ -114,7 +114,6 @@ The `phrase` view helper can take the `options` hash as the last parameter. Feat
|
|
114
114
|
url: custom_url # point Phrasing to other actions in other controllers
|
115
115
|
inverse: true # change the hovered background and underline colors to better fit darker backgrounds
|
116
116
|
class: custom_class # add custom CSS classes to your phrases to change the appearance of phrases in your application
|
117
|
-
interpolation: { %min: 10 } # add variables to your translations just like w/ I18n
|
118
117
|
scope: 'homepage.footer' # add scopes just like you would w/ I18.n. If the first argument is 'test', than the key would be 'homepage.footer.test'
|
119
118
|
```
|
120
119
|
|
data/Release_notes_version_4.md
CHANGED
@@ -11,7 +11,7 @@ However, when using the phrase(key) method, if the key doesn't currently exist i
|
|
11
11
|
|
12
12
|
## Interpolation
|
13
13
|
|
14
|
-
|
14
|
+
The interpolation option has been kicked out.
|
15
15
|
|
16
16
|
The problem with the interpolation option is that most clients won't understand what's happening when they see something like "Hi, my name is %{name}" once they are editing data.
|
17
17
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module InlineHelper
|
2
2
|
# Normal phrase
|
3
|
-
# phrase("headline", url: www.infinum.co/yabadaba, inverse: true,
|
3
|
+
# phrase("headline", url: www.infinum.co/yabadaba, inverse: true, scope: "models.errors")
|
4
4
|
|
5
5
|
# Data model phrase
|
6
6
|
# phrase(record, :title, inverse: true, class: phrase-record-title)
|
@@ -18,7 +18,7 @@ module InlineHelper
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def inline(record, attribute, options={})
|
21
|
-
return uneditable_phrase(record, attribute
|
21
|
+
return uneditable_phrase(record, attribute) unless can_edit_phrases?
|
22
22
|
|
23
23
|
klass = 'phrasable phrasable_on'
|
24
24
|
klass += ' inverse' if options[:inverse]
|
@@ -37,12 +37,8 @@ module InlineHelper
|
|
37
37
|
inline(record, :value, options)
|
38
38
|
end
|
39
39
|
|
40
|
-
def uneditable_phrase(record, attribute
|
41
|
-
record_value =
|
42
|
-
I18n.interpolate(record.send(attribute), options[:interpolation])
|
43
|
-
else
|
44
|
-
record.send(attribute)
|
45
|
-
end
|
40
|
+
def uneditable_phrase(record, attribute)
|
41
|
+
record_value = record.send(attribute)
|
46
42
|
record_value.to_s.html_safe
|
47
43
|
end
|
48
44
|
|
data/lib/phrasing.rb
CHANGED
@@ -1,37 +1,20 @@
|
|
1
1
|
require 'phrasing'
|
2
|
-
require
|
2
|
+
require 'phrasing/serializer'
|
3
|
+
require 'phrasing/rails/engine'
|
3
4
|
require 'jquery-rails'
|
4
5
|
require 'jquery-cookie-rails'
|
5
6
|
require 'haml-rails'
|
6
7
|
|
7
8
|
module Phrasing
|
8
|
-
module Rails
|
9
|
-
class Engine < ::Rails::Engine
|
10
|
-
initializer :assets, group: :all do
|
11
|
-
::Rails.application.config.assets.paths << ::Rails.root.join('app', 'assets', 'fonts')
|
12
|
-
::Rails.application.config.assets.paths << ::Rails.root.join('app', 'assets', 'images')
|
13
|
-
::Rails.application.config.assets.precompile += %w(editor.js
|
14
|
-
phrasing_engine.css
|
15
|
-
phrasing_engine.js
|
16
|
-
icomoon.dev.svg
|
17
|
-
icomoon.svg
|
18
|
-
icomoon.eot
|
19
|
-
icomoon.ttf
|
20
|
-
icomoon.woff
|
21
|
-
phrasing_icon_edit_all.png)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
|
28
|
-
module Phrasing
|
29
|
-
|
30
9
|
mattr_accessor :allow_update_on_all_models_and_attributes
|
31
|
-
|
10
|
+
@@allow_update_on_all_models_and_attributes = false
|
32
11
|
|
12
|
+
mattr_accessor :route
|
33
13
|
@@route = 'phrasing'
|
34
14
|
|
15
|
+
mattr_accessor :parent_controller
|
16
|
+
@@parent_controller = "ApplicationController"
|
17
|
+
|
35
18
|
def self.setup
|
36
19
|
yield self
|
37
20
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Phrasing
|
2
|
+
module Rails
|
3
|
+
class Engine < ::Rails::Engine
|
4
|
+
initializer :assets, group: :all do
|
5
|
+
::Rails.application.config.assets.paths << ::Rails.root.join('app', 'assets', 'fonts')
|
6
|
+
::Rails.application.config.assets.paths << ::Rails.root.join('app', 'assets', 'images')
|
7
|
+
::Rails.application.config.assets.precompile += %w(editor.js
|
8
|
+
phrasing_engine.css
|
9
|
+
phrasing_engine.js
|
10
|
+
icomoon.dev.svg
|
11
|
+
icomoon.svg
|
12
|
+
icomoon.eot
|
13
|
+
icomoon.ttf
|
14
|
+
icomoon.woff
|
15
|
+
phrasing_icon_edit_all.png)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/phrasing/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phrasing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.0rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomislav Car
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09
|
12
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -103,6 +103,7 @@ extra_rdoc_files: []
|
|
103
103
|
files:
|
104
104
|
- ".gitignore"
|
105
105
|
- ".travis.yml"
|
106
|
+
- 4.0.0_changes.md
|
106
107
|
- CHANGELOG.md
|
107
108
|
- Gemfile
|
108
109
|
- MIT-LICENSE
|
@@ -144,6 +145,7 @@ files:
|
|
144
145
|
- lib/generators/phrasing/templates/db/migrate/create_phrasing_phrase_versions.rb
|
145
146
|
- lib/generators/phrasing/templates/db/migrate/create_phrasing_phrases.rb
|
146
147
|
- lib/phrasing.rb
|
148
|
+
- lib/phrasing/rails/engine.rb
|
147
149
|
- lib/phrasing/serializer.rb
|
148
150
|
- lib/phrasing/version.rb
|
149
151
|
- phrasing.gemspec
|
@@ -217,4 +219,3 @@ signing_key:
|
|
217
219
|
specification_version: 4
|
218
220
|
summary: Edit phrases inline for Rails applications!
|
219
221
|
test_files: []
|
220
|
-
has_rdoc:
|