typus 3.0.11.rc3 → 3.0.11.rc4

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,12 @@ $(document).ready(function() {
18
18
  'type': 'iframe'
19
19
  });
20
20
 
21
+ // This method is used by `text_with_ckeditor` template.
22
+ if ($('textarea.ckeditor').length > 0) {
23
+ var data = $('textarea');
24
+ $.each(data, function(i) { CKEDITOR.replace(data[i].id); });
25
+ }
26
+
21
27
  });
22
28
 
23
29
  function setConfirmUnload(on) {
@@ -46,6 +46,8 @@ module Admin
46
46
  alias_method :display_position, :display_string
47
47
  alias_method :display_integer, :display_string
48
48
  alias_method :display_decimal, :display_string
49
+ alias_method :display_float, :display_string
50
+ alias_method :display_date, :display_datetime
49
51
 
50
52
  end
51
53
  end
@@ -38,6 +38,7 @@ module Admin
38
38
 
39
39
  render "admin/templates/has_n",
40
40
  :association_name => @association_name,
41
+ :association_title => @model_to_relate.model_name.human.pluralize,
41
42
  :add_new => build_add_new(options),
42
43
  :form => form,
43
44
  :table => build_relationship_table
@@ -65,6 +66,7 @@ module Admin
65
66
 
66
67
  render "admin/templates/has_n",
67
68
  :association_name => @association_name,
69
+ :association_title => @model_to_relate.model_name.human.pluralize,
68
70
  :add_new => build_add_new,
69
71
  :form => form,
70
72
  :table => build_relationship_table
@@ -134,6 +136,7 @@ module Admin
134
136
 
135
137
  render "admin/templates/has_one",
136
138
  :association_name => @association_name,
139
+ :association_title => @model_to_relate.model_name.human,
137
140
  :add_new => @items.empty? ? build_add_new(options) : nil,
138
141
  :table => build_relationship_table
139
142
  end
@@ -5,7 +5,7 @@ module Admin
5
5
  resources = ActiveSupport::OrderedHash.new
6
6
  app_name = @resource.typus_application
7
7
 
8
- admin_user.application(app_name).sort {|a,b| a.typus_constantize.model_name.human <=> b.typus_constantize.model_name.human}.each do |resource|
8
+ admin_user.application(app_name) {|a,b| a.typus_constantize.model_name.human <=> b.typus_constantize.model_name.human}.each do |resource|
9
9
  klass = resource.typus_constantize
10
10
 
11
11
  resources[resource] = default_actions(klass)
@@ -85,15 +85,15 @@ module Admin
85
85
  (raw_content = item.send(attribute)).present? ? truncate(raw_content) : "&mdash;".html_safe
86
86
  end
87
87
 
88
- def table_generic_field(attribute, item)
88
+ def table_string_field(attribute, item)
89
89
  (raw_content = item.send(attribute)).present? ? raw_content : "&mdash;".html_safe
90
90
  end
91
91
 
92
- alias :table_float_field :table_generic_field
93
- alias :table_integer_field :table_generic_field
94
- alias :table_decimal_field :table_generic_field
95
- alias :table_virtual_field :table_generic_field
96
- alias :table_string_field :table_generic_field
92
+ alias :table_float_field :table_string_field
93
+ alias :table_integer_field :table_string_field
94
+ alias :table_decimal_field :table_string_field
95
+ alias :table_virtual_field :table_string_field
96
+ alias :table_password_field :table_string_field
97
97
 
98
98
  def table_selector_field(attribute, item)
99
99
  item.mapping(attribute)
@@ -2,7 +2,7 @@
2
2
  <% label = "#{@item.class.model_name.underscore.gsub("/","_")}_#{related_fk}" %>
3
3
  <script type="text/javascript">
4
4
  $(document).ready(function () {
5
- $("#tokenInput_for_<%= related_fk %>").tokenInput("/admin/<%= association.name.to_s.pluralize %>/autocomplete", {
5
+ $("#tokenInput_for_<%= related_fk %>").tokenInput("/admin/<%= association.class_name.tableize %>/autocomplete", {
6
6
  hintText: "",
7
7
  queryParam: 'term',
8
8
  tokenLimit: 1,
@@ -1,7 +1,7 @@
1
1
  <div class="box_relationships" id="<%= association_name %>">
2
2
 
3
3
  <h2>
4
- <%= association_name.titleize.humanize.pluralize %>
4
+ <%= association_title %>
5
5
  <small><%= add_new %></small>
6
6
  </h2>
7
7
 
@@ -11,7 +11,7 @@
11
11
  <%= table %>
12
12
  <%= will_paginate(@items, Typus.pagination.merge(:anchor => association_name)) %>
13
13
  <% else %>
14
- <p><%= Typus::I18n.t("No %{resources} found.", :resources => association_name.humanize.downcase.pluralize) %></p>
14
+ <p><%= Typus::I18n.t("No %{resources} found.", :resources => association_title.downcase) %></p>
15
15
  <% end %>
16
16
 
17
17
  </div>
@@ -1,14 +1,14 @@
1
1
  <div class="box_relationships" id="<%= association_name %>">
2
2
 
3
3
  <h2>
4
- <%= association_name.humanize %>
4
+ <%= association_title %>
5
5
  <small><%= add_new %></small>
6
6
  </h2>
7
7
 
8
8
  <% if @items.any? -%>
9
9
  <%= table %>
10
10
  <% else %>
11
- <p><%= Typus::I18n.t("No %{resources} found.", :resources => association_name.humanize.downcase) %></p>
11
+ <p><%= Typus::I18n.t("No %{resources} found.", :resources => association_title.downcase) %></p>
12
12
  <% end %>
13
13
 
14
14
  </div>
@@ -0,0 +1,17 @@
1
+ # Portuguese (pt-PT) translations for Typus by:
2
+ # - Nuno Baldaia <http://nunobaldaia.com/>
3
+
4
+ "pt-PT":
5
+ activerecord:
6
+ models:
7
+ admin_user: "Utilizador"
8
+ attributes:
9
+ admin_user:
10
+ email:
11
+ first_name: "Primeiro nome"
12
+ last_name: "Último nome"
13
+ locale: "Linguagem"
14
+ password: "Senha"
15
+ password_confirmation: "Confirmação de senha"
16
+ role: "Função no sistema"
17
+ status: "Estado"
@@ -0,0 +1,83 @@
1
+ # Portuguese (pt-PT) translations for Typus by:
2
+ # - Nuno Baldaia <http://nunobaldaia.com/>
3
+
4
+ "pt-PT":
5
+
6
+ "Actions": "Acções"
7
+ "Active": "Activo"
8
+ "Add": "Adicionar"
9
+ "Add new": "Adicionar novo"
10
+ "Are you sure?": "Tem a certeza?"
11
+ "Are you sure you want to sign out and end your session?": "Tem certeza que quer sair e encerrar sua sessão?"
12
+
13
+ "Change %{attribute}?": "Mudar %{attribute}?"
14
+ "Create %{resource}": "Criar %{resource}"
15
+
16
+ "Dashboard": "Painel"
17
+ "Down": "Descer"
18
+
19
+ "Edit": "Editar"
20
+ "Edit %{resource}": "Editar %{resource}"
21
+ "Enter your email below to create the first user": "Introduza o seu email para criar o primeiro utilizador"
22
+
23
+ "False": "Falso"
24
+ "Filter": "Filtrar"
25
+
26
+ "I remember my password": "Lembro-me da minha senha"
27
+ "If you didn't request a password update, you can ignore this message": "Se não pediu uma renovação de senha, por favor ignore esta mensagem."
28
+ "If you have made any changes to the fields without clicking the Save/Update entry button, your changes will be lost": "Se fez alterações nos campos e não clicou no botão de Salvar/Atualizar, as suas alterações serão perdidas"
29
+ "Inactive": "Inactivo"
30
+
31
+ "Last few days": "Últimos dias"
32
+ "Last 30 days": "Últimos 30 dias"
33
+ "Last 7 days": "Últimos 7 dias"
34
+ "List": "Lista"
35
+ "Logged as": "Logado como"
36
+ "Login": "Login"
37
+
38
+ "New": "Novo"
39
+ "New %{resource}": "Novo %{resource}"
40
+ "Next": "Próximo"
41
+ "No %{resources} found": "Nenhum resultado encontrado em %{resources}"
42
+
43
+ "Password recovery link sent to your email": "Foi enviado para o seu email um link para recuperação da senha."
44
+ "Previous": "Anterior"
45
+
46
+ "Record moved %{to}": "Registro movido %{to}."
47
+ "Recover password": "Recuperar senha"
48
+ "Remove": "Remover"
49
+ "Remove %{resource}?": "Remover %{resource}?"
50
+ "Reset password": "Trocar senha"
51
+ "Resources": "Recursos"
52
+
53
+ "Save %{resource}": "Salvar %{resource}"
54
+ "Search": "Procurar"
55
+ "Show": "Mostrar"
56
+ "Show all dates": "Mostrar todas as datas"
57
+ "Show by %{attribute}": "Mostrar por %{attribute}"
58
+ "Show %{resource}": "Mostrar %{resource}"
59
+ "Sign in": "Entrar"
60
+ "Sign out": "Sair"
61
+ "Sign up": "Criar conta"
62
+ "System Users Administration": "Administração de utilizadores de sistema"
63
+
64
+ "Today": "Hoje"
65
+ "True": "Verdadeiro"
66
+
67
+ "Unrelate": "Desvincular"
68
+ "Up": "Subir"
69
+
70
+ "View all %{attribute}": "Ver todos %{attribute}"
71
+ "View site": "Ver site"
72
+
73
+ "You can't toggle your status": "Não pode trocar o seu estado."
74
+ "You can update your password at": "Pode atualizar a sua senha em"
75
+ "You can't change your role": "Não pode mudar sua própria função no sistema."
76
+
77
+ "%{errors} prohibited this page from being saved:":
78
+ "%{model} successfully created": "%{model} criado com sucesso."
79
+ "%{model} successfully removed": "%{model} removido com sucesso."
80
+ "%{model} successfully updated": "%{model} atualizado com sucesso."
81
+
82
+ "Top": "Topo"
83
+ "Bottom": "Fundo"
@@ -137,7 +137,7 @@ module Typus
137
137
 
138
138
  # Lists modules of an application.
139
139
  def application(name)
140
- Typus::Configuration.config.map { |i| i.first if i.last["application"] == name }.compact.uniq.sort
140
+ Typus::Configuration.config.map { |i| i.first if i.last["application"] == name }.compact.uniq
141
141
  end
142
142
 
143
143
  # Lists models from the configuration file.
@@ -175,7 +175,8 @@ module Typus
175
175
  "Français" => "fr",
176
176
  "Magyar" => "hu",
177
177
  "Italiano" => "It",
178
- "Portuguese" => "pt-BR",
178
+ "Portuguese" => "pt-PT",
179
+ "Brazilian Portuguese" => "pt-BR",
179
180
  "Russian" => "ru",
180
181
  "中文" => "zh-CN" }
181
182
  end
@@ -62,7 +62,7 @@ module Typus
62
62
  if worked
63
63
  notice = Typus::I18n.t("%{model} successfully updated.", :model => item_class.model_name.human)
64
64
  else
65
- alert = item.error.full_messages
65
+ alert = item.errors.full_messages
66
66
  end
67
67
 
68
68
  redirect_to :back, :notice => notice, :alert => alert
@@ -28,7 +28,7 @@ module Typus
28
28
 
29
29
  options = { :conditions => @conditions, :batch_size => 1000 }
30
30
 
31
- ::FasterCSV.open(filename, 'w', :col_sep => ';') do |csv|
31
+ ::FasterCSV.open(filename, 'w') do |csv|
32
32
  csv << fields.keys
33
33
  @resource.find_in_batches(options) do |records|
34
34
  records.each do |record|
@@ -1,3 +1,3 @@
1
1
  module Typus
2
- VERSION = "3.0.11.rc3"
2
+ VERSION = "3.0.11.rc4"
3
3
  end
metadata CHANGED
@@ -1,82 +1,80 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: typus
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.11.rc4
4
5
  prerelease: 7
5
- version: 3.0.11.rc3
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Francesc Esplugas
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-16 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-06-27 00:00:00.000000000 +02:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
16
  name: bcrypt-ruby
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2154164760 !ruby/object:Gem::Requirement
19
18
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
24
23
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: fastercsv
28
24
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *2154164760
26
+ - !ruby/object:Gem::Dependency
27
+ name: fastercsv
28
+ requirement: &2154163540 !ruby/object:Gem::Requirement
30
29
  none: false
31
- requirements:
30
+ requirements:
32
31
  - - ~>
33
- - !ruby/object:Gem::Version
34
- version: "1.5"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.5'
35
34
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: rails
39
35
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *2154163540
37
+ - !ruby/object:Gem::Dependency
38
+ name: rails
39
+ requirement: &2154162160 !ruby/object:Gem::Requirement
41
40
  none: false
42
- requirements:
41
+ requirements:
43
42
  - - ~>
44
- - !ruby/object:Gem::Version
43
+ - !ruby/object:Gem::Version
45
44
  version: 3.0.8
46
45
  type: :runtime
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: render_inheritable
50
46
  prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *2154162160
48
+ - !ruby/object:Gem::Dependency
49
+ name: render_inheritable
50
+ requirement: &2154161560 !ruby/object:Gem::Requirement
52
51
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: "0"
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
57
56
  type: :runtime
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
60
- name: will_paginate
61
57
  prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
58
+ version_requirements: *2154161560
59
+ - !ruby/object:Gem::Dependency
60
+ name: will_paginate
61
+ requirement: &2154160520 !ruby/object:Gem::Requirement
63
62
  none: false
64
- requirements:
63
+ requirements:
65
64
  - - ~>
66
- - !ruby/object:Gem::Version
65
+ - !ruby/object:Gem::Version
67
66
  version: 3.0.pre2
68
67
  type: :runtime
69
- version_requirements: *id005
70
- description: Ruby on Rails Admin Panel (Engine) to allow trusted users edit structured content.
71
- email:
68
+ prerelease: false
69
+ version_requirements: *2154160520
70
+ description: Ruby on Rails Admin Panel (Engine) to allow trusted users edit structured
71
+ content.
72
+ email:
72
73
  - core@typuscms.com
73
74
  executables: []
74
-
75
75
  extensions: []
76
-
77
76
  extra_rdoc_files: []
78
-
79
- files:
77
+ files:
80
78
  - .gitignore
81
79
  - Gemfile
82
80
  - MIT-LICENSE
@@ -225,6 +223,8 @@ files:
225
223
  - config/locales/typus.locale.yml.template
226
224
  - config/locales/typus.pt-BR.models.yml
227
225
  - config/locales/typus.pt-BR.yml
226
+ - config/locales/typus.pt-PT.models.yml
227
+ - config/locales/typus.pt-PT.yml
228
228
  - config/locales/typus.ru.models.yml
229
229
  - config/locales/typus.ru.yml
230
230
  - config/locales/typus.zh-CN.models.yml
@@ -481,34 +481,33 @@ files:
481
481
  - test/lib/typus_test.rb
482
482
  - test/test_helper.rb
483
483
  - typus.gemspec
484
+ has_rdoc: true
484
485
  homepage: http://core.typuscms.com/
485
486
  licenses: []
486
-
487
487
  post_install_message:
488
488
  rdoc_options: []
489
-
490
- require_paths:
489
+ require_paths:
491
490
  - lib
492
- required_ruby_version: !ruby/object:Gem::Requirement
491
+ required_ruby_version: !ruby/object:Gem::Requirement
493
492
  none: false
494
- requirements:
495
- - - ">="
496
- - !ruby/object:Gem::Version
497
- version: "0"
498
- required_rubygems_version: !ruby/object:Gem::Requirement
493
+ requirements:
494
+ - - ! '>='
495
+ - !ruby/object:Gem::Version
496
+ version: '0'
497
+ required_rubygems_version: !ruby/object:Gem::Requirement
499
498
  none: false
500
- requirements:
501
- - - ">"
502
- - !ruby/object:Gem::Version
499
+ requirements:
500
+ - - ! '>'
501
+ - !ruby/object:Gem::Version
503
502
  version: 1.3.1
504
503
  requirements: []
505
-
506
504
  rubyforge_project: typus
507
- rubygems_version: 1.8.5
505
+ rubygems_version: 1.6.2
508
506
  signing_key:
509
507
  specification_version: 3
510
- summary: Effortless backend interface for Ruby on Rails applications. (Admin scaffold generator)
511
- test_files:
508
+ summary: Effortless backend interface for Ruby on Rails applications. (Admin scaffold
509
+ generator)
510
+ test_files:
512
511
  - test/app/controllers/admin/account_controller_test.rb
513
512
  - test/app/controllers/admin/assets_controller_test.rb
514
513
  - test/app/controllers/admin/base_controller_test.rb