i18n_admin_utils 0.0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/i18n_admin_utils/application.coffee +59 -2
- data/app/assets/javascripts/i18n_admin_utils/jquery.autosize.min.js +7 -0
- data/app/assets/javascripts/i18n_admin_utils/translation_helper.coffee +0 -8
- data/app/assets/stylesheets/i18n_admin_utils/animation.scss +38 -0
- data/app/assets/stylesheets/i18n_admin_utils/application.scss +130 -5
- data/app/assets/stylesheets/i18n_admin_utils/general.scss +20 -0
- data/app/assets/stylesheets/i18n_admin_utils/variables.scss +8 -0
- data/app/controllers/i18n_admin_utils/application_controller.rb +1 -0
- data/app/controllers/i18n_admin_utils/translation_controller.rb +8 -3
- data/app/views/i18n_admin_utils/translation/_missing_list.html.erb +23 -69
- data/app/views/i18n_admin_utils/translation/_show.html.erb +34 -0
- data/app/views/i18n_admin_utils/translation/index.html.erb +15 -3
- data/app/views/layouts/i18n_admin_utils/application.html.erb +11 -12
- data/config/routes.rb +1 -0
- data/lib/generators/i18n_admin_utils/templates/initializer.rb +19 -17
- data/lib/i18n_admin_utils.rb +1 -0
- data/lib/i18n_admin_utils/search_result.rb +28 -11
- data/lib/i18n_admin_utils/search_translation.rb +21 -13
- data/lib/i18n_admin_utils/version.rb +1 -1
- data/test/controller/translation_controller_test.rb +5 -0
- data/test/dummy/log/test.log +5516 -0
- data/test/dummy/tmp/cache/assets/test/sass/0d97129c0283d46bbf0537a2de8a24b5a7510437/application.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/384c583868469990ce0c02d63d1efc9f238eed23/application.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/7322290d5b5a0183eca80a038be75967642893f3/bootstrap.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/9e5258bddc9a4bf311660ecb7f332e222a3f1889/animation.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/9e5258bddc9a4bf311660ecb7f332e222a3f1889/application.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/9e5258bddc9a4bf311660ecb7f332e222a3f1889/variables.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_alerts.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_badges.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_breadcrumbs.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_button-groups.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_buttons.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_carousel.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_close.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_code.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_component-animations.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_dropdowns.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_forms.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_glyphicons.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_grid.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_input-groups.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_jumbotron.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_labels.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_list-group.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_media.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_mixins.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_modals.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_navbar.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_navs.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_normalize.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_pager.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_pagination.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_panels.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_popovers.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_print.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_progress-bars.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_responsive-utilities.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_scaffolding.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_tables.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_thumbnails.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_tooltip.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_type.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_variables.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/a97874a6287e72cfc1fd7afbfdd0dd38a20cee90/_wells.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/00beb25befcbf40f28ed3c0b9eee8c14 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/072cf931c6bb9918518ccfe487ccc327 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/095bb0010c0bb6a24e892b0c4e8f5b53 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/0ba4069fce7a5be4a4c19d2dde1c5743 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/10830ce43a90b9bcb235c1531c5944e6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/114d56955380c8384c766224747815cf +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/116742965048c5be1bb69978017f80a3 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/12060d81d261c035ebf480eb414194ce +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/1365eaa3dc94eb44652c9b9031db42a7 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/14d1e3d19a7d88f7b8e91932575444ea +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/1746ab2117b8d8ea29fcc3b70f68d36a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/19a633f87ee736f9e0fbb6f6155ed0ec +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/19cc8814173502945e96c862e21457be +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/262c82c6b25f0b1e4637a5ad699f15fe +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2d434c8eff72881900daa4b70f33ef07 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/30ebababf5c83eb4b79aad5c7dac5746 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/38f7d34f9a86dc3b19d3e7cc9339e96a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/3d805ed5398e80dbfc17a3555a1f3650 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/3edfbc02f0f82171759dd675599a49b3 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/3f1c6dcab797ecc275943077e97e0627 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4032c9f626a5d13c4a8c79d22a36d7ca +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/43bfe71fd0cdd78a0de168ed2c6bde29 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/450a463212dbf4a9562db38b52d61c51 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/484a178bf24ce82fadf79e3e44ad6793 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/49c26907b57f1627ee21417f52d5035e +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4a6d3bb63270e9c9c28c6f433393ed96 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4a823b128c9421822ffefbd749e3647e +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4b6b370b3a40b2a3457098740eb400c9 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4f66658e8b287b5249b325d4ef22009b +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/5075debcad09a5821613860e24fcddff +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/51928311641a7c44f44c2567018c67ec +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/553642c43a1220ccccefa337416048da +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/5f1a6d2942527df2afb3c8381be435bf +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/611072a1b01457964c3ec9c86cfd11ee +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/618433f754d672645821f15733ffb738 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/6610fbcff601c8472411dc3eb77d6378 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/668f62d9af532b3416ff0c028af42efe +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/69ac4f789729201a9f7cf2452791f326 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/6cba87fa8aa16df3dc241b15e206086e +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/6ed6543a41b30c5bd78acf1c1ecea821 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/6f8f971a5472ce32e003dd496921bb62 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/707be05e036a957a7b78be5c7712d6d0 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7822f0af8388e99c2f4f29cc35908366 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7a211b594c1a58e4016eba7fca4e8b99 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7c1da05983c6bcf6b499a25dc4b1e547 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7c6392f014b6fdb44d1d6995a5d543df +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/803c98c3a83396a2b77f38e49e0dd3bb +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/80a9481e40b4235576c433f3699d7112 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/8310e1d76394ea89e3acbb227be2da68 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/866bea01f441dd9bb4460303e8a64ab6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/8825c729e8987a6dd8561b0fbe29f297 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/96ff8a5ef06b4cf23fabf41b9c264526 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/9d4c9b709e3d2a506971889d9c98c7c7 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/a6602ac50069dd70b854c7c277b8d836 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/a9a3f6a82daa6c88718aa77fd383c030 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/b30c9332b8c8cb10711d7f8a827aa834 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/b3c62bdc9ffceb3b760e7f038ae022bd +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/bdd102e9869d885fa77e2ab8d342dd95 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c0438b2184f7df54154799267100dc17 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c450d8cbbe9e64902215019bfeb7662c +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c5cdbd67191827431df3cd97ad248f24 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c8435923925e29f072eabbb1030d4827 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c907da500da8808d7523d17bb1756d2e +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c9808e0da00e7d16a0cceead7d00892a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c9c239f1ecb82653c32ec69ae8a009f2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cad7b28e62c1181c1b17ce9aa7d94bcb +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cb824d4dfce2c820014a0b3ec4a588a7 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d1ef944cc44bda594ce99b836dea9294 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d818e6ff34017bc1bde1272fdca94e1a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d8362e6ee9d48b5cfe5b3480ebe961e2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d91e8070da300b32cbc8a470ebbe0eae +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/dd8a731f949d0b4148a2c91661d861cc +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/deebe52d7458589014733d28288bab93 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e3d9e72885a00723fb3fef952843f938 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e7331b5364f7c04198d76cef09dda74c +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e7bd06fae7469515a4673a79674015a4 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/eb2867da33f352331b0a86f8f9b9ccdf +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ef3cf9fda95c48609810aeb9f06663e0 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ffaaa9885bacb43ec5a33a8f1641d526 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ffee5c635a1dc7991a00ecd5bc8f83e4 +0 -0
- data/test/i18n_admin_utils/search_translation_test.rb +3 -3
- data/test/i18n_admin_utils/yml_manager_test.rb +2 -2
- data/test/test_helper.rb +1 -1
- data/test/tmp/config/initializers/i18n_admin_utils.rb +19 -17
- data/test/tmp/yml/{test_tml.en.yml → test_yml.en.yml} +0 -0
- metadata +113 -8
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDIzYjQyMjUxZTY1ZDUzY2FiYWUzOTlmZjU2ZjAzYTQ1MmRmZDBiNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmQ3Mzk2ZDIyNmY5NjNlY2U5Nzg2YmFiOWIzMzM3NjdlMmJiY2ZiYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzczOWZiMTIyNDg0NGY1ODg3NzI0YWQ2ZWQyN2JlYjY0ZjM4M2Y1NDhmM2I4
|
10
|
+
N2I4ZGRiOWE1MmY1M2I0ODE4OTMyYjZiZjVhNTgzY2I1YTY3MjVmMTFkMDY4
|
11
|
+
ZWEzMGQ1NTQwNjgwZDdmY2NiNjIxN2JjMmMzOWE1NjQzZjhiOGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGE1ZmM4N2YzMDkyNzg4OWZjZDk3YTUxOTE1MzFjZmY2MTg0MDRjYjdmMDdk
|
14
|
+
ZDJlY2U1NTJiZmQ5NjkyY2EzOWNhMzZmOGVjZjM1ZjM2ZGFiZDkwMTUxYjUz
|
15
|
+
NmYzZjUxNGM3MDcxMDRlZGE0ZWM3ZmRlZDc5MzI3YTgxZTcwNjk=
|
@@ -16,20 +16,77 @@
|
|
16
16
|
#= require_tree .
|
17
17
|
#= require bootstrap
|
18
18
|
|
19
|
-
$(document).ready ()->
|
19
|
+
$(document).ready () ->
|
20
20
|
window.load_script_on($(this))
|
21
|
+
|
22
|
+
$('.loadonready').each () ->
|
23
|
+
container = $(this)
|
24
|
+
url = container.data('url')
|
25
|
+
container.html($('#loading_icon').html())
|
26
|
+
$.get(url).success (data) ->
|
27
|
+
container.html(data)
|
28
|
+
window.load_script_on(container)
|
29
|
+
|
21
30
|
$(document).on 'click', 'form input.nosubmit, form button.nosubmit', (e) ->
|
22
31
|
e.preventDefault();
|
23
32
|
|
24
33
|
$(document).on 'keyup', 'input[data-update], textarea[data-update]', () ->
|
25
34
|
input = $(this)
|
26
35
|
form = input.closest('form')
|
27
|
-
console.log(form)
|
28
36
|
form.find('input[name="' + input.data('update') + '"], textarea[name="' + input.data('update') + '"]').val(input.val())
|
29
37
|
|
38
|
+
$(document).on 'click', '.toogle-container', () ->
|
39
|
+
container = $($(this).data('container'))
|
40
|
+
if container.is(':visible')
|
41
|
+
container.hide()
|
42
|
+
else
|
43
|
+
container.show()
|
44
|
+
|
45
|
+
$(document).on 'keyup', 'input.translation_search', () ->
|
46
|
+
input = $(this)
|
47
|
+
val = input.val()
|
48
|
+
|
49
|
+
|
50
|
+
container = input.closest '.translation_container'
|
51
|
+
elements = container.find('.translation_list .translation_item')
|
52
|
+
if val.length == 0
|
53
|
+
show_translation_element(elements)
|
54
|
+
else
|
55
|
+
query = '[data-locale*="' + val + '"],[data-key*="' + val + '"], [data-filename*="' + val + '"]'
|
56
|
+
show_translation_element(elements.filter(query))
|
57
|
+
hide_translation_element(elements.not(query))
|
58
|
+
|
59
|
+
$(document).on 'click', '.translation_list .translation_item', () ->
|
60
|
+
item = $(this)
|
61
|
+
list = item.closest('.translation_list')
|
62
|
+
list.find('.translation_item.active').each () ->
|
63
|
+
$(this).removeClass('active')
|
64
|
+
item.addClass('active')
|
65
|
+
container = item.closest('.translation_container').find(list.data('container'))
|
66
|
+
container.html($('#loading_icon').html())
|
67
|
+
$.get(list.data('url'), {
|
68
|
+
translation: item.data('translation')
|
69
|
+
}).success (data) ->
|
70
|
+
container.html(data)
|
71
|
+
window.load_script_on(container)
|
72
|
+
|
30
73
|
#Rerun this command for reloading script for new element added with ajax for example
|
31
74
|
window.load_script_on = (container) ->
|
32
75
|
container.find("[rel=tooltip]").tooltip({ container: 'body', animation: false, delay: 0});
|
33
76
|
container.find("[rel=popover]").popover({ container: 'body', animation: false, delay: 0, trigger: 'hover'});
|
34
77
|
container.find('[data-toggle="modal"]').modal('hide')
|
78
|
+
container.find('textarea.autosize').autosize()
|
79
|
+
window.load_rails_embed_code_editor() #Reload editors
|
80
|
+
|
81
|
+
|
82
|
+
show_translation_element = (elements) ->
|
83
|
+
elements.each () ->
|
84
|
+
element = $(this)
|
85
|
+
if not element.is ':visible'
|
86
|
+
element.slideDown(200)
|
35
87
|
|
88
|
+
hide_translation_element = (elements) ->
|
89
|
+
elements.each () ->
|
90
|
+
element = $(this)
|
91
|
+
if element.is ':visible'
|
92
|
+
element.slideUp(200)
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*!
|
2
|
+
Autosize v1.18.6 - 2014-03-13
|
3
|
+
Automatically adjust textarea height based on user input.
|
4
|
+
(c) 2014 Jack Moore - http://www.jacklmoore.com/autosize
|
5
|
+
license: http://www.opensource.org/licenses/mit-license.php
|
6
|
+
*/
|
7
|
+
(function(e){var t,o={className:"autosizejs",id:"autosizejs",append:"",callback:!1,resizeDelay:10,placeholder:!0},i='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],a=e(i).data("autosize",!0)[0];a.style.lineHeight="99px","99px"===e(a).css("lineHeight")&&n.push("lineHeight"),a.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),a.parentNode!==document.body&&e(document.body).append(a),this.each(function(){function o(){var t,o=window.getComputedStyle?window.getComputedStyle(u,null):!1;o?(t=u.getBoundingClientRect().width,0===t&&(t=parseInt(o.width,10)),e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){t-=parseInt(o[i],10)})):t=Math.max(p.width(),0),a.style.width=t+"px"}function s(){var s={};if(t=u,a.className=i.className,a.id=i.id,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){s[t]=p.css(t)}),e(a).css(s).attr("wrap",p.attr("wrap")),o(),window.chrome){var r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?s():o(),a.value=!u.value&&i.placeholder?(p.attr("placeholder")||"")+i.append:u.value+i.append,a.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),a.scrollTop=0,a.scrollTop=9e4,e=a.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width();p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===p.css("resize")||"vertical"===p.css("resize")?"none":"horizontal"}),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$);
|
@@ -1,5 +1,4 @@
|
|
1
1
|
#Script that add forms to edit non existing translation
|
2
|
-
|
3
2
|
$(document).ready () ->
|
4
3
|
$('span.translation_missing').each ->
|
5
4
|
span = $(this)
|
@@ -11,12 +10,6 @@ $(document).ready () ->
|
|
11
10
|
content: content
|
12
11
|
})
|
13
12
|
|
14
|
-
$('.loadonready').each () ->
|
15
|
-
container = $(this)
|
16
|
-
url = container.data('url')
|
17
|
-
$.get(url).success (data) ->
|
18
|
-
container.html(data)
|
19
|
-
window.load_script_on(container)
|
20
13
|
|
21
14
|
$(document).on 'submit', 'form.translation_helper', (e)->
|
22
15
|
e.preventDefault()
|
@@ -41,7 +34,6 @@ $(document).ready () ->
|
|
41
34
|
get_content = (span)->
|
42
35
|
url = '/translation/edit'
|
43
36
|
key = span.attr('title').match(/translation missing: (.*)/)[1]
|
44
|
-
console.log(key)
|
45
37
|
content = "<form action='" + url + "' method='post' class='translation_helper'>"
|
46
38
|
content += "<div class='alert alert-danger hidden'></div>"
|
47
39
|
content += "<input type='hidden' name='key' value='" + key + "'>"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
@import "variables";
|
2
|
+
|
3
|
+
.spinner {
|
4
|
+
width: 30px;
|
5
|
+
height: 30px;
|
6
|
+
background-color: $lighter_grey;
|
7
|
+
|
8
|
+
margin: 100px auto;
|
9
|
+
-webkit-animation: rotateplane 1.2s infinite ease-in-out;
|
10
|
+
animation: rotateplane 1.2s infinite ease-in-out;
|
11
|
+
}
|
12
|
+
|
13
|
+
@-webkit-keyframes rotateplane {
|
14
|
+
0% {
|
15
|
+
-webkit-transform: perspective(120px)
|
16
|
+
}
|
17
|
+
50% {
|
18
|
+
-webkit-transform: perspective(120px) rotateY(180deg)
|
19
|
+
}
|
20
|
+
100% {
|
21
|
+
-webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg)
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
@keyframes rotateplane {
|
26
|
+
0% {
|
27
|
+
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
|
28
|
+
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg)
|
29
|
+
}
|
30
|
+
50% {
|
31
|
+
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
|
32
|
+
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg)
|
33
|
+
}
|
34
|
+
100% {
|
35
|
+
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
|
36
|
+
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
|
37
|
+
}
|
38
|
+
}
|
@@ -9,14 +9,139 @@
|
|
9
9
|
* compiled file, but it's generally better to create a new file per style scope.
|
10
10
|
*
|
11
11
|
*= require_self
|
12
|
-
*= require_tree .
|
13
12
|
*= require bootstrap
|
13
|
+
*= require_tree .
|
14
14
|
*/
|
15
15
|
|
16
|
+
@import 'variables';
|
17
|
+
|
18
|
+
$headerheight: 70px;
|
19
|
+
|
20
|
+
html, body {
|
21
|
+
height: 100%;
|
22
|
+
.wrapper {
|
23
|
+
min-height: calc(100vh - #{$headerheight});
|
24
|
+
height: 100%;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
16
28
|
body {
|
17
|
-
padding-top:
|
29
|
+
padding-top: $headerheight;
|
30
|
+
}
|
31
|
+
|
32
|
+
.translation_missing_container .row {
|
33
|
+
padding: 1rem 0;
|
34
|
+
border-bottom: 1px solid #e5e5e5;
|
35
|
+
}
|
36
|
+
|
37
|
+
.editor_container {
|
38
|
+
.ace_editor {
|
39
|
+
overflow: hidden;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
$border-color: $lightest_grey;
|
44
|
+
$titleheight: 70px;
|
45
|
+
$translation_container_offset: $titleheight+$headerheight;
|
46
|
+
|
47
|
+
div.translation_title {
|
48
|
+
height: $titleheight;
|
49
|
+
}
|
50
|
+
div.translation_container {
|
51
|
+
border-top: 1px solid $border-color;
|
52
|
+
min-height: calc(100vh - #{$translation_container_offset});
|
53
|
+
div.translation_list {
|
54
|
+
border-right: 1px solid $border-color;
|
55
|
+
padding-right: 0;
|
56
|
+
padding-left: 0;
|
57
|
+
min-height: calc(100vh - #{$translation_container_offset+1});
|
58
|
+
div.translation_filter {
|
59
|
+
padding: 1rem;
|
60
|
+
background-color: $white_grey;
|
61
|
+
border-bottom: 1px solid $border-color;
|
62
|
+
input[type="text"] {
|
63
|
+
}
|
64
|
+
}
|
65
|
+
div.translation_item {
|
66
|
+
padding: 2rem;
|
67
|
+
cursor: pointer;
|
68
|
+
&.active {
|
69
|
+
background-color: #4183C4;
|
70
|
+
}
|
71
|
+
&:nth-child(even) {
|
72
|
+
background-color: $white_grey;
|
73
|
+
}
|
74
|
+
&:hover:not(.active) {
|
75
|
+
background-color: $lighter_grey;
|
76
|
+
}
|
77
|
+
|
78
|
+
border-bottom: 1px solid $border-color;
|
79
|
+
|
80
|
+
.translation_filename {
|
81
|
+
direction: rtl;
|
82
|
+
overflow: hidden;
|
83
|
+
text-overflow: ellipsis;
|
84
|
+
unicode-bidi: bidi-override;
|
85
|
+
font-style: italic;
|
86
|
+
}
|
87
|
+
|
88
|
+
&.active {
|
89
|
+
background-color: #6B9ED1;
|
90
|
+
color: white;
|
91
|
+
position: relative;
|
92
|
+
|
93
|
+
&:after, &:before {
|
94
|
+
left: 100%;
|
95
|
+
top: 50%;
|
96
|
+
border: solid transparent;
|
97
|
+
content: " ";
|
98
|
+
height: 0;
|
99
|
+
width: 0;
|
100
|
+
position: absolute;
|
101
|
+
pointer-events: none;
|
102
|
+
}
|
103
|
+
|
104
|
+
&:after {
|
105
|
+
border-color: rgba(65, 131, 196, 0);
|
106
|
+
border-left-color: #6B9ED1;
|
107
|
+
border-width: 10px;
|
108
|
+
margin-top: -10px;
|
109
|
+
}
|
110
|
+
&:before {
|
111
|
+
border-color: rgba(65, 131, 196, 0);
|
112
|
+
border-left-color: $border-color;
|
113
|
+
border-width: 11px;
|
114
|
+
margin-top: -11px;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
div.translation_edit_container {
|
121
|
+
position: relative;
|
122
|
+
padding-top: 5rem;
|
123
|
+
padding-bottom: 5rem;
|
124
|
+
textarea {
|
125
|
+
height: 10rem;
|
126
|
+
resize: none;
|
127
|
+
width: 100%;
|
128
|
+
padding: 20px;
|
129
|
+
border: 0;
|
130
|
+
border-top: 1px solid $border-color;
|
131
|
+
border-bottom: 1px solid $border-color;
|
132
|
+
background: #fff;
|
133
|
+
color: #999999;
|
134
|
+
font-size: 21px;
|
135
|
+
line-height: 1.6em;
|
136
|
+
resize: none;
|
137
|
+
-moz-transition: color 0.15s ease-in 0;
|
138
|
+
-webkit-transition: color 0.15s ease-in 0;
|
139
|
+
transition: color 0.15s ease-in 0;
|
140
|
+
box-shadow: none;
|
141
|
+
}
|
142
|
+
button {
|
143
|
+
margin-top: 1rem;
|
144
|
+
}
|
145
|
+
}
|
18
146
|
}
|
19
147
|
|
20
|
-
.translation_missing_container .row{
|
21
|
-
margin-top: 5px;
|
22
|
-
}
|
@@ -25,11 +25,16 @@ module I18nAdminUtils
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
def show
|
29
|
+
unless params[:translation].nil?
|
30
|
+
render :partial => 'show', :locals => {:translation => params[:translation]}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
28
34
|
#Return a list of all the missing translation
|
29
35
|
def missing_list
|
30
|
-
|
31
|
-
|
32
|
-
render :partial => 'missing_list', :layouts => false, :locals=> {:translation => translation}
|
36
|
+
translations = I18nAdminUtils::SearchTranslation.search
|
37
|
+
render :partial => 'missing_list', :layouts => false, :locals => {:translations => translations}
|
33
38
|
end
|
34
39
|
|
35
40
|
def i18n_redirect(message, success = true)
|
@@ -1,74 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<% translations.each do |translation| %>
|
2
|
+
<div class="translation_item" data-translation='<%= translation.to_json %>'
|
3
|
+
data-locale='<%= translation[:locale] %>'
|
4
|
+
data-key='<%= translation[:key] %>'
|
5
|
+
data-filename='<%= translation[:filename] %>'>
|
6
|
+
<div class="row">
|
7
|
+
<div class="col-md-1">
|
8
|
+
<%= translation[:locale] %>
|
9
|
+
</div>
|
10
|
+
<div class="col-md-5">
|
11
|
+
<%= translation[:key] %>
|
12
|
+
</div>
|
13
|
+
<div class="col-md-6 ">
|
14
|
+
<div class="translation_filename">
|
15
|
+
<%= translation[:filename].reverse %>
|
16
|
+
</div>
|
17
|
+
</div>
|
6
18
|
</div>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
7
25
|
|
8
|
-
<div class='col-md-2'>
|
9
|
-
<strong> Key</strong>
|
10
|
-
</div>
|
11
26
|
|
12
|
-
<div class='col-md-8'>
|
13
|
-
<strong>Translation</strong>
|
14
|
-
</div>
|
15
27
|
|
16
|
-
<div class='col-md-1'>
|
17
|
-
<div class='pull-right'>
|
18
|
-
<strong> Submit</strong>
|
19
|
-
</div>
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
<% translation.each do |translation| %>
|
23
|
-
<div class='row' data-locale='<%= translation[:locale] %>' data-key='<%= translation[:key] %>'>
|
24
|
-
<%= form_tag translation_edit_path, :class => 'translation_helper' do %>
|
25
|
-
<div class='col-md-1'>
|
26
|
-
<%= translation[:locale] %>
|
27
|
-
</div>
|
28
|
-
<div class='col-md-2'>
|
29
|
-
<%= translation[:key] %>
|
30
|
-
</div>
|
31
|
-
<%= hidden_field_tag :locale, translation[:locale] %>
|
32
|
-
<%= hidden_field_tag :key, translation[:key] %>
|
33
|
-
<div class='col-md-8'>
|
34
|
-
<div class='input-group'>
|
35
|
-
<%= text_field_tag :value, '', :class => 'form-control', 'data-update' => 'value_ta' %>
|
36
|
-
<% id = "#{translation[:locale]}_#{translation[:key]}".gsub(/\./, '_') %>
|
37
|
-
<span class="input-group-btn">
|
38
|
-
<button class='btn btn-default nosubmit' title='Click to open larger edit box' rel='tooltip' data-toggle="modal" data-target="#<%= id %>">
|
39
|
-
<span class='glyphicon glyphicon-edit'></span>
|
40
|
-
</button>
|
41
|
-
</span>
|
42
|
-
</div>
|
43
|
-
<div>
|
44
|
-
<div class="modal fade" id="<%= id %>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
45
|
-
<div class="modal-dialog">
|
46
|
-
<div class="modal-content">
|
47
|
-
<div class="modal-header">
|
48
|
-
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
49
|
-
<h4 class="modal-title" id="myModalLabel">Input translation</h4>
|
50
|
-
</div>
|
51
|
-
<div class="modal-body">
|
52
|
-
<%= text_area_tag :value_ta, '', :class => 'form-control', 'data-update' => 'value' %>
|
53
|
-
</div>
|
54
|
-
<div class="modal-footer">
|
55
|
-
<button type="button" class="btn btn-default nosubmit" data-dismiss="modal">Ok</button>
|
56
|
-
</div>
|
57
|
-
</div>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
<div class='col-md-1'>
|
63
|
-
<div class='pull-right'>
|
64
|
-
<button class='btn btn-primary'>
|
65
|
-
Add
|
66
|
-
</button>
|
67
|
-
</div>
|
68
|
-
</div>
|
69
|
-
<% end %>
|
70
|
-
</div>
|
71
|
-
<% end %>
|
72
28
|
|
73
|
-
</div>
|
74
|
-
</div>
|