locales_panel 0.2.0 → 1.0.0

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: afaa0acd3da6432f5873d66a771e287ffa411185
4
- data.tar.gz: 0fed03c8e8d14057aa3d426ed3c0f3b4e35259ec
3
+ metadata.gz: 54d5e29f5e637167a857ac61147f515432326637
4
+ data.tar.gz: 79e039d9276a82cff37696143922a5c8d42a6b63
5
5
  SHA512:
6
- metadata.gz: 7626041cbf2d73a5ff23c44c0bf3656d26741b725e0d1a3346199bc8465bfbc02881795903a97e32386aca16a5d253db17da6a36f86ba59e0fe3843942132dca
7
- data.tar.gz: 6585a358eeab09b86718f3001b40f5c940f25ee71e2499a8ea85559b29153f733863b4f7b26389c150a0102e4e284972acefe684347475afa635689574cbb53c
6
+ metadata.gz: fd2e248b8c3f6d07259a0a9cdbb7a4b39cfeb102c46bc35aa811a255405b588f944be01b0e2832f891025567a2eebeeedb6144657da8199e07c55008aab3c6a5
7
+ data.tar.gz: b92f04b9edda2996963017e2e3fc6dd4e165fc29e08a759dfd280c82f79493ed865879639a33b50ab906a62e327b9e1ab78188052fb7d790048e9c578869a8cf
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  Change translations directly in a published site.
4
4
 
5
- Use by visiting `http://.../locales/edit`. Saving will overwrite YAML locales files.
5
+ Use by visiting `http://.../locales/edit`.
6
+
7
+ Saving will overwrite YAML locale files.
6
8
 
7
9
  # Installation
8
10
 
@@ -14,13 +16,27 @@ Run in console:
14
16
 
15
17
  $ bundle
16
18
 
19
+ Add to config/routes.rb:
20
+
21
+ locales_panel
22
+
23
+ ... or customize route with a scope, like:
24
+
25
+ scope :admin do
26
+ locales_panel
27
+ end
28
+
29
+ Set authorization in config/application.rb. It can be any before_filter you like. For devise:
30
+
31
+ def locales_panel_before_filter
32
+ authenticate_user!
33
+ end
34
+
17
35
  # Join
18
36
 
19
- Create pull request or contact on [skype chat](http://kapustka.net/chat?user=kapustka.maciek).
37
+ Create pull request or [contact on chat](http://kapustka.net/chat?user=kapustka.maciek).
20
38
 
21
39
  **todo**
22
- - hook for authorization
23
- - configurable route
24
40
  - download link
25
41
  - add to git link
26
42
  - check with rails 3
@@ -28,4 +44,3 @@ Create pull request or contact on [skype chat](http://kapustka.net/chat?user=kap
28
44
  - highlight untranslated
29
45
  - translate editor itself
30
46
  - css
31
- - tests for indentation fix, security fix and I18n.reload
@@ -1,5 +1,6 @@
1
1
  class LocalesController < ApplicationController
2
- before_action { @paths = Rails.configuration.i18n.load_path.delete_if{|path|path['/gems/']}}
2
+ before_filter { try :locales_panel_before_filter }
3
+ before_action { @paths = Rails.configuration.i18n.load_path.delete_if { |path| path['/gems/'] } }
3
4
 
4
5
  def edit
5
6
  @files = []
data/config/routes.rb CHANGED
@@ -1,3 +1,2 @@
1
1
  Rails.application.routes.draw do
2
- resource :locales, only: [:edit, :update]
3
2
  end
@@ -0,0 +1,5 @@
1
+ class ActionDispatch::Routing::Mapper
2
+ def locales_panel
3
+ resource :locales, only: [:edit, :update]
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module LocalesPanel
2
- VERSION = '0.2.0'
2
+ VERSION = '1.0.0'
3
3
  end
data/lib/locales_panel.rb CHANGED
@@ -1,4 +1,5 @@
1
- require "locales_panel/engine"
1
+ require 'locales_panel/engine'
2
+ require 'locales_panel/routes'
2
3
 
3
4
  module LocalesPanel
4
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locales_panel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Kasprzyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-14 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -81,6 +81,7 @@ files:
81
81
  - config/routes.rb
82
82
  - lib/locales_panel.rb
83
83
  - lib/locales_panel/engine.rb
84
+ - lib/locales_panel/routes.rb
84
85
  - lib/locales_panel/version.rb
85
86
  - lib/tasks/locales_panel_tasks.rake
86
87
  homepage: https://github.com/lokson/locales_panel