typus 3.1.0.rc8 → 3.1.0.rc9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/.gitmodules +1 -1
  2. data/app/controllers/admin/resources_controller.rb +29 -13
  3. data/app/helpers/admin/resources/data_types/datetime_helper.rb +2 -0
  4. data/app/helpers/admin/resources/data_types/dragonfly_helper.rb +1 -2
  5. data/app/helpers/admin/resources/data_types/float_helper.rb +0 -1
  6. data/app/helpers/admin/resources/data_types/paperclip_helper.rb +11 -13
  7. data/app/helpers/admin/resources/data_types/string_helper.rb +2 -0
  8. data/app/helpers/admin/resources/filters_helper.rb +14 -16
  9. data/app/helpers/admin/resources/relationships_helper.rb +1 -5
  10. data/app/helpers/admin/resources_helper.rb +1 -1
  11. data/app/mailers/admin/mailer.rb +1 -2
  12. data/app/themes/default/assets/javascripts/typus.js +8 -0
  13. data/app/{assets → themes/default/assets}/javascripts/typus/application.js +0 -1
  14. data/app/{assets → themes/default/assets}/javascripts/typus/jquery.application.js +0 -0
  15. data/app/{assets → themes/default/assets}/stylesheets/typus.css +2 -1
  16. data/app/{assets → themes/default/assets}/stylesheets/typus/application.css +0 -0
  17. data/app/{assets → themes/default/assets}/stylesheets/typus/pagination.css +0 -0
  18. data/app/{assets → themes/default/assets}/stylesheets/typus/reset.css +0 -0
  19. data/app/{assets → themes/default/assets}/stylesheets/typus/screen.css +0 -0
  20. data/app/{views → themes/default/views}/admin/account/forgot_password.html.erb +0 -0
  21. data/app/{views → themes/default/views}/admin/account/new.html.erb +0 -0
  22. data/app/{views → themes/default/views}/admin/base/user_guide.html.erb +0 -0
  23. data/app/{views → themes/default/views}/admin/dashboard/_applications.html.erb +0 -0
  24. data/app/{views → themes/default/views}/admin/dashboard/_sidebar.html.erb +0 -0
  25. data/app/{views → themes/default/views}/admin/dashboard/show.html.erb +0 -0
  26. data/app/{views → themes/default/views}/admin/dashboard/styles.html.erb +0 -0
  27. data/app/{views → themes/default/views}/admin/mailer/reset_password_link.text.erb +0 -0
  28. data/app/{views → themes/default/views}/admin/resources/_edit.html.erb +0 -0
  29. data/app/{views → themes/default/views}/admin/resources/_form.html.erb +0 -0
  30. data/app/{views → themes/default/views}/admin/resources/_index.html.erb +0 -0
  31. data/app/{views → themes/default/views}/admin/resources/_new.html.erb +0 -0
  32. data/app/{views → themes/default/views}/admin/resources/_show.html.erb +0 -0
  33. data/app/{views → themes/default/views}/admin/resources/edit.html.erb +0 -0
  34. data/app/{views → themes/default/views}/admin/resources/index.html.erb +0 -0
  35. data/app/{views → themes/default/views}/admin/resources/new.html.erb +0 -0
  36. data/app/{views → themes/default/views}/admin/resources/show.html.erb +0 -0
  37. data/app/{views → themes/default/views}/admin/session/new.html.erb +0 -0
  38. data/app/{views → themes/default/views}/admin/shared/_head.html.erb +0 -0
  39. data/app/{views → themes/default/views}/admin/templates/_belongs_to.html.erb +0 -0
  40. data/app/{views → themes/default/views}/admin/templates/_belongs_to_with_autocomplete.html.erb +1 -1
  41. data/app/{views → themes/default/views}/admin/templates/_boolean.html.erb +0 -0
  42. data/app/{views → themes/default/views}/admin/templates/_date.html.erb +0 -0
  43. data/app/{views → themes/default/views}/admin/templates/_datetime.html.erb +0 -0
  44. data/app/{views → themes/default/views}/admin/templates/_dragonfly.html.erb +0 -0
  45. data/app/{views → themes/default/views}/admin/templates/_dragonfly_preview.html.erb +0 -0
  46. data/app/{views → themes/default/views}/admin/templates/_has_n.html.erb +0 -0
  47. data/app/{views → themes/default/views}/admin/templates/_has_one.html.erb +0 -0
  48. data/app/{views → themes/default/views}/admin/templates/_paperclip.html.erb +0 -0
  49. data/app/{views → themes/default/views}/admin/templates/_paperclip_preview.html.erb +0 -0
  50. data/app/{views → themes/default/views}/admin/templates/_password.html.erb +0 -0
  51. data/app/{views → themes/default/views}/admin/templates/_profile_sidebar.html.erb +0 -0
  52. data/app/{views → themes/default/views}/admin/templates/_selector.html.erb +0 -0
  53. data/app/{views → themes/default/views}/admin/templates/_string.html.erb +0 -0
  54. data/app/{views → themes/default/views}/admin/templates/_string_with_preview.html.erb +0 -0
  55. data/app/{views → themes/default/views}/admin/templates/_text.html.erb +0 -0
  56. data/app/{views → themes/default/views}/admin/templates/_text_with_ckeditor.html.erb +1 -1
  57. data/app/{views → themes/default/views}/admin/templates/_text_with_ckeditor_and_assets.html.erb +1 -1
  58. data/app/{views → themes/default/views}/admin/templates/_time.html.erb +0 -0
  59. data/app/{views → themes/default/views}/admin/templates/_tree.html.erb +0 -0
  60. data/app/{views → themes/default/views}/helpers/admin/base/_apps.html.erb +0 -0
  61. data/app/{views → themes/default/views}/helpers/admin/base/_flash_message.html.erb +0 -0
  62. data/app/{views → themes/default/views}/helpers/admin/base/_header.html.erb +0 -0
  63. data/app/{views → themes/default/views}/helpers/admin/base/_login_info.html.erb +0 -0
  64. data/app/{views → themes/default/views}/helpers/admin/dashboard/_resources.html.erb +0 -0
  65. data/app/{views → themes/default/views}/helpers/admin/resources/_actions.html.erb +0 -0
  66. data/app/{views → themes/default/views}/helpers/admin/resources/_errors.html.erb +0 -0
  67. data/app/{views → themes/default/views}/helpers/admin/resources/_filters.html.erb +0 -0
  68. data/app/{views → themes/default/views}/helpers/admin/resources/_search.html.erb +0 -0
  69. data/app/{views → themes/default/views}/helpers/admin/resources/_sidebar.html.erb +0 -0
  70. data/app/{views → themes/default/views}/helpers/admin/resources/_table.html.erb +0 -0
  71. data/app/{views → themes/default/views}/layouts/admin/base.html.erb +0 -0
  72. data/app/{views → themes/default/views}/layouts/admin/headless.html.erb +0 -0
  73. data/app/{views → themes/default/views}/layouts/admin/session.html.erb +0 -0
  74. data/config/locales/typus.pt-PT.models.yml +17 -0
  75. data/config/locales/typus.pt-PT.yml +83 -0
  76. data/lib/typus.rb +3 -2
  77. data/lib/typus/controller/associations.rb +1 -1
  78. data/lib/typus/controller/format.rb +1 -1
  79. data/lib/typus/engine.rb +2 -1
  80. data/lib/typus/orm/base.rb +1 -1
  81. data/lib/typus/version.rb +1 -1
  82. data/typus.gemspec +1 -1
  83. data/{app → vendor}/assets/images/blank.gif +0 -0
  84. data/{app → vendor}/assets/images/fancy_close.png +0 -0
  85. data/{app → vendor}/assets/images/fancy_loading.png +0 -0
  86. data/{app → vendor}/assets/images/fancy_nav_left.png +0 -0
  87. data/{app → vendor}/assets/images/fancy_nav_right.png +0 -0
  88. data/{app → vendor}/assets/images/fancy_shadow_e.png +0 -0
  89. data/{app → vendor}/assets/images/fancy_shadow_n.png +0 -0
  90. data/{app → vendor}/assets/images/fancy_shadow_ne.png +0 -0
  91. data/{app → vendor}/assets/images/fancy_shadow_nw.png +0 -0
  92. data/{app → vendor}/assets/images/fancy_shadow_s.png +0 -0
  93. data/{app → vendor}/assets/images/fancy_shadow_se.png +0 -0
  94. data/{app → vendor}/assets/images/fancy_shadow_sw.png +0 -0
  95. data/{app → vendor}/assets/images/fancy_shadow_w.png +0 -0
  96. data/{app → vendor}/assets/images/fancy_title_left.png +0 -0
  97. data/{app → vendor}/assets/images/fancy_title_main.png +0 -0
  98. data/{app → vendor}/assets/images/fancy_title_over.png +0 -0
  99. data/{app → vendor}/assets/images/fancy_title_right.png +0 -0
  100. data/{app → vendor}/assets/images/fancybox-x.png +0 -0
  101. data/{app → vendor}/assets/images/fancybox-y.png +0 -0
  102. data/{app → vendor}/assets/images/fancybox.png +0 -0
  103. data/{app/assets/vendor/jquery.fancybox-1.3.4/fancybox → vendor/assets/javascripts}/jquery.fancybox-1.3.4.pack.js +0 -0
  104. data/{app/assets/javascripts/typus → vendor/assets/javascripts}/jquery.rails.autocomplete.js +0 -0
  105. data/{app/assets/javascripts/typus → vendor/assets/javascripts}/jquery.searchField.js +0 -0
  106. data/{app/assets/vendor/jquery-tokeninput/js → vendor/assets/javascripts}/jquery.tokeninput.js +0 -0
  107. data/{app/assets/vendor/jquery.fancybox-1.3.4/fancybox → vendor/assets/stylesheets}/jquery.fancybox-1.3.4.css +0 -0
  108. data/{app/assets/vendor/jquery-tokeninput/css → vendor/assets/stylesheets}/token-input.css +0 -0
  109. metadata +175 -219
  110. data/app/assets/javascripts/typus.js +0 -7
  111. data/app/assets/vendor/jquery-tokeninput/css/token-input-facebook.css +0 -122
  112. data/app/assets/vendor/jquery-tokeninput/css/token-input-mac.css +0 -204
  113. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  114. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  115. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  116. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  117. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  118. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  119. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  120. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  121. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  122. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  123. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  124. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  125. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  126. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  127. data/app/assets/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/jquery-ui-1.8.12.custom.css +0 -578
  128. data/app/assets/vendor/jquery-ui-1.8.12.custom/index.html +0 -367
  129. data/app/assets/vendor/jquery-ui-1.8.12.custom/js/jquery-ui-1.8.12.custom.min.js +0 -783
  130. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/blank.gif +0 -0
  131. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_close.png +0 -0
  132. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_loading.png +0 -0
  133. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_nav_left.png +0 -0
  134. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_nav_right.png +0 -0
  135. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_e.png +0 -0
  136. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_n.png +0 -0
  137. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_ne.png +0 -0
  138. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_nw.png +0 -0
  139. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_s.png +0 -0
  140. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_se.png +0 -0
  141. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_sw.png +0 -0
  142. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_w.png +0 -0
  143. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_left.png +0 -0
  144. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_main.png +0 -0
  145. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_over.png +0 -0
  146. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_right.png +0 -0
  147. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox-x.png +0 -0
  148. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox-y.png +0 -0
  149. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox.png +0 -0
  150. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/jquery.easing-1.3.pack.js +0 -72
  151. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.js +0 -1156
  152. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/jquery.mousewheel-3.0.4.pack.js +0 -14
