active_scaffold 3.2.5 → 3.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ = 3.2.6
2
+ - fix ordering with DISTINCT call
3
+ - allow to override some human condition strings in i18n, and translate select values for non-association columns
4
+
1
5
  = 3.2.5
2
6
  - add outer window for pagination links
3
7
  - workaround rails 3.2.3 bug in TimeWithZone#to_time
@@ -27,6 +27,7 @@ de:
27
27
  export: 'Exportieren'
28
28
  nested_for_model: '%{nested_model} für %{parent_model}'
29
29
  nested_of_model: '%{nested_model} von %{parent_model}'
30
+ 'false': 'False'
30
31
  filtered: '(Gefiltert)'
31
32
  found: 'Gefunden'
32
33
  hide: 'Verstecken'
@@ -53,6 +54,7 @@ de:
53
54
  show: 'Anzeigen'
54
55
  show_model: 'Zeige %{model} an'
55
56
  _to_ : ' zu '
57
+ 'true': 'True'
56
58
  update: 'Speichern'
57
59
  update_model: 'Editiere %{model}'
58
60
  updated_model: '%{model} aktualisiert'
@@ -100,6 +102,9 @@ de:
100
102
  timeText: 'Uhrzeit'
101
103
  currentText: 'Jetzt'
102
104
  closeText: 'Schließen'
105
+ human_conditions:
106
+ boolean: "%{column} = %{value}"
107
+ association: "%{column} = %{value}"
103
108
  errors:
104
109
  template:
105
110
  header:
@@ -100,6 +100,10 @@ en:
100
100
  showMonthAfterYear: false
101
101
 
102
102
  datetime_picker_options:
103
+
104
+ human_conditions:
105
+ boolean: "%{column} = %{value}"
106
+ association: "%{column} = %{value}"
103
107
 
104
108
  errors:
105
109
  template:
@@ -109,8 +113,7 @@ en:
109
113
 
110
114
  body: "There were problems with the following fields:"
111
115
 
112
-
113
- # error_messages
116
+ # error_messages
114
117
  cant_destroy_record: "%{record} can't be destroyed"
115
118
  internal_error: 'Request Failed (code 500, Internal Error)'
116
119
  version_inconsistency: 'Version inconsistency - this record has been modified since you started editing it.'
@@ -67,8 +67,6 @@ es:
67
67
  '<': 'Menor'
68
68
  '!=': 'Distinto'
69
69
  between: 'Entre'
70
- is_null: 'Es nulo'
71
- is_not_null: 'No es nulo'
72
70
  contains: 'Contiene'
73
71
  begins_with: 'Empieza con'
74
72
  ends_with: 'Termina con'
@@ -106,6 +104,9 @@ es:
106
104
  timeText: 'Hora'
107
105
  currentText: 'Ahora'
108
106
  closeText: 'Cerrar'
107
+ human_conditions:
108
+ boolean: "%{column} = %{value}"
109
+ association: "%{column} = %{value}"
109
110
  errors:
110
111
  template:
111
112
  header:
@@ -117,4 +118,5 @@ es:
117
118
  cant_destroy_record: "No se pudo borrar %{record}"
118
119
  internal_error: 'Petición fallida (código 500, error interno)'
119
120
  version_inconsistency: 'Inconsistencia de versiones - este registro se ha modificado después de que empezó a editarlo.'
121
+ record_not_saved: 'Fallo guardando el registro debido a un error desconocido'
120
122
  no_authorization_for_action: "No dispone de autorización para la acción %{action}"
@@ -104,6 +104,10 @@ fr:
104
104
  currentText: 'Maintenant'
105
105
  closeText: 'Fermer'
106
106
 
107
+ human_conditions:
108
+ boolean: "%{column} = %{value}"
109
+ association: "%{column} = %{value}"
110
+
107
111
  errors:
108
112
  template:
109
113
  header:
@@ -11,6 +11,8 @@ hu:
11
11
  click_to_edit: 'Kattints a szerkesztéshez'
12
12
  click_to_reset: 'Kattints az alapállapothoz'
13
13
  close: 'Bezárás'
14
+ config_list: 'Configure'
15
+ config_list_model: 'Configure Columns for %{model}'
14
16
  create: 'Létrehozás'
15
17
  create_model: '%{model} létrehozása'
16
18
  create_another: 'Mégegy hozzáadása'
@@ -25,6 +27,7 @@ hu:
25
27
  export: 'Exportálás'
26
28
  nested_for_model: '%{nested_model} / %{parent_model}'
27
29
  nested_of_model: '%{nested_model} of %{parent_model}'
30
+ 'false': 'False'
28
31
  filtered: '(Szűrt)'
29
32
  found: 'Találat'
30
33
  hide: 'Elrejtés'
@@ -51,6 +54,7 @@ hu:
51
54
  show: 'Mutatás'
52
55
  show_model: '%{model} mutatása'
53
56
  _to_ : ' – '
57
+ 'true': 'True'
54
58
  update: 'Modosítás'
55
59
  update_model: '%{model} modosítása'
