translation_center 1.5.6 → 1.5.7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/translation_center/center_controller.rb +7 -6
- data/app/models/translation_center/translation.rb +2 -0
- data/app/views/translation_center/center/_activity.html.haml +4 -4
- data/app/views/translation_center/center/dashboard.html.haml +1 -1
- data/lib/translation_center/engine.rb +2 -1
- data/lib/translation_center/version.rb +1 -1
- data/test/dummy/log/development.log +27635 -0
- data/test/dummy/tmp/pids/server.pid +1 -1
- metadata +2 -2
@@ -23,15 +23,15 @@ module TranslationCenter
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def dashboard
|
26
|
+
params[:page] ||= 1
|
27
|
+
@page = params[:page].to_i
|
26
28
|
@stats = TranslationKey.langs_stats
|
27
29
|
@langs = @stats.keys
|
28
30
|
# to be used for meta search
|
29
31
|
@search = Audited::Adapters::ActiveRecord::Audit.search(params[:search])
|
30
32
|
#TODO perpage constant should be put somewhere else
|
31
|
-
@translations_changes = Translation.recent_changes.
|
32
|
-
|
33
|
-
@page = params[:page].to_i
|
34
|
-
@total_pages = Translation.recent_changes.count / 5
|
33
|
+
@translations_changes = Translation.recent_changes.offset(Translation::CHANGES_PER_PAGE * (@page - 1)).limit(Translation::CHANGES_PER_PAGE)
|
34
|
+
@total_pages = (Translation.recent_changes.count / (Translation::CHANGES_PER_PAGE * 1.0)).ceil
|
35
35
|
|
36
36
|
respond_to do |format|
|
37
37
|
format.html
|
@@ -40,10 +40,11 @@ module TranslationCenter
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def search_activity
|
43
|
-
@translations_changes = Translation.recent_changes(params[:search]).page(params[:page]).limit(5)
|
44
43
|
params[:page] ||= 1
|
45
44
|
@page = params[:page].to_i
|
46
|
-
|
45
|
+
|
46
|
+
@translations_changes = Translation.recent_changes(params[:search]).offset(Translation::CHANGES_PER_PAGE * (@page - 1)).limit(Translation::CHANGES_PER_PAGE)
|
47
|
+
@total_pages = (Translation.recent_changes(params[:search]).count / (Translation::CHANGES_PER_PAGE * 1.0)).ceil
|
47
48
|
|
48
49
|
respond_to do |format|
|
49
50
|
format.js
|
@@ -34,15 +34,15 @@
|
|
34
34
|
= distance_of_time_in_words_to_now change.created_at
|
35
35
|
= t('.ago')
|
36
36
|
.pagination
|
37
|
-
= link_to t('.first'),
|
37
|
+
= link_to t('.first'), "#{request.protocol}#{request.host_with_port}#{request.fullpath.gsub('&page=' + @page.to_s, '')}?&page=1"
|
38
38
|
- if @page != 1
|
39
39
|
|
|
40
|
-
= link_to t('.prev'),
|
40
|
+
= link_to t('.prev'), "#{request.protocol}#{request.host_with_port}#{request.fullpath.gsub('&page=' + @page.to_s, '')}?&page=#{@page - 1}"
|
41
41
|
|
|
42
|
-
= link_to t('.next'),
|
42
|
+
= link_to t('.next'), "#{request.protocol}#{request.host_with_port}#{request.fullpath.gsub('&page=' + @page.to_s, '')}?&page=#{@page + 1}"
|
43
43
|
- if @page != @total_pages
|
44
44
|
|
|
45
|
-
= link_to t('.last'),
|
45
|
+
= link_to t('.last'), "#{request.protocol}#{request.host_with_port}#{request.fullpath.gsub('&page=' + @page.to_s, '')}?&page=#{@total_pages}"
|
46
46
|
= @page
|
47
47
|
= t('.of')
|
48
48
|
= @total_pages
|
@@ -51,7 +51,7 @@
|
|
51
51
|
%h1
|
52
52
|
= t('.activity')
|
53
53
|
.span12
|
54
|
-
|
54
|
+
|
55
55
|
= form_for @search, url: :search_activity, html: { method: :get, id: :search_form, class: 'pull-left form-search' } do |f|
|
56
56
|
= f.text_field 'auditable_TranslationCenter::Translation_type_translation_key_name_matches', class: 'search_field input-medium', placeholder: 'KEY'
|
57
57
|
|
@@ -4,11 +4,12 @@ require 'haml'
|
|
4
4
|
require 'haml-rails'
|
5
5
|
require 'acts_as_votable'
|
6
6
|
require 'ya2yaml'
|
7
|
-
require 'meta_search'
|
8
7
|
require 'font-awesome-rails'
|
9
8
|
require 'audited-activerecord'
|
10
9
|
|
11
10
|
module TranslationCenter
|
11
|
+
require 'meta_search'
|
12
|
+
|
12
13
|
class Engine < ::Rails::Engine
|
13
14
|
isolate_namespace TranslationCenter
|
14
15
|
end
|