@@ -3,4 +3,4 @@
3
3
  url = git@github.com:typus/typus.wiki.git
4
4
  [submodule "doc/site"]
5
5
  path = doc/site
6
- url = git@github.com:typus/typus.github.com.git
6
+ url = git@github.com:typus/site.git
@@ -151,31 +151,47 @@ class Admin::ResourcesController < Admin::BaseController
151
151
  end
152
152
 
153
153
  def get_objects
154
- eager_loading = @resource.reflect_on_all_associations(:belongs_to).reject { |i| i.options[:polymorphic] }.map { |i| i.name }
154
+ set_scope
155
+ set_wheres
156
+ set_joins
157
+ check_resources_ownership if @resource.typus_options_for(:only_user_items)
158
+ set_order
159
+ set_eager_loading
160
+ end
161
+
162
+ def fields
163
+ @resource.typus_fields_for(params[:action])
164
+ end
165
+ helper_method :fields
155
166
 
167
+ # Here we set the current scope!
168
+ def set_scope
169
+ end
170
+
171
+ def set_wheres
156
172
  @resource.build_conditions(params).each do |condition|
157
173
  @resource = @resource.where(condition)
158
174
  end
175
+ end
159
176
 
177
+ def set_joins
160
178
  @resource.build_my_joins(params).each do |join|