56
60
  updated_model: '%{model} módosítva'
@@ -61,12 +65,54 @@ hu:
61
65
  '<': '<'
62
66
  '!=': '!='
63
67
  between: 'Között'
64
- is_null: 'Is null'
65
- is_not_null: 'Is not null'
66
68
  contains: 'Contains'
67
69
  begins_with: 'Begins with'
68
70
  ends_with: 'Ends with'
71
+ today: 'Today'
72
+ yesterday: 'Yesterday'
73
+ tomorrow: 'Tommorrow'
74
+ this_week: 'This Week'
75
+ prev_week: 'Last Week'
76
+ next_week: 'Next Week'
77
+ this_month: 'This Month'
78
+ prev_month: 'Last Month'
79
+ next_month: 'Next Month'
80
+ this_year: 'This Year'
81
+ prev_year: 'Last Year'
82
+ next_year: 'Next Year'
83
+ past: 'Past'
84
+ future: 'Future'
85
+ range: 'Range'
86
+ seconds: 'Seconds'
87
+ minutes: 'Minutes'
88
+ hours: 'Hours'
89
+ days: 'Days'
90
+ weeks: 'Weeks'
91
+ months: 'Months'
92
+ years: 'Years'
93
+ optional_attributes: 'Further Options'
94
+ null: 'Null'
95
+ not_null: 'Not Null'
96
+ date_picker_options:
97
+ weekHeader: 'Wk'
98
+ firstDay: 0
99
+ isRTL: false
100
+ showMonthAfterYear: false
101
+
102
+ datetime_picker_options:
69
103
 
104
+ human_conditions:
105
+ boolean: "%{column} = %{value}"
106
+ association: "%{column} = %{value}"
107
+
108
+ errors:
109
+ template:
110
+ header:
111
+ one: "1 error prohibited this %{model} from being saved."
112
+ other: "%{count} errors prohibited this %{model} from being saved"
113
+
114
+ body: "There were problems with the following fields:"
115
+
70
116
  # error_messages
71
117
  cant_destroy_record: "nem törölhető: %{record}"
72
118
  internal_error: 'A lekérés sikertelen (code 500, Internal Error)'
@@ -9,7 +9,10 @@ ja:
9
9
  are_you_sure_to_delete: '本当によいですか?'
10
10
  cancel: 'キャンセル'
11
11
  click_to_edit: 'クリックして編集'
12
+ click_to_reset: 'Click to reset'
12
13
  close: '閉じる'
14
+ config_list: 'Configure'
15
+ config_list_model: 'Configure Columns for %{model}'
13
16
  create: '作成'
14
17
  create_model: '%{model}を作成'
15
18
  create_another: '別のものを作成'
@@ -24,6 +27,7 @@ ja:
24
27
  export: 'Export' # needed?
25
28
  nested_for_model: '%{parent_model}の%{nested_model}'
26
29
  nested_of_model: '%{nested_model} of %{parent_model}'
30
+ 'false': 'False'
27
31
  filtered: '(フィルタ中)'
28
32
  found: '個ありました'
29
33
  hide: '隠す'
@@ -50,6 +54,7 @@ ja:
50
54
  show: '表示'
51
55
  show_model: '%{model}を表示'
52
56
  _to_ : ' to ' # needed?
57
+ 'true': 'True'
53
58
  update: '更新'
54
59
  update_model: '%{model}を更新'
55
60
  updated_model: '%{model}を更新しました'
@@ -60,12 +65,54 @@ ja:
60
65
  '<': '<'
61
66
  '!=': '!='
62
67
  between: 'Between' # needed?
63
- is_null: 'Is null'
64
- is_not_null: 'Is not null'
65
68
  contains: 'Contains'
66
69
  begins_with: 'Begins with'
67
70
  ends_with: 'Ends with'
68
-
71
+ today: 'Today'
72
+ yesterday: 'Yesterday'
73
+ tomorrow: 'Tommorrow'
74
+ this_week: 'This Week'
75
+ prev_week: 'Last Week'
76
+ next_week: 'Next Week'
77
+ this_month: 'This Month'
78
+ prev_month: 'Last Month'
79
+ next_month: 'Next Month'
80
+ this_year: 'This Year'
81
+ prev_year: 'Last Year'
82
+ next_year: 'Next Year'
83
+ past: 'Past'
84
+ future: 'Future'
85
+ range: 'Range'
86
+ seconds: 'Seconds'
87
+ minutes: 'Minutes'
88
+ hours: 'Hours'
89
+ days: 'Days'
90
+ weeks: 'Weeks'
91
+ months: 'Months'
92
+ years: 'Years'
93
+ optional_attributes: 'Further Options'
94
+ null: 'Null'
95
+ not_null: 'Not Null'
96
+ date_picker_options:
97
+ weekHeader: 'Wk'
98
+ firstDay: 0
99
+ isRTL: false
100
+ showMonthAfterYear: false
101
+
102
+ datetime_picker_options:
103
+
104
+ human_conditions:
105
+ boolean: "%{column} = %{value}"
106
+ association: "%{column} = %{value}"
107
+
108
+ errors:
109
+ template:
110
+ header:
111
+ one: "1 error prohibited this %{model} from being saved."
112
+ other: "%{count} errors prohibited this %{model} from being saved"
113
+
114
+ body: "There were problems with the following fields:"
115
+
69
116
  # error_messages
