lit 0.3.3 → 0.4.0.pre.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -6
  3. data/app/assets/javascripts/lit/lit_frontend.js +20 -12
  4. data/app/assets/stylesheets/lit/application.css +3 -0
  5. data/app/controllers/lit/api/v1/base_controller.rb +1 -1
  6. data/app/controllers/lit/api/v1/locales_controller.rb +1 -1
  7. data/app/controllers/lit/api/v1/localization_keys_controller.rb +12 -4
  8. data/app/controllers/lit/api/v1/localizations_controller.rb +25 -9
  9. data/app/controllers/lit/application_controller.rb +11 -8
  10. data/app/controllers/lit/concerns/request_info_store.rb +1 -0
  11. data/app/controllers/lit/incomming_localizations_controller.rb +22 -15
  12. data/app/controllers/lit/locales_controller.rb +1 -1
  13. data/app/controllers/lit/localization_keys_controller.rb +44 -18
  14. data/app/controllers/lit/localizations_controller.rb +16 -11
  15. data/app/controllers/lit/sources_controller.rb +9 -13
  16. data/app/helpers/lit/frontend_helper.rb +28 -16
  17. data/app/helpers/lit/localizations_helper.rb +2 -1
  18. data/app/jobs/lit/synchronize_source_job.rb +1 -1
  19. data/app/models/lit/incomming_localization.rb +71 -41
  20. data/app/models/lit/locale.rb +11 -13
  21. data/app/models/lit/localization.rb +26 -24
  22. data/app/models/lit/localization_key.rb +46 -55
  23. data/app/models/lit/source.rb +17 -74
  24. data/app/queries/localization_key_search_query.rb +80 -0
  25. data/app/services/remote_interactor_service.rb +45 -0
  26. data/app/services/synchronize_source_service.rb +63 -0
  27. data/app/views/kaminari/lit/_gap.html.erb +1 -1
  28. data/app/views/layouts/lit/_navigation.html.erb +1 -1
  29. data/app/views/lit/dashboard/index.html.erb +2 -2
  30. data/app/views/lit/incomming_localizations/index.html.erb +10 -6
  31. data/app/views/lit/localization_keys/_localization_row.html.erb +1 -1
  32. data/app/views/lit/localization_keys/_localizations_list.html.erb +84 -0
  33. data/app/views/lit/localization_keys/_sidebar.html.erb +66 -0
  34. data/app/views/lit/localization_keys/change_completed.js.erb +2 -0
  35. data/app/views/lit/localization_keys/index.html.erb +3 -121
  36. data/app/views/lit/localization_keys/not_translated.html.erb +9 -0
  37. data/app/views/lit/localization_keys/restore_deleted.js.erb +1 -0
  38. data/app/views/lit/localization_keys/visited_again.html.erb +9 -0
  39. data/app/views/lit/localizations/_previous_versions_rows.html.erb +2 -2
  40. data/app/views/lit/localizations/change_completed.js.erb +2 -0
  41. data/app/views/lit/localizations/update.js.erb +2 -0
  42. data/app/views/lit/sources/_form.html.erb +1 -1
  43. data/app/views/lit/sources/index.html.erb +1 -1
  44. data/config/routes.rb +5 -0
  45. data/db/migrate/20181017123839_lit_add_is_deleted_to_localization_keys.rb +8 -0
  46. data/db/migrate/20181018075955_lit_add_localization_key_is_deleted_to_localization_keys.rb +8 -0
  47. data/db/migrate/20181030111522_lit_add_is_visited_again_to_localization_keys.rb +8 -0
  48. data/lib/generators/lit/install/templates/initializer.rb +5 -1
  49. data/lib/lit.rb +1 -0
  50. data/lib/lit/adapters/redis_storage.rb +1 -1
  51. data/lib/lit/cache.rb +32 -54
  52. data/lib/lit/export.rb +80 -0
  53. data/lib/lit/i18n_backend.rb +12 -9
  54. data/lib/lit/import.rb +179 -0
  55. data/lib/lit/loader.rb +2 -0
  56. data/lib/lit/version.rb +1 -1
  57. data/lib/tasks/lit_tasks.rake +78 -13
  58. metadata +21 -6