161
179
  @resource = @resource.joins(join)
162
180
  end
163
-
164
- if @resource.typus_options_for(:only_user_items)
165
- check_resources_ownership
166
- end
167
-
168
- @resource = @resource.order(set_order).includes(eager_loading)
169
- end
170
-
171
- def fields
172
- @resource.typus_fields_for(params[:action])
173
181
  end
174
- helper_method :fields
175
182
 
176
183
  def set_order
177
184
  params[:sort_order] ||= "desc"
178
- params[:order_by] ? "#{@resource.table_name}.#{params[:order_by]} #{params[:sort_order]}" : @resource.typus_order_by
185
+
186
+ if (order = params[:order_by] ? "#{params[:order_by]} #{params[:sort_order]}" : @resource.typus_order_by).present?
187
+ @resource = @resource.order(order)
188
+ end
189
+ end
190
+
191
+ def set_eager_loading
192
+ if (eager_loading = @resource.reflect_on_all_associations(:belongs_to).reject { |i| i.options[:polymorphic] }.map { |i| i.name }).any?
193
+ @resource = @resource.includes(eager_loading)
194
+ end
179
195
  end
180
196
 
181
197
  def redirect_on_success
@@ -14,4 +14,6 @@ module Admin::Resources::DataTypes::DatetimeHelper
14
14
  I18n.l(item.send(attribute), :format => @resource.typus_date_format(attribute))
15
15
  end
16
16
 
17
+ alias_method :display_date, :display_datetime
18
+
17
19
  end
@@ -11,10 +11,9 @@ module Admin::Resources::DataTypes::DragonflyHelper
11
11
 
12
12
  if attachment.present? && !validators.include?(attribute) && attachment
13
13
  attribute_i18n = @item.class.human_attribute_name(attribute)
14
- message = Typus::I18n.t("Remove")
15
14
  label_text = <<-HTML
16
15
  #{attribute_i18n}
17
- <small>#{link_to message, { :action => 'update', :id => @item.id, :attribute => attribute, :_continue => true }, :confirm => Typus::I18n.t("Are you sure?")}</small>
16
+ <small>#{link_to Typus::I18n.t("Remove"), { :action => 'update', :id => @item.id, :attribute => attribute, :_continue => true }, :confirm => Typus::I18n.t("Are you sure?")}</small>
18
17
  HTML
19
18
  label_text.html_safe
20
19
  end
@@ -1,3 +1,2 @@
1
1
  module Admin::Resources::DataTypes::FloatHelper
2
-
3
2
  end
@@ -11,27 +11,25 @@ module Admin::Resources::DataTypes::PaperclipHelper
11
11
 
12
12
  if attachment.exists? && !validators.include?("#{attribute}_file_name") && attachment
13
13
  attribute_i18n = @item.class.human_attribute_name(attribute)
14
- message = Typus::I18n.t("Remove")
15
14
  label_text = <<-HTML
16
15
  #{attribute_i18n}
17
- <small>#{link_to message, { :action => 'update', :id => @item.id, :attribute => attribute, :_continue => true }, :confirm => Typus::I18n.t("Are you sure?")}</small>
16
+ <small>#{link_to Typus::I18n.t("Remove"), { :action => 'update', :id => @item.id, :attribute => attribute, :_continue => true }, :confirm => Typus::I18n.t("Are you sure?")}</small>
18
17
  HTML
19
18
  label_text.html_safe
20
19
  end
21
20
  end
22
21
 
23
22
  def typus_paperclip_preview(item, attachment, options = {})
24
- data = item.send(attachment)
25
- return unless data.exists?
26
-
27
- styles = data.styles.keys
28
- if data.content_type =~ /^image\/.+/ && styles.include?(Typus.file_preview) && styles.include?(Typus.file_thumbnail)
29
- render "admin/templates/paperclip_preview",
30
- :preview => data.url(Typus.file_preview, false),
31
- :thumb => data.url(Typus.file_thumbnail, false),
32
- :options => options
33
- else
34
- link_to data.original_filename, data.url(:original, false)
23
+ if (data = item.send(attachment)).exists?
24
+ styles = data.styles.keys
25
+ if data.content_type =~ /^image\/.+/ && styles.include?(Typus.file_preview) && styles.include?(Typus.file_thumbnail)
26
+ render "admin/templates/paperclip_preview",
27
+ :preview => data.url(Typus.file_preview, false),
28
+ :thumb => data.url(Typus.file_thumbnail, false),
29
+ :options => options
30
+ else
31
+ link_to data.original_filename, data.url(:original, false)
32
+ end
35
33
  end
36
34
  end
37
35
 
@@ -8,6 +8,7 @@ module Admin::Resources::DataTypes::StringHelper
8
8
  alias_method :display_position, :display_string
9
9
  alias_method :display_integer, :display_string
10
10
  alias_method :display_decimal, :display_string
11
+ alias_method :display_float, :display_string
11
12
 
12
13
  def string_filter(filter)
13
14
  values = set_context.send(filter.to_s).to_a
@@ -25,5 +26,6 @@ module Admin::Resources::DataTypes::StringHelper
25
26
  alias :table_float_field :table_string_field
26
27
  alias :table_integer_field :table_string_field
27
28
  alias :table_virtual_field :table_string_field
29
+ alias :table_password_field :table_string_field
28
30
 
29
31
  end
@@ -1,27 +1,25 @@
1
1
  module Admin::Resources::FiltersHelper
2
2
 
3
3
  def build_filters(resource = @resource, params = params)
4
- typus_filters = resource.typus_filters
4
+ if (typus_filters = resource.typus_filters).any?
5
+ locals = {}
5
6
 
6
- return if typus_filters.empty?
7
+ locals[:filters] = typus_filters.map do |key, value|
8
+ { :filter => set_filter(key, value), :items => send("#{value}_filter", key) }
9
+ end
7
10
 
8
- locals = {}
11
+ locals[:hidden_filters] = params.dup
9
12
 
10
- locals[:filters] = typus_filters.map do |key, value|
11
- { :filter => set_filter(key, value), :items => send("#{value}_filter", key) }
12
- end
13
+ # Remove default params.
14
+ rejections = %w(controller action locale utf8 sort_order order_by)
15
+ locals[:hidden_filters].delete_if { |k, v| rejections.include?(k) }
13
16
 
14
- locals[:hidden_filters] = params.dup
17
+ # Remove also custom params.
18
+ rejections = locals[:filters].map { |f| f[:filter] }
19
+ locals[:hidden_filters].delete_if { |k, v| rejections.include?(k) }
15
20
 
16
- # Remove default params.
17
- rejections = %w(controller action locale utf8 sort_order order_by)
18
- locals[:hidden_filters].delete_if { |k, v| rejections.include?(k) }
19
-
20
- # Remove also custom params.
21
- rejections = locals[:filters].map { |f| f[:filter] }
22
- locals[:hidden_filters].delete_if { |k, v| rejections.include?(k) }
23
-
24
- render "helpers/admin/resources/filters", locals
21
+ render "helpers/admin/resources/filters", locals
22
+ end
25
23
  end
26
24
 
27
25
  def set_filter(key, value)
@@ -39,11 +39,7 @@ module Admin::Resources::RelationshipsHelper
39
39
  end
40
40
 
41
41
  def set_condition
42
- if @resource.typus_user_id? && admin_user.is_not_root?
43
- admin_user.owns?(@item)
44
- else
45
- true
46
- end
42
+ (@resource.typus_user_id? && admin_user.is_not_root?) ? admin_user.owns?(@item) : true
47
43
  end
48
44
 
49
45
  def set_conditions
@@ -15,7 +15,7 @@ module Admin::ResourcesHelper
15
15
  resources = ActiveSupport::OrderedHash.new
16
16
  app_name = @resource.typus_application
17
17
 
18
- admin_user.application(app_name).sort { |a,b| a.typus_constantize.model_name.human <=> b.typus_constantize.model_name.human }.each do |resource|
18
+ admin_user.application(app_name) { |a,b| a.typus_constantize.model_name.human <=> b.typus_constantize.model_name.human }.each do |resource|
19
19
  klass = resource.typus_constantize
20
20
  resources[resource] = [ link_to_unless_current(Typus::I18n.t("All #{klass.model_name.human.pluralize}"), :action => "index") ]
21
21
  resources[resource] << link_to_unless_current(Typus::I18n.t("Add New"), :action => "new") if admin_user.can?("create", klass)
@@ -3,8 +3,7 @@ class Admin::Mailer < ActionMailer::Base
3
3
  default :from => Typus.mailer_sender
4
4
 
5
5
  def reset_password_link(user, url)
6
- @user = user
7
- @url = url
6
+ @user, @url = user, url
8
7
 
9
8
  mail :to => user.email,
10
9
  :subject => "[#{Typus.admin_title}] #{Typus::I18n.t("Reset password")}"
@@ -0,0 +1,8 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
3
+ //= require jquery.fancybox-1.3.4.pack.js
4
+ //= require jquery.rails.autocomplete
5
+ //= require jquery.searchField
6
+ //= require jquery.tokeninput.js
7
+ //= require typus/jquery.application
8
+ //= require typus/application
@@ -1,3 +1,2 @@
1
-
2
1
  // Create the file `app/assets/javascripts/typus/application.js` in your
3
2
  // application if you need/want to extend some javascript functionality.
@@ -1,7 +1,8 @@
1
1
  /*
2
+ *= require jquery.fancybox-1.3.4.css
3
+ *= require token-input.css
2
4
  *= require typus/reset
3
5
  *= require typus/screen
4
6
  *= require typus/pagination
5
- *= require_tree ../vendor
6
7
  *= require typus/application
7
8
  */
@@ -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,5 +1,5 @@
1
1
  <% content_for :javascripts do %>
2
- <%= javascript_include_tag '/vendor/ckeditor/ckeditor' %>
2
+ <%= javascript_include_tag 'ckeditor' %>
3
3
  <% end %>
4
4
 
5
5
  <%
@@ -1,5 +1,5 @@
1
1
  <% content_for :javascripts do %>
2
- <%= javascript_include_tag '/vendor/ckeditor/ckeditor' %>
2
+ <%= javascript_include_tag 'ckeditor' %>
3
3
  <% end %>
4
4
 
5
5
  <%
@@ -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"