refinerycms-core 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/app/assets/javascripts/refinery/admin.js.erb +28 -33
  2. data/app/assets/javascripts/refinery/modal_dialogs.js.erb +29 -31
  3. data/app/assets/javascripts/refinery/submit_continue.js.coffee.erb +1 -0
  4. data/app/assets/javascripts/wymeditor/lang/nl.js +55 -45
  5. data/app/assets/javascripts/wymeditor/lang/pl.js +12 -1
  6. data/app/controllers/refinery/admin/core_controller.rb +1 -1
  7. data/app/controllers/refinery/admin/dialogs_controller.rb +25 -9
  8. data/app/views/refinery/admin/_form_actions.html.erb +3 -1
  9. data/lib/generators/refinery/dummy/dummy_generator.rb +2 -2
  10. data/lib/generators/refinery/dummy/templates/rails/{application.rb → application.rb.erb} +0 -0
  11. data/lib/generators/refinery/dummy/templates/rails/{boot.rb → boot.rb.erb} +0 -0
  12. data/lib/generators/refinery/engine/engine_generator.rb +5 -1
  13. data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/admin/{plural_name_controller.rb → plural_name_controller.rb.erb} +0 -0
  14. data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/{plural_name_controller.rb → plural_name_controller.rb.erb} +0 -0
  15. data/lib/generators/refinery/engine/templates/app/models/refinery/namespace/{singular_name.rb → singular_name.rb.erb} +7 -9
  16. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +1 -1
  17. data/lib/generators/refinery/engine/templates/config/locales/sk.yml +28 -0
  18. data/lib/generators/refinery/engine/templates/config/{routes.rb → routes.rb.erb} +0 -0
  19. data/lib/generators/refinery/engine/templates/db/migrate/{1_create_namespace_plural_name.rb → 1_create_namespace_plural_name.rb.erb} +0 -0
  20. data/lib/generators/refinery/engine/templates/db/{seeds.rb → seeds.rb.erb} +1 -1
  21. data/lib/generators/refinery/engine/templates/lib/generators/refinery/{extension_plural_name_generator.rb → extension_plural_name_generator.rb.erb} +0 -0
  22. data/lib/generators/refinery/engine/templates/lib/refinery/{plural_name.rb → plural_name.rb.erb} +0 -0
  23. data/lib/generators/refinery/engine/templates/lib/refinery/plural_name/{engine.rb → engine.rb.erb} +0 -0
  24. data/lib/generators/refinery/engine/templates/lib/{refinerycms-extension_plural_name.rb → refinerycms-extension_plural_name.rb.erb} +0 -0
  25. data/lib/generators/refinery/engine/templates/spec/models/refinery/namespace/{singular_name_spec.rb → singular_name_spec.rb.erb} +0 -0
  26. data/lib/generators/refinery/engine/templates/spec/requests/refinery/namespace/admin/{plural_name_spec.rb → plural_name_spec.rb.erb} +6 -6
  27. data/lib/generators/refinery/engine/templates/spec/spec_helper.rb +0 -2
  28. data/lib/generators/refinery/engine/templates/spec/support/factories/refinery/{plural_name.rb → plural_name.rb.erb} +0 -0
  29. data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/{plural_name_controller.rb → plural_name_controller.rb.erb} +4 -4
  30. data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/settings_controller.rb.erb +45 -0
  31. data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/{plural_name_controller.rb → plural_name_controller.rb.erb} +0 -0
  32. data/lib/generators/refinery/form/templates/app/mailers/refinery/namespace/{mailer.rb → mailer.rb.erb} +0 -0
  33. data/lib/generators/refinery/form/templates/app/models/refinery/namespace/{setting.rb → setting.rb.erb} +0 -0
  34. data/lib/generators/refinery/form/templates/app/models/refinery/namespace/{singular_name.rb → singular_name.rb.erb} +19 -14
  35. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +1 -1
  36. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_confirmation_email_form.html.erb +1 -1
  37. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_notification_recipients_form.html.erb +1 -1
  38. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb +4 -4
  39. data/lib/generators/refinery/form/templates/config/locales/cs.yml +78 -0
  40. data/lib/generators/refinery/form/templates/config/locales/sk.yml +78 -0
  41. data/lib/generators/refinery/form/templates/config/{routes.rb → routes.rb.erb} +2 -2
  42. data/lib/generators/refinery/form/templates/db/migrate/{1_create_plural_name.rb → 1_create_plural_name.rb.erb} +5 -4
  43. data/lib/generators/refinery/form/templates/db/{seeds.rb → seeds.rb.erb} +1 -1
  44. data/lib/generators/refinery/form/templates/lib/generators/refinery/{plural_name_generator.rb → plural_name_generator.rb.erb} +0 -0
  45. data/lib/generators/refinery/form/templates/lib/refinery/{plural_name.rb → plural_name.rb.erb} +0 -0
  46. data/lib/generators/refinery/form/templates/lib/refinery/plural_name/{engine.rb → engine.rb.erb} +0 -0
  47. data/lib/generators/refinery/form/templates/lib/{refinerycms-plural_name.rb → refinerycms-plural_name.rb.erb} +0 -0
  48. data/lib/refinery/cli.rb +73 -111
  49. data/lib/refinery/core.rb +8 -4
  50. data/lib/refinery/crud.rb +9 -5
  51. data/lib/refinery/extension_generation.rb +250 -214
  52. data/lib/refinery/version.rb +2 -2
  53. data/spec/helpers/refinery/custom_assets_helper_spec.rb +2 -2
  54. data/spec/helpers/refinery/pagination_helper_spec.rb +1 -1
  55. data/spec/lib/generators/refinery/cms/cms_generator_spec.rb +1 -1
  56. data/spec/lib/generators/refinery/core/core_generator_spec.rb +1 -1
  57. data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +9 -4
  58. data/spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb +1 -1
  59. data/spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb +1 -1
  60. data/spec/lib/generators/refinery/form/form_generator_spec.rb +1 -1
  61. data/spec/lib/refinery/application_controller_spec.rb +8 -0
  62. data/spec/lib/refinery/core_spec.rb +14 -5
  63. data/spec/lib/refinery/crud_spec.rb +106 -0
  64. data/spec/lib/refinery/plugin_spec.rb +1 -1
  65. data/spec/lib/refinery/plugins_spec.rb +1 -1
  66. data/spec/requests/refinery/admin/custom_assets_spec.rb +2 -2
  67. data/spec/requests/refinery/admin/dialogs_spec.rb +3 -2
  68. data/spec/requests/refinery/search_spec.rb +2 -2
  69. data/spec/support/database_cleaner.rb +8 -2
  70. data/spec/support/refinery.rb +1 -2
  71. metadata +37 -32
  72. data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/settings_controller.rb +0 -51