@@ -1,3 +1,3 @@
1
1
  <li class="page gap disabled">
2
- <a href="#" onclick="return false;"><%= raw t('views.pagination.truncate') %></a>
2
+ <a href="#" onclick="return false;"><%= raw I18n.t('views.pagination.truncate') %></a>
3
3
  </li>
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
11
11
  <ul class="nav navbar-nav">
12
- <li><%= link_to "Translate!", lit.localization_keys_path %></li>
12
+ <li><%= link_to "Translate!", lit.not_translated_localization_keys_path %></li>
13
13
  <li><%= link_to "Synchronize", lit.sources_path %></li>
14
14
  <li class="dropdown">
15
15
  <a href="#" class="dropdown-toggle" data-toggle="dropdown">
@@ -1,5 +1,5 @@
1
- <strong>All localization keys</strong> <%= Lit::LocalizationKey.count(:id) %><br/>
1
+ <strong>All localization keys</strong> <%= Lit::LocalizationKey.active.count(:id) %><br/>
2
2
  <% @locales.each do |l| %>
3
- <strong><%= image_tag "lit/famfamfam_flags/#{l.locale[0,2]}.png" %> <%= t("lit.locale_to_languages.#{l.locale}", :default=>l.locale) %>:</strong> <span title="<%= "#{l.get_changed_localizations_count}/#{l.get_all_localizations_count}" %>"><%= l.get_translated_percentage %>%</span><br/>
3
+ <strong><%= image_tag "lit/famfamfam_flags/#{l.locale[0,2]}.png" %> <%= I18n.t("lit.locale_to_languages.#{l.locale}", :default=>l.locale) %>:</strong> <span title="<%= "#{l.changed_localizations_count}/#{l.all_localizations_count}" %>"><%= l.translated_percentage %>%</span><br/>
4
4
  <% end %>
5
5
 
@@ -5,10 +5,10 @@
5
5
  <h4 class="<%= source_loading_class(@source) %>">Synchronization in progress, please wait. The page will refresh automatically when done.</h2>
6
6
  <span class="pull-right">
7
7
  <%= link_to accept_all_source_incomming_localizations_path(@source), :class=>"btn btn-success btn-sm", :data=>{:confirm=>t('lit.common.you_sure', :default=>"Are you sure?")} do %>
8
- <%= t('lit.common.accept_all', :default=>"Accept all") %>
8
+ <%= I18n.t('lit.common.accept_all', :default=>"Accept all") %>
9
9
  <% end %>
10
10
  <%= link_to reject_all_source_incomming_localizations_path(@source), :class=>"btn btn-danger btn-sm", :method=>:post, :data=>{:confirm=>t('lit.common.you_sure', :default=>"Are you sure?")} do %>
11
- <%= t('lit.common.reject_all', :default=>"Reject all") %>
11
+ <%= I18n.t('lit.common.reject_all', :default=>"Reject all") %>
12
12
  <% end %>
13
13
  </span>
14
14
  </div>
@@ -19,6 +19,7 @@
19
19
  <tr>
20
20
  <th>Current value</th>
21
21
  <th>Imported value</th>
22
+ <th>Is deleted</th>
22
23
  <th width="200px"></th>
23
24
  </tr>
24
25
  <% @incomming_localizations.each do |il| %>
@@ -31,16 +32,19 @@
31
32
  <tr data-id="<%= il.id %>">
32
33
  <td>
33
34
  <% if il.localization %>
34
- <%= render partial: '/lit/localization_keys/localization_row', locals: {localization: il.localization.get_value} %>
35
+ <%= render partial: '/lit/localization_keys/localization_row', locals: {localization: il.localization.translation} %>
35
36
  <% end %>
36
37
  </td>
37
- <Td>
38
- <%= render partial: '/lit/localization_keys/localization_row', locals: {localization: il.get_value} %>
38
+ <td>
39
+ <%= render partial: '/lit/localization_keys/localization_row', locals: {localization: il.translation} %>
40
+ </td>
41
+ <td>
42
+ <%= il.localization_key_is_deleted %>
39
43
  </td>
40
44
  <td>
41
45
  <%= link_to accept_source_incomming_localization_path(@source, il, format: :js), class: 'btn btn-success btn-sm', remote: true do %>
42
46
  <%= draw_icon 'check', class: 'icon-white' %>
43
- <%= t('lit.common.accept', default: 'Accept') %>
47
+ <%= I18n.t('lit.common.accept', default: 'Accept') %>
44
48
  <% end %>
45
49
  <%= link_to source_incomming_localization_path(@source, il, format: :js), class: 'btn btn-danger btn-sm', remote: true, method: :delete, data: {confirm: I18n.t('lit.common.you_sure', default: 'Are you sure?')} do %>
46
50
  <%= draw_icon 'times', class: "icon-white" %>
@@ -6,7 +6,7 @@
6
6
  </ul>
7
7
  <% else %>
8
8
  <% if localization.nil? %>
9
- <em title="<%= I18n.t('.value_not_yet_translated', default: 'Value not yet translated') %>">null</em>
9
+ <em title="<%= I18n.t('lit.value_not_yet_translated', default: 'Value not yet translated') %>">null</em>
10
10
  <% else %>
11
11
  <%= localization %>
12
12
  <% end %>
@@ -0,0 +1,84 @@
1
+ <table class="table">
2
+ <%- @localization_keys.each do |lk| %>
3
+ <tr class="localization_key_row" data-id="<%= lk.id %>">
4
+ <td>
5
+ <strong><%= lk.localization_key %></strong>
6
+ <span class="badge"><%= Lit.init.cache.get_global_hits_counter(lk.localization_key) %></span>
7
+ <div class="localization_keys_options">
8
+ <% if Lit.store_request_info %>
9
+ <%= link_to '#', class: 'request_info_link title', title: 'Show / hide request' do %>
10
+ <%= draw_icon 'link' %>
11
+ <% end %>
12
+ <% end %>
13
+ <% if lk.is_deleted? %>
14
+ <%= link_to lit.restore_deleted_localization_key_path(lk), method: :put, remote: true, class: 'rotate_left_icon title', title: 'Restore translation key' do %>
15
+ <%= draw_icon 'rotate-left' %>
16
+ <% end %>
17
+ <% end %>
18
+ <% unless lk.is_deleted? %>
19
+ <%= link_to lit.change_completed_localization_key_path(lk), method: :put, remote: true, class: 'check_icon title', title: 'Complete / incomplete translation key' do %>
20
+ <%= draw_icon lk.is_starred? ? 'check-circle' : 'check-circle-o' %>
21
+ <% end %>
22
+ <%= link_to lit.star_localization_key_path(lk), remote: true, class: 'star_icon title', title: 'Star / unstar translation key' do %>
23
+ <%= draw_icon lk.is_starred? ? 'star' : 'star-o' %>
24
+ <% end %>
25
+ <%= link_to lit.localization_key_path(lk), method: :delete, data: {confirm: I18n.t('lit.common.you_sure', default: "Are you sure?")}, remote: true, title: 'Delete translation key', class: 'title' do %>
26
+ <%= draw_icon 'trash-o' %>
27
+ <% end %>
28
+ <% end %>
29
+ </div>
30
+ <div class="detail_wrapper">
31
+ <table class="table table-bordered table-striped">
32
+ <tr>
33
+ <th class="col-md-8">Translation</th>
34
+ <th class="col-md-2 text-center">Locale</th>
35
+ <% unless lk.is_deleted? %>
36
+ <th class="col-md-2 text-center">Completed</th>
37
+ <% end %>
38
+ </tr>
39
+ <%- available_locales.each do |locale| %>
40
+ <%- localization = localization_for(locale, lk) %>
41
+ <tr>
42
+ <td class="localization_row" data-id="<%= localization.id%>" data-edit="<%= edit_localization_key_localization_path(lk, localization, format: :js) %>" data-editing=0 data-content="">
43
+ <%= render partial: 'localization_row', locals: {localization: Lit.init.cache["#{locale}.#{lk.localization_key}"]} %>
44
+ </td>
45
+ <td class="locale_row text-center">
46
+ <%= image_tag "lit/famfamfam_flags/#{locale[0,2]}.png" %>
47
+ <%= locale %>
48
+ <% if localization %>
49
+ <%= link_to lit.previous_versions_localization_key_localization_path(lk, localization, format: :js), class: "show_prev_versions #{'hidden' unless versions?(localization)}", remote: true do %>
50
+ <%= draw_icon 'random', title: I18n.t('lit.common.previous_versions', default: 'Previous versions') %>
51
+ <% end %>
52
+ <% end %>
53
+ </td>
54
+ <% unless lk.is_deleted? %>
55
+ <td class="text-center">
56
+ <%= link_to lit.change_completed_localization_key_localization_path(lk, localization), method: :put, remote: true, class: "change_completed_#{localization.id}" do |f| %>
57
+ <%= check_box_tag :is_changed, localization.is_changed, localization.is_changed %>
58
+ <% end %>
59
+ </td>
60
+ <% end %>
61
+ </tr>
62
+ <tr class="hidden localization_versions_row" data-id="<%= localization.id %>">
63
+ <td colspan="2" class="localization_versions"></td>
64
+ </tr>
65
+ <% end %>
66
+ <% if Lit.store_request_info %>
67
+ <tr class="hidden request_info_row">
68
+ <td colspan="2">
69
+ <strong>Translation key recently displayed on following pages:</strong>
70
+ <ul>
71
+ <% Lit.init.cache.get_request_info(lk.localization_key).split(' ').reverse.each do |l| %>
72
+ <li><%= link_to l, l %></li>
73
+ <% end %>
74
+ </ul>
75
+ <em>Note: you might not have access to those pages!</em>
76
+ </td>
77
+ </tr>
78
+ <% end %>
79
+ </table>
80
+ </div>
81
+ </td>
82
+ </tr>
83
+ <% end %>
84
+ </table>
@@ -0,0 +1,66 @@
1
+ <% content_for(:sidebar) do %>
2
+ <div class="well">
3
+ <%= form_tag '', :class=>"form-search", :method=>:get do |f| %>
4
+ <% if @search_options.has_key?(:key_prefix) %>
5
+ <%= hidden_field_tag :key_prefix, @search_options[:key_prefix] %>
6
+ <% end %>
7
+ <div class="input-group">
8
+ <%= text_field_tag :key, @search_options[:key], :class=>"form-control search-query" %>
9
+ <div class="input-group-btn">
10
+ <button type="submit" class="btn btn-default"><%= draw_icon 'search' %></button>
11
+ </div>
12
+ </div>
13
+ <% end %>
14
+ <ul class="nav nav-pills nav-stacked">
15
+ <li class="<%= "active" if params[:action]=='not_translated' %>">
16
+ <%= link_to lit.not_translated_localization_keys_path do -%>
17
+ <%= draw_icon 'pencil' %>
18
+ not translated
19
+ <% end %>
20
+ </li>
21
+ <li class="<%= "active" if params[:action]=='index' %>">
22
+ <%= link_to lit.localization_keys_path do -%>
23
+ <%= draw_icon 'list' %>
24
+ all
25
+ <% end %>
26
+ </li>
27
+ <li class="<%= "active" if params[:action]=='starred' %>">
28
+ <%= link_to lit.starred_localization_keys_path do -%>
29
+ <%= draw_icon 'star' %>
30
+ starred
31
+ <% end %>
32
+ </li>
33
+ <li class="<%= "active" if params[:action]=='visited_again' %>">
34
+ <%= link_to lit.visited_again_localization_keys_path do -%>
35
+ <%= draw_icon 'undo' %>
36
+ deleted and visited again
37
+ <% end %>
38
+ </li>
39
+ <li class="nav-header"><%= I18n.t(".order_by", :default => "Order by") %>:</li>
40
+ <% Lit::LocalizationKey.order_options.each do |order| %>
41
+ <li class="<%= "active" if order == @search_options[:order] %>">
42
+ <%= link_to url_for(@search_options.merge(:order => order)) do %>
43
+ <%= I18n.t("lit.order_options.#{order.gsub(" ", "_")}", :default => order.humanize) %>
44
+ <% end %>
45
+ </li>
46
+ <% end %>
47
+ <li class="nav-header">Narrow with prefix</li>
48
+ <% if @search_options[:key_prefix].present? %>
49
+ <li>
50
+ <%= link_to url_for(@search_options.merge(:key_prefix=>@parent_prefix.present? ? @parent_prefix : nil)), :title=>(@parent_prefix.present? ? @parent_prefix : 'show all') do %>
51
+ <%= draw_icon('chevron-left') %>
52
+ <%= @parent_prefix.present? ? @parent_prefix.split('.').last : 'show all' %>
53
+ <% end %>
54
+ </li>
55
+ <% end %>
56
+ <% @prefixes.each do |p| %>
57
+ <li class="key_prefix">
58
+ <%= link_to url_for(@search_options.merge(:key_prefix=>p)) do %>
59
+ <%= draw_icon('chevron-right') %>
60
+ <%= p.split('.').last %>
61
+ <% end %>
62
+ </li>
63
+ <% end %>
64
+ </ul>
65
+ </div>
66
+ <% end %>
@@ -0,0 +1,2 @@
1
+ $('tr.localization_key_row[data-id="<%= @localization_key.id %>"] a.check_icon').html("<%= ejs(draw_icon(@localization_key.is_completed? ? 'check-circle' : 'check-circle-o')) %>");
2
+ $('tr.localization_key_row[data-id="<%= @localization_key.id %>"] input[type=checkbox]').prop("checked", <%= @localization_key.is_completed? %>);
@@ -1,127 +1,9 @@
1
- <h3><%= I18n.t('.header', default: 'Localization keys') %></h3>
2
- <% available_locales = I18n.backend.available_locales %>
1
+ <h3><%= I18n.t('lit.header', default: 'Localization keys') %></h3>
3
2
 
4
- <table class="table">
5
- <%- @localization_keys.each do |lk| %>
6
- <tr class="localization_key_row" data-id="<%= lk.id %>">
7
- <td>
8
- <strong><%= lk.localization_key %></strong>
9
- <span class="badge"><%= Lit.init.cache.get_global_hits_counter(lk.localization_key) %></span>
10
- <div class="localization_keys_options">
11
- <% if Lit.store_request_info %>
12
- <%= link_to '#', class: 'request_info_link title', title: 'Show / hide request' do %>
13
- <%= draw_icon 'link' %>
14
- <% end %>
15
- <% end %>
16
- <%= link_to lit.star_localization_key_path(lk), remote: true, class: 'star_icon title', title: 'Star / unstar translation key' do %>
17
- <%= draw_icon lk.is_starred? ? 'star' : 'star-o' %>
18
- <% end %>
19
- <%= link_to lit.localization_key_path(lk), method: :delete, data: {confirm: t('lit.common.you_sure', default: "Are you sure?")}, remote: true, title: 'Delete translation key', class: 'title' do %>
20
- <%= draw_icon 'trash-o' %>
21
- <% end %>
22
- </div>
23
- <div class="detail_wrapper">
24
- <table class="table table-bordered table-striped">
25
- <%- available_locales.each do |locale| %>
26
- <%- localization = localization_for(locale, lk) %>
27
- <tr>
28
- <td class="localization_row" data-id="<%= localization.id%>" data-edit="<%= edit_localization_key_localization_path(lk, localization, format: :js) %>" data-editing=0 data-content="">
29
- <%= render partial: 'localization_row', locals: {localization: Lit.init.cache["#{locale}.#{lk.localization_key}"]} %>
30
- </td>
31
- <td class="locale_row">
32
- <%= image_tag "lit/famfamfam_flags/#{locale[0,2]}.png" %>
33
- <%= locale %>
34
- <% if localization %>
35
- <%= link_to lit.previous_versions_localization_key_localization_path(lk, localization, format: :js), class: "show_prev_versions #{'hidden' unless has_versions?(localization)}", remote: true do %>
36
- <%= draw_icon 'random', title: I18n.t('lit.common.previous_versions', default: 'Previous versions') %>
37
- <% end %>
38
- <% end %>
39
- </td>
40
- </tr>
41
- <tr class="hidden localization_versions_row" data-id="<%= localization.id %>">
42
- <td colspan="2" class="localization_versions"></td>
43
- </tr>
44
- <% end %>
45
- <% if Lit.store_request_info %>
46
- <tr class="hidden request_info_row">
47
- <td colspan="2">
48
- <strong>Translation key recently displayed on following pages:</strong>
49
- <ul>
50
- <% Lit.init.cache.get_request_info(lk.localization_key).split(' ').reverse.each do |l| %>
51
- <li><%= link_to l, l %></li>
52
- <% end %>
53
- </ul>
54
- <em>Note: you might not have access to those pages!</em>
55
- </td>
56
- </tr>
57
- <% end %>
58
- </table>
59
- </div>
60
- </td>
61
- </tr>
62
- <% end %>
3
+ <%= render 'localizations_list', available_locales: I18n.backend.available_locales %>
63
4
 
64
- </table>
65
5
  <% if defined?(Kaminari) %>
66
6
  <%= paginate @localization_keys, :theme=>"lit" %>
67
7
  <% end %>
68
8
 
69
-
70
- <% content_for(:sidebar) do %>
71
- <div class="well">
72
- <%= form_tag '', :class=>"form-search", :method=>:get do |f| %>
73
- <% if @search_options.has_key?(:key_prefix) %>
74
- <%= hidden_field_tag :key_prefix, @search_options[:key_prefix] %>
75
- <% end %>
76
- <div class="input-group">
77
- <%= text_field_tag :key, @search_options[:key], :class=>"form-control search-query" %>
78
- <div class="input-group-btn">
79
- <button type="submit" class="btn btn-default"><%= draw_icon 'search' %></button>
80
- </div>
81
- </div>
82
- <label class="checkbox">
83
- <%= check_box_tag :include_completed, '1', @search_options[:include_completed].to_i==1 %>
84
- <%= t('.is_completed', :default=>"Include completed") %>
85
- </label>
86
- <% end %>
87
- <ul class="nav nav-pills nav-stacked">
88
- <li class="<%= "active" if params[:action]=='index' %>">
89
- <%= link_to lit.localization_keys_path do -%>
90
- <%= draw_icon 'list' %>
91
- all
92
- <% end %>
93
- </li>
94
- <li class="<%= "active" if params[:action]=='starred' %>">
95
- <%= link_to lit.starred_localization_keys_path do -%>
96
- <%= draw_icon 'star' %>
97
- starred
98
- <% end %>
99
- </li>
100
- <li class="nav-header"><%= t(".order_by", :default => "Order by") %>:</li>
101
- <% Lit::LocalizationKey.order_options.each do |order| %>
102
- <li class="<%= "active" if order == @search_options[:order] %>">
103
- <%= link_to url_for(@search_options.merge(:order => order)) do %>
104
- <%= t("lit.order_options.#{order.gsub(" ", "_")}", :default => order.humanize) %>
105
- <% end %>
106
- </li>
107
- <% end %>
108
- <li class="nav-header">Narrow with prefix</li>
109
- <% if @search_options[:key_prefix].present? %>
110
- <li>
111
- <%= link_to url_for(@search_options.merge(:key_prefix=>@parent_prefix.present? ? @parent_prefix : nil)), :title=>(@parent_prefix.present? ? @parent_prefix : 'show all') do %>
112
- <%= draw_icon('chevron-left') %>
113
- <%= @parent_prefix.present? ? @parent_prefix.split('.').last : 'show all' %>
114
- <% end %>
115
- </li>
116
- <% end %>
117
- <% @prefixes.each do |p| %>
118
- <li class="key_prefix">
119
- <%= link_to url_for(@search_options.merge(:key_prefix=>p)) do %>
120
- <%= draw_icon('chevron-right') %>
121
- <%= p.split('.').last %>
122
- <% end %>
123
- </li>
124
- <% end %>
125
- </ul>
126
- </div>
127
- <% end %>
9
+ <%= render 'sidebar' %>
@@ -0,0 +1,9 @@
1
+ <h3><%= I18n.t('lit.not_translated_header', default: 'Not translated localization keys') %></h3>
2
+
3
+ <%= render 'localizations_list', available_locales: I18n.backend.available_locales %>
4
+
5
+ <% if defined?(Kaminari) %>
6
+ <%= paginate @localization_keys, :theme=>"lit" %>
7
+ <% end %>
8
+
9
+ <%= render 'sidebar' %>
@@ -0,0 +1 @@
1
+ $('tr.localization_key_row[data-id="<%= @localization_key.id %>"]').fadeOut();
@@ -0,0 +1,9 @@
1
+ <h3><%= I18n.t('lit.visited_again_header', default: 'Deleted and visited again localization keys') %></h3>
2
+
3
+ <%= render 'localizations_list', available_locales: I18n.backend.available_locales %>
4
+
5
+ <% if defined?(Kaminari) %>
6
+ <%= paginate @localization_keys, :theme=>"lit" %>
7
+ <% end %>
8
+
9
+ <%= render 'sidebar' %>
@@ -1,8 +1,8 @@
1
1
  <span class="pull-right"><%= draw_icon 'times', :class=>"close_versions" %></span>
2
2
  <table class="table table-condensed">
3
3
  <tr>
4
- <th><%= t('lit.common.previous_versions') %></th>
5
- <th width="25%"><%= t('lit.common.changed_at') %></th>
4
+ <th><%= I18n.t('lit.common.previous_versions') %></th>
5
+ <th width="25%"><%= I18n.t('lit.common.changed_at') %></th>
6
6
  </tr>
7
7
  <% @versions.each do |v| %>
8
8
  <tr>
@@ -0,0 +1,2 @@
1
+ var input = $('a.change_completed_<%= @localization.id %> input[type=checkbox]');
2
+ input.prop("checked", !input.prop("checked"));
@@ -2,3 +2,5 @@ var $row = $('td.localization_row[data-id="<%= @localization.id %>"]');
2
2
  $row.data('editing', 0);
3
3
  $row.html("<%= ejs render(:partial=>"/lit/localization_keys/localization_row", formats: ['html'], :locals=>{:localization=>@localization.translated_value }) %>");
4
4
  $row.siblings().find('.show_prev_versions').removeClass('hidden');
5
+ $('a.change_completed_<%= @localization.id %> input[type=checkbox]').prop("checked", true);
6
+
@@ -30,6 +30,6 @@
30
30
  </div>
31
31
 
32
32
  <div class="actions">