70
117
  cant_destroy_record: "%{record}を削除で来ません"
71
118
  internal_error: 'リクエストが失敗しました(コード500: 内部エラー)'
@@ -27,7 +27,7 @@ ru:
27
27
  export: 'Экспорт'
28
28
  nested_for_model: '%{parent_model} / %{nested_model}'
29
29
  nested_of_model: '%{nested_model} @ %{parent_model}'
30
- false: 'Нет'
30
+ 'false': 'Нет'
31
31
  filtered: '(Найденное)'
32
32
  found:
33
33
  one: 'запись'
@@ -58,7 +58,7 @@ ru:
58
58
  show: 'Показать'
59
59
  show_model: '%{model}: показать запись'
60
60
  _to_ : ' to '
61
- true: 'Да'
61
+ 'true': 'Да'
62
62
  update: 'Обновить запись'
63
63
  update_model: '%{model}: обновить запись'
64
64
  updated_model: '%{model}: запись обновлена'
@@ -104,6 +104,10 @@ ru:
104
104
  showMonthAfterYear: false
105
105
 
106
106
  datetime_picker_options:
107
+
108
+ human_conditions:
109
+ boolean: "%{column} = %{value}"
110
+ association: "%{column} = %{value}"
107
111
 
108
112
  errors:
109
113
  template:
@@ -1 +1 @@
1
- <%= columns.collect {|column| active_scaffold_human_condition_for(column)}.compact.join(I18n.t('support.array.two_words_connector')) %>
1
+ <%= columns.collect {|column| active_scaffold_human_condition_for(column)}.compact.to_sentence %>
@@ -97,7 +97,7 @@ module ActiveScaffold::DataStructures
97
97
  order << Array(sql).map {|column| "#{column} #{sort_direction}"}.join(', ')
98
98
  end
99
99
 
100
- order.join(', ') unless order.empty?
100
+ order unless order.empty?
101
101
  end
102
102
 
103
103
  protected
@@ -1,7 +1,7 @@
1
1
  class Object
2
2
  def as_(key, options = {})
3
3
  unless key.blank?
4
- text = I18n.translate "#{key}", {:scope => [:active_scaffold], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)
4
+ text = I18n.translate "#{key}", {:scope => [:active_scaffold, *options.delete(:scope)], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)
5
5
  # text = nil if text.include?('translation missing:')
6
6
  end
7
7
  text ||= key
@@ -26,11 +26,19 @@ module ActiveScaffold
26
26
  when :select, :multi_select, :record_select
27
27
  associated = value
28
28
  associated = [associated].compact unless associated.is_a? Array
29
- associated = column.association.klass.where(["id in (?)", associated.map(&:to_i)]).collect(&:to_label) if column.association
30
- "#{column.active_record_class.human_attribute_name(column.name)} = #{associated.join(', ')}"
29
+ if column.association
30
+ associated = column.association.klass.where(:id => associated.map(&:to_i)).collect(&:to_label)
31
+ elsif column.options[:options]
32
+ associated = associated.collect do |value|
33
+ text, val = column.options[:options].find {|text, val| (val.nil? ? text : val).to_s == value.to_s}
34
+ value = active_scaffold_translated_option(column, text, val).first if text
35
+ value
36
+ end
37
+ end
38
+ as_(:association, :scope => :human_conditions, :column => column.active_record_class.human_attribute_name(column.name), :value => associated.join(', '))
31
39
  when :boolean, :checkbox
32
40
  label = column.column.type_cast(value) ? as_(:true) : as_(:false)
33
- "#{column.active_record_class.human_attribute_name(column.name)} = #{label}"
41
+ as_(:boolean, :scope => :human_conditions, :column => column.active_record_class.human_attribute_name(column.name), :value => label)
34
42
  when :null
35
43
  "#{column.active_record_class.human_attribute_name(column.name)} #{as_(value.to_sym)}"
36
44
  end
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
- PATCH = 5
5
+ PATCH = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -100,7 +100,7 @@ class SortingTest < Test::Unit::TestCase
100
100
  @sorting << [:a, 'desc']
101
101
  @sorting << [:b, 'asc']
102
102
 
103
- assert_equal '"model_stubs"."a" DESC, "model_stubs"."b" ASC', @sorting.clause
103
+ assert_equal '"model_stubs"."a" DESC, "model_stubs"."b" ASC', @sorting.clause.join(', ')
104
104
  end
105
105
 
106
106
  def test_set_default_sorting_with_simple_default_scope
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
- - 5
10
- version: 3.2.5
9
+ - 6
10
+ version: 3.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Many, see README
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-02 00:00:00 Z
18
+ date: 2012-05-03 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement