typus 3.0.0 → 3.0.1

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.
@@ -23,6 +23,8 @@ module Admin
23
23
 
24
24
  options = { foreign_key => @item.id }
25
25
 
26
+ build_pagination
27
+
26
28
  render "admin/templates/has_n",
27
29
  :model_to_relate => @model_to_relate,
28
30
  :model_to_relate_as_resource => @model_to_relate_as_resource,
@@ -42,6 +44,8 @@ module Admin
42
44
  form = build_relate_form
43
45
  end
44
46
 
47
+ build_pagination
48
+
45
49
  render "admin/templates/has_n",
46
50
  :model_to_relate => @model_to_relate,
47
51
  :model_to_relate_as_resource => @model_to_relate_as_resource,
@@ -51,6 +55,13 @@ module Admin
51
55
 
52
56
  end
53
57
 
58
+ def build_pagination
59
+ options = { :order => @model_to_relate.typus_order_by, :conditions => set_conditions }
60
+ items_per_page = @model_to_relate.typus_options_for(:per_page)
61
+ data = @resource.find(params[:id]).send(@field).all(options)
62
+ @items = data.paginate(:per_page => items_per_page, :page => params[:page])
63
+ end
64
+
54
65
  def build_relate_form
55
66
  render "admin/templates/relate_form",
56
67
  :model_to_relate => @model_to_relate,
@@ -31,6 +31,7 @@ fr:
31
31
  "Edit %{resource}": "Éditer %{resource}"
32
32
  "Enter your email below to create the first user": "Entrez votre adresse email pour créer le premier utilisateur"
33
33
  "Error! Typus User or role doesn't exist": "Une erreur est survenue. L'utilisateur ou le rôle sont inconnus."
34
+ "Export as %{format}": "Exporter en %{format}"
34
35
 
35
36
  "False": "Faux"
36
37
  "Filter": "Filtrer"
@@ -75,6 +76,7 @@ fr:
75
76
  "Setup": "Configurer"
76
77
  "Show": "Voir"
77
78
  "Show %{resource}": "Voir %{resource}"
79
+ "Show by %{attribute}": "Afficher par %{attribute}"
78
80
  "Sign in": "Entrer"
79
81
  "Sign out": "Déconnexion"
80
82
  "Sign up": "Ouvrir un compte"
@@ -248,7 +248,7 @@ module Typus
248
248
  when "^" then "#{query}%"
249
249
  when "@" then "%#{query}%"
250
250
  end
251
- key = "TEXT(#{key})" if adapter == 'postgresql'
251
+ key = "LOWER(TEXT(#{key}))" if adapter == 'postgresql'
252
252
  search << "#{key} LIKE '#{_query}'"
253
253
  end
254
254
  conditions = merge_conditions(conditions, search.join(" OR "))
data/lib/typus/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Typus
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typus
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 0
10
- version: 3.0.0
9
+ - 1
10
+ version: 3.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Francesc Esplugas
@@ -390,7 +390,6 @@ files:
390
390
  - test/unit/admin/mailer_test.rb
391
391
  - test/unit/typus_user_roles_test.rb
392
392
  - test/unit/typus_user_test.rb
393
- - typus-1.0.0.pre14.gem
394
393
  - typus.gemspec
395
394
  has_rdoc: true
396
395
  homepage: http://core.typuscms.com/
Binary file