33
- <%= f.submit t('lit.common.save', :default => "Save"), :class=>"btn btn-primary btn-sm" %>
33
+ <%= f.submit I18n.t('lit.common.save', :default => "Save"), :class=>"btn btn-primary btn-sm" %>
34
34
  </div>
35
35
  <% end %>
@@ -12,7 +12,7 @@
12
12
  <tr>
13
13
  <td><%= link_to source.identifier, lit.source_path(source) %></td>
14
14
  <td><%= source.last_updated_at.to_s(:db) unless source.last_updated_at.nil? %></td>
15
- <td><%= source.get_last_change %></td>
15
+ <td><%= source.last_change %></td>
16
16
  <td>
17
17
  <%= link_to lit.source_incomming_localizations_path(source), :title=>t('lit.common.browse_incomming', :default=>"Browse incomming localizations") do %>
18
18
  <%= draw_icon 'search' %>
data/config/routes.rb CHANGED
@@ -17,13 +17,18 @@ Lit::Engine.routes.draw do
17
17
  resources :localization_keys, only: [:index, :destroy] do
18
18
  member do
19
19
  get :star
20
+ put :change_completed
21
+ put :restore_deleted
20
22
  end
21
23
  collection do
22
24
  get :starred
23
25
  get :find_localization
26
+ get :not_translated
27
+ get :visited_again
24
28
  end
25
29
  resources :localizations, only: [:edit, :update, :show] do
26
30
  member do
31
+ put :change_completed
27
32
  get :previous_versions
28
33
  end
29
34
  end