@@ -63,40 +63,35 @@ $.fn.applyMinimumHeightFromChildren = function() {
63
63
  }
64
64
 
65
65
  init_modal_dialogs = function(){
66
- $(document).on('click', 'a[href*="dialog=true"]:not(#dialog_container a)', function(e) {
67
- var $anchor = $(this),
68
- href = $anchor.attr('href'),
69
- width = parseInt($(href.match("width=([0-9]*)")).last().get(0), 10)||928,
70
- height = parseInt($(href.match("height=([0-9]*)")).last().get(0), 10)||473,
71
- title = $anchor.attr('title') || $anchor.attr('name') || $anchor.html() || null;
72
-
73
- href = href.replace(/((\&(amp\;)?)|\?)dialog\=true/, '')
74
- .replace(/((\&(amp\;)?)|\?)width\=\d+/, '')
75
- .replace(/((\&(amp\;)?)|\?)height\=\d+/, '')
76
- .replace(/(\?&(amp\;)?)/, '?')
77
- .replace(/\?$/, '');
78
-
79
- iframe_src = (iframe_src = href)
80
- + (iframe_src.indexOf('?') > -1 ? '&' : '?')
81
- + 'app_dialog=true&dialog=true';
82
-
83
- iframe = $("<iframe id='dialog_iframe' frameborder='0' marginheight='0' marginwidth='0' border='0'></iframe>");
84
- if(!$.browser.msie) { iframe.corner('8px'); }
85
- iframe.dialog({
86
- title: title
87
- , modal: true
88
- , resizable: false
89
- , autoOpen: true
90
- , width: width
91
- , height: height
92
- , open: onOpenDialog
93
- , close: onCloseDialog
94
- , open: function(event, ui) {
95
- iframe.attr('src', iframe_src);
96
- }
97
- });
66
+ $('a[href*="dialog=true"]').not('#dialog_container a').each(function(i, anchor) {
67
+ $(anchor).data({
68
+ 'dialog-width': parseInt($($(anchor).attr('href').match("width=([0-9]*)")).last().get(0), 10)||928
69
+ , 'dialog-height': parseInt($($(anchor).attr('href').match("height=([0-9]*)")).last().get(0), 10)||473
70
+ , 'dialog-title': ($(anchor).attr('title') || $(anchor).attr('name') || $(anchor).html() || null)
71
+ }).attr('href', $(anchor).attr('href').replace(/(&(amp;)?|\?)(dialog=true|(width|height)=\d+)/g, '')
72
+ .replace(/(\/[^&\?]*)&(amp;)?/, '$1?'))
73
+ .click(function(e){
74
+ $anchor = $(this);
75
+ iframe_src = (iframe_src = $anchor.attr('href'))
76
+ + (iframe_src.indexOf('?') > -1 ? '&' : '?')
77
+ + 'app_dialog=true&dialog=true';
78
+
79
+ iframe = $("<iframe id='dialog_iframe' frameborder='0' marginheight='0' marginwidth='0' border='0'></iframe>");
80
+ if(!$.browser.msie) { iframe.corner('8px'); }
81
+ iframe.dialog({
82
+ title: $anchor.data('dialog-title')
83
+ , modal: true
84
+ , resizable: false
85
+ , autoOpen: true
86
+ , width: $anchor.data('dialog-width')
87
+ , height: $anchor.data('dialog-height')
88
+ , open: onOpenDialog
89
+ , close: onCloseDialog
90
+ });
98
91
 
99
- e.preventDefault();
92
+ iframe.attr('src', iframe_src);
93
+ e.preventDefault();
94
+ });
100
95
  });
101
96
  };
102
97
 
@@ -1,36 +1,34 @@
1
+ <%# encoding: utf-8 %>
1
2
  init_modal_dialogs = function(){
2
- $(document).on('click', 'a[href*="dialog=true"]:not(#dialog_container a)', function(e) {
3
- var $anchor = $(this),
4
- href = $anchor.attr('href'),
5
- width = parseInt($(href.match("width=([0-9]*)")).last().get(0), 10)||928,
6
- height = parseInt($(href.match("height=([0-9]*)")).last().get(0), 10)||473,
7
- title = $anchor.attr('title') || $anchor.attr('name') || $anchor.html() || null;
8
-
9
- href = href.replace(/(\&(amp\;)?)?dialog\=true/, '')
10
- .replace(/(\&(amp\;)?)?width\=\d+/, '')
11
- .replace(/(\&(amp\;)?)?height\=\d+/, '')
12
- .replace(/(\?&(amp\;)?)/, '?')
13
- .replace(/\?$/, '');
14
-
15
- iframe_src = (iframe_src = href)
16
- + (iframe_src.indexOf('?') > -1 ? '&' : '?')
17
- + 'app_dialog=true&dialog=true';
18
-
19
- iframe = $("<iframe id='dialog_iframe' frameborder='0' marginheight='0' marginwidth='0' border='0'></iframe>");
20
- if(!$.browser.msie) { iframe.corner('8px'); }
21
- iframe.dialog({
22
- title: title
23
- , modal: true
24
- , resizable: false
25
- , autoOpen: true
26
- , width: width
27
- , height: height
28
- , open: onOpenDialog
29
- , close: onCloseDialog
3
+ $('a[href*="dialog=true"]').not('#dialog_container a').each(function(i, anchor) {
4
+ $(anchor).data({
5
+ 'dialog-width': parseInt($($(anchor).attr('href').match("width=([0-9]*)")).last().get(0), 10)||928
6
+ , 'dialog-height': parseInt($($(anchor).attr('href').match("height=([0-9]*)")).last().get(0), 10)||473
7
+ , 'dialog-title': ($(anchor).attr('title') || $(anchor).attr('name') || $(anchor).html() || null)
8
+ }).attr('href', $(anchor).attr('href').replace(/(&(amp;)?|\?)(dialog=true|(width|height)=\d+)/g, '')
9
+ .replace(/(\/[^&\?]*)&(amp;)?/, '$1?'))
10
+ .click(function(e){
11
+ $anchor = $(this);
12
+ iframe_src = (iframe_src = $anchor.attr('href'))
13
+ + (iframe_src.indexOf('?') > -1 ? '&' : '?')
14
+ + 'app_dialog=true&dialog=true';
15
+
16
+ iframe = $("<iframe id='dialog_iframe' frameborder='0' marginheight='0' marginwidth='0' border='0'></iframe>");
17
+ if(!$.browser.msie) { iframe.corner('8px'); }
18
+ iframe.dialog({
19
+ title: $anchor.data('dialog-title')
20
+ , modal: true
21
+ , resizable: false
22
+ , autoOpen: true
23
+ , width: $anchor.data('dialog-width')
24
+ , height: $anchor.data('dialog-height')
25
+ , open: onOpenDialog
26
+ , close: onCloseDialog
27
+ });
28
+
29
+ iframe.attr('src', iframe_src);
30
+ e.preventDefault();
30
31
  });
31
-
32
- iframe.attr('src', iframe_src);
33
- e.preventDefault();
34
32
  });
35
33
  };
36
34
 
@@ -1,3 +1,4 @@
1
+ <%# encoding: utf-8 %>
1
2
  @init_submit_continue = ->
2
3
  $("#submit_continue_button").click submit_and_continue
3
4
  $("form").change (e) ->
@@ -1,47 +1,57 @@
1
1
  WYMeditor.STRINGS['nl'] = {
2
- Strong: 'Sterk benadrukken',
3
- Bold: 'Vet',
4
- Emphasis: 'Benadrukken',
5
- Superscript: 'Bovenschrift',
6
- Subscript: 'Onderschrift',
7
- Ordered_List: 'Geordende lijst',
8
- Unordered_List: 'Ongeordende lijst',
9
- Indent: 'Inspringen',
10
- Outdent: 'Terugspringen',
11
- Undo: 'Ongedaan maken',
12
- Redo: 'Opnieuw uitvoeren',
13
- Link: 'Linken',
14
- Unlink: 'Ontlinken',
15
- Image: 'Afbeelding',
16
- Table: 'Tabel',
17
- HTML: 'HTML',
18
- Paragraph: 'Paragraaf',
19
- Heading_1: 'Kop 1',
20
- Heading_2: 'Kop 2',
21
- Heading_3: 'Kop 3',
22
- Heading_4: 'Kop 4',
23
- Heading_5: 'Kop 5',
24
- Heading_6: 'Kop 6',
25
- Preformatted: 'Voorgeformatteerd',
26
- Blockquote: 'Citaat',
27
- Table_Header: 'Tabel-kop',
28
- URL: 'URL',
29
- Title: 'Titel',
30
- Alternative_Text: 'Alternatieve tekst',
31
- Caption: 'Bijschrift',
32
- Summary: 'Summary',
33
- Number_Of_Rows: 'Aantal rijen',
34
- Number_Of_Cols: 'Aantal kolommen',
35
- Insert: 'Invoegen',
36
- Submit: 'Versturen',
37
- Cancel: 'Annuleren',
38
- Choose: 'Kiezen',
39
- Preview: 'Voorbeeld bekijken',
40
- Paste_From_Word: 'Plakken uit Word',
41
- Tools: 'Hulpmiddelen',
42
- Containers: 'Teksttypes',
43
- Classes: 'Klassen',
44
- Status: 'Status',
45
- Source_Code: 'Broncode',
46
- Css_Class: 'Gebruik CSS klasse'
2
+ Strong: 'Sterk benadrukken',
3
+ Bold: 'Vet',
4
+ Emphasis: 'Benadrukken',
5
+ Superscript: 'Bovenschrift',
6
+ Subscript: 'Onderschrift',
7
+ Ordered_List: 'Geordende lijst',
8
+ Unordered_List: 'Ongeordende lijst',
9
+ Indent: 'Inspringen',
10
+ Outdent: 'Terugspringen',
11
+ Undo: 'Ongedaan maken',
12
+ Redo: 'Opnieuw uitvoeren',
13
+ Link: 'Linken',
14
+ Unlink: 'Ontlinken',
15
+ Image: 'Afbeelding',
16
+ Table: 'Tabel',
17
+ HTML: 'HTML',
18
+ Paragraph: 'Paragraaf',
19
+ Heading_1: 'Kop 1',
20
+ Heading_2: 'Kop 2',
21
+ Heading_3: 'Kop 3',
22
+ Heading_4: 'Kop 4',
23
+ Heading_5: 'Kop 5',
24
+ Heading_6: 'Kop 6',
25
+ Preformatted: 'Voorgeformatteerd',
26
+ Blockquote: 'Citaat',
27
+ Table_Header: 'Tabel-kop',
28
+ URL: 'URL',
29
+ Title: 'Titel',
30
+ Alternative_Text: 'Alternatieve tekst',
31
+ Caption: 'Bijschrift',
32
+ Summary: 'Overzicht',
33
+ Number_Of_Rows: 'Aantal rijen',
34
+ Number_Of_Cols: 'Aantal kolommen',
35
+ Insert: 'Invoegen',
36
+ Submit: 'Versturen',
37
+ Cancel: 'Annuleren',
38
+ Choose: 'Kiezen',
39
+ Preview: 'Voorbeeld bekijken',
40
+ Paste_From_Word: 'Plakken uit Word',
41
+ Tools: 'Hulpmiddelen',
42
+ Containers: 'Teksttypes',
43
+ Classes: 'Klassen',
44
+ Status: 'Status',
45
+ Source_Code: 'Broncode',
46
+ Text_Align: 'Tekst uitlijnen',
47
+ Image_Align: 'Afbeelding uitlijnen',
48
+ Font_Size: 'Lettertype grootte',
49
+ Left: 'Links',
50
+ Right: 'Rechts',
51
+ Center: 'Midden',
52
+ Justify: 'Uitgevuld',
53
+ Small: 'Klein',
54
+ Normal: 'Normaal',
55
+ Large: 'Groot',
56
+ Apply_Style: 'Stijl'
47
57
  };
@@ -40,6 +40,17 @@ WYMeditor.STRINGS['pl'] = {
40
40
  Containers: 'Format',
41
41
  Classes: 'Styl',
42
42
  Status: 'Status',
43
- Source_Code: 'Kod źródłowy'
43
+ Source_Code: 'Kod źródłowy',
44
+ Apply_Style: 'Określ styl',
45
+ Text_Align: "Wyrównanie tekstu",
46
+ Left: "Do lewej",
47
+ Right: "Do prawej",
48
+ Center: "Do środka",
49
+ Justify: "Wyjustuj",
50
+ Image_Align: "Wyrównanie obrazka",
51
+ Font_Size: "Rozmiar teksru",
52
+ Small: "Mały",
53
+ Normal: "Normalny",
54
+ Large: "Duży"
44
55
  };
45
56
 
@@ -4,7 +4,7 @@ module Refinery
4
4
  def update_plugin_positions
5
5
  params[:menu].each_with_index do |plugin_name, index|
6
6
  if (plugin = current_refinery_user.plugins.find_by_name(plugin_name))
7
- plugin.update_attribute(:position, index)
7
+ plugin.update_attributes :position => index
8
8
  end
9
9
  end
10
10
  render :nothing => true
@@ -1,26 +1,42 @@
1
1
  module ::Refinery
2
2
  module Admin
3
3
  class DialogsController < ::Refinery::AdminController
4
+ TYPES = %w[image link]
5
+
6
+ before_filter :find_dialog_type, :find_iframe_src, :only => [:show]
7
+
4
8
  def index
5
9
  redirect_to refinery.admin_root_path
6
10
  end
7
11
 
8
12
  def show
9
- @dialog_type = params[:id].downcase
13
+ render :layout => false
14
+ end
15
+
16
+ def from_dialog?
17
+ true
18
+ end
19
+
20
+ protected
21
+ def find_dialog_type
22
+ error_404 if TYPES.exclude? params[:id].downcase
10
23
 
11
- url_params = params.reject {|key, value| key =~ /(action)|(controller)/}
24
+ @dialog_type = params[:id].downcase
25
+ end
12
26
 
13
- @iframe_src = if @dialog_type == 'image'
14
- refinery.insert_admin_images_path(url_params.merge(:id => nil, :modal => true))
27
+ def find_iframe_src
28
+ if @dialog_type == 'image'
29
+ @iframe_src = refinery.insert_admin_images_path(
30
+ url_params.merge(:modal => true)
31
+ )
15
32
  elsif @dialog_type == 'link'
16
- refinery.link_to_admin_pages_dialogs_path(url_params.merge(:id => nil))
33
+ @iframe_src = refinery.link_to_admin_pages_dialogs_path url_params
17
34
  end
18
-
19
- render :layout => false
20
35
  end
21
36
 
22
- def from_dialog?
23
- true
37
+ def url_params
38
+ params.reject {|key, value| /(action)|(controller)/ === key}.
39
+ merge :id => nil
24
40
  end
25
41
 
26
42
  end
@@ -64,7 +64,9 @@
64
64
  :title => delete_title,
65
65
  :id => delete_button_id,
66
66
  :method => :delete,
67
- :confirm => delete_confirmation,
67
+ :data => {
68
+ :confirm => delete_confirmation
69
+ },
68
70
  :class => "button confirm-delete") unless hide_delete %>
69
71
  <%= local_assigns[:after_delete_button] -%>
70
72
  </div>
@@ -31,8 +31,8 @@ module Refinery
31
31
  @database = options[:database]
32
32
 
33
33
  template "rails/database.yml", "#{dummy_path}/config/database.yml", :force => true
34
- template "rails/boot.rb", "#{dummy_path}/config/boot.rb", :force => true
35
- template "rails/application.rb", "#{dummy_path}/config/application.rb", :force => true
34
+ template "rails/boot.rb.erb", "#{dummy_path}/config/boot.rb", :force => true
35
+ template "rails/application.rb.erb", "#{dummy_path}/config/application.rb", :force => true
36
36
  template "rails/routes.rb", "#{dummy_path}/config/routes.rb", :force => true
37
37
  template "rails/Rakefile", "#{dummy_path}/Rakefile", :force => true
38
38
  end
@@ -7,7 +7,11 @@ module Refinery
7
7
 
8
8
  include Refinery::ExtensionGeneration
9
9
 
10
- class_option :skip_frontend, :type => :boolean, :default => false, :required => false, :desc => 'Generate extension without frontend'
10
+ class_option :skip_frontend,
11
+ :desc => 'Generate extension without frontend',
12
+ :type => :boolean,
13
+ :default => false,
14
+ :required => false
11
15
 
12
16
  def skip_frontend?
13
17
  options[:skip_frontend]
@@ -3,7 +3,8 @@ module Refinery
3
3
  class <%= class_name %> < Refinery::Core::BaseModel
4
4
  <% if table_name == namespacing.underscore.pluralize -%>
5
5
  self.table_name = 'refinery_<%= plural_name %>'
6
- <% end -%>
6
+ <% end %>
7
+ attr_accessible <%= names_for_attr_accessible.map { |n| ":#{n}" }.join(', ') %>, :position
7
8
  <% if localized? -%>
8
9
 
9
10
  translates <%= localized_attributes.map{|a| ":#{a.name}"}.join(', ') %>
@@ -12,9 +13,7 @@ module Refinery
12
13
  attr_accessible :locale
13
14
  end
14
15
  <% end -%>
15
- <% if (string_attributes = attributes.select{ |a| a.type.to_s =~ /string|text/ }.uniq).any? -%>
16
-
17
- attr_accessible <%= attributes.map { |attr| ":#{attr.name}" }.join(', ') %>, :position
16
+ <% if string_attributes.any? -%>
18
17
 
19
18
  acts_as_indexed :fields => <%= string_attributes.map{|s| s.name.to_sym}.inspect %>
20
19
 
@@ -26,14 +25,13 @@ module Refinery
26
25
  "Override def title in vendor/extensions/<%= namespacing.underscore %>/app/models/refinery/<%= namespacing.underscore %>/<%= singular_name %>.rb"
27
26
  end
28
27
  <% end -%>
29
- <% attributes.select{|a| a.type.to_s == 'image'}.uniq.each do |a| -%>
28
+ <% image_attributes.each do |a| -%>
30
29
 
31
- belongs_to :<%= a.name.gsub("_id", "") -%>, :class_name => '::Refinery::Image'
30
+ belongs_to :<%= a.name -%>, :class_name => '::Refinery::Image'
32
31
  <% end -%>
33
- <% attributes.select{|a| a.type.to_s == 'resource'}.uniq.each do |a| -%>
34
-
35
- belongs_to :<%= a.name.gsub("_id", "") %>, :class_name => '::Refinery::Resource'
32
+ <% resource_attributes.each do |a| -%>
36
33
 
34
+ belongs_to :<%= a.name %>, :class_name => '::Refinery::Resource'
37
35
  <% end -%>
38
36
  end
39
37
  end
@@ -30,4 +30,4 @@
30
30
  :confirm => t('message', :scope => 'refinery.admin.delete', :title => <%= singular_name %>.<%= title_attribute %>),
31
31
  :method => :delete %>
32
32
  </span>
33
- </li>
33
+ </li>
@@ -0,0 +1,28 @@
1
+ sk:
2
+ refinery:
3
+ plugins:
4
+ <%= plural_name %>:
5
+ title: <%= plural_name.titleize %>
6
+ <%= namespacing.underscore %>:
7
+ admin:
8
+ <%= plural_name %>:
9
+ actions:
10
+ create_new: Pridať <%= singular_name.titleize %>
11
+ reorder: Preusporiadať <%= singular_name.titleize.pluralize %>
12
+ reorder_done: Koniec radenia <%= singular_name.titleize.pluralize %>
13
+ records:
14
+ title: <%= plural_name.titleize %>
15
+ sorry_no_results: Ľutujeme, ale neboli nájdené žiadne výsledky.
16
+ no_items_yet: Nie sú vytvorené žiadne <%= singular_name.titleize.pluralize %>. Kliknite na "Pridať <%= singular_name.titleize %>" pre pridanie prvého <%= singular_name.titleize.downcase %>.
17
+ <%= singular_name %>:
18
+ view_live_html: Zobraziť náhľad <%= singular_name.titleize.downcase %><br/><em>(otvorí sa v novom okne)</em>
19
+ edit: Upraviť <%= singular_name.titleize.downcase %>
20
+ delete: Zmazať <%= singular_name.titleize.downcase %>
21
+ <%= plural_name %>:
22
+ show:
23
+ other: Daľšie <%= singular_name.titleize.pluralize %>
24
+ activerecord:
25
+ attributes:
26
+ 'refinery/<%= namespacing.underscore %>/<%= singular_name %>':<% attributes.each do |a| %>
27
+ <%= a.name %>: <%= a.name.titleize -%>
28
+ <% end -%>