localized_scaffold 0.9

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.
Files changed (46) hide show
  1. data/Gemfile +6 -0
  2. data/README.rdoc +273 -0
  3. data/generators/locales/standard.de-FO.yml +106 -0
  4. data/generators/locales/standard.de.yml +106 -0
  5. data/generators/locales/standard.en.yml +106 -0
  6. data/generators/localized_devise_views_generator.rb +100 -0
  7. data/generators/localized_scaffold_generator.rb +624 -0
  8. data/generators/templates/devise/locales/devise.de-FO.yml +45 -0
  9. data/generators/templates/devise/locales/devise.de.yml +60 -0
  10. data/generators/templates/devise/locales/devise_views.de.yml +78 -0
  11. data/generators/templates/devise/locales/devise_views.en.yml +79 -0
  12. data/generators/templates/devise/views/confirmations/new.html.erb +23 -0
  13. data/generators/templates/devise/views/mailer/confirmation_instructions.html.erb +6 -0
  14. data/generators/templates/devise/views/mailer/reset_password_instructions.html.erb +8 -0
  15. data/generators/templates/devise/views/mailer/unlock_instructions.html.erb +6 -0
  16. data/generators/templates/devise/views/passwords/edit.html.erb +30 -0
  17. data/generators/templates/devise/views/passwords/new.html.erb +23 -0
  18. data/generators/templates/devise/views/registrations/edit.html.erb +54 -0
  19. data/generators/templates/devise/views/registrations/new.html.erb +34 -0
  20. data/generators/templates/devise/views/sessions/new.html.erb +32 -0
  21. data/generators/templates/devise/views/shared/_links.erb +25 -0
  22. data/generators/templates/devise/views/unlocks/new.html.erb +23 -0
  23. data/generators/templates/erb/scaffold/_form.html.erb +11 -0
  24. data/generators/templates/erb/scaffold/_index.html.erb +54 -0
  25. data/generators/templates/erb/scaffold/edit.html.erb +20 -0
  26. data/generators/templates/erb/scaffold/index.html.erb +73 -0
  27. data/generators/templates/erb/scaffold/layout.html.erb +51 -0
  28. data/generators/templates/erb/scaffold/new.html.erb +18 -0
  29. data/generators/templates/erb/scaffold/scaffold_generator.rb +57 -0
  30. data/generators/templates/erb/scaffold/show.html.erb +22 -0
  31. data/generators/templates/locales/de.yml +61 -0
  32. data/generators/templates/locales/en.yml +61 -0
  33. data/generators/templates/rails/helper/helper.rb +118 -0
  34. data/generators/templates/rails/helper/scaffold_helper.rb +53 -0
  35. data/generators/templates/rails/scaffold_controller/controller.rb +338 -0
  36. data/generators/templates/rails/stylesheets/templates/scaffold.css +203 -0
  37. data/generators/templates/test_unit/scaffold/templates/functional_test.rb +117 -0
  38. data/init.rb +3 -0
  39. data/install.rb +1 -0
  40. data/lib/tasks/localized_scaffold.rake +39 -0
  41. data/localized_scaffold.rb +7 -0
  42. data/rails/init.rb +3 -0
  43. data/test/localized_scaffold_test.rb +8 -0
  44. data/test/test_helper.rb +3 -0
  45. data/uninstall.rb +1 -0
  46. metadata +120 -0
@@ -0,0 +1,60 @@
1
+ en:
2
+ activerecord:
3
+ errors:
4
+ models:
5
+ <%= name %>:
6
+ attributes:
7
+ email:
8
+ not_found: "not found"
9
+ already_confirmed: "was already confirmed"
10
+ not_locked: "was not locked"
11
+
12
+ de:
13
+ activerecord:
14
+ errors:
15
+ models:
16
+ <%= name %>:
17
+ attributes:
18
+ email:
19
+ not_found: "nicht gefunden"
20
+ already_confirmed: "wurde bereits bestätigt"
21
+ not_locked: "war nicht gesperrt"
22
+
23
+ devise:
24
+ failure:
25
+ unauthenticated: "Du musst Dich anmelden oder registrieren bevor es
26
+ weitergeht."
27
+ unconfirmed: "Du musst Deinen Account bestätigen bevor es weitergeht."
28
+ locked: "Dein Account wurde gesperrt."
29
+ invalid: "Login oder Passwort ungültig."
30
+ invalid_token: "Ungültiger Autorisierungsschlüssel."
31
+ timeout: "Deine Session ist abgelaufen. Bitte melde Dich erneut an."
32
+ inactive: "Dein Account wurde noch nicht aktiviert."
33
+ sessions:
34
+ signed_in: "Erfolgreich angemeldet."
35
+ signed_out: "Erfolgreich abgemeldet."
36
+ passwords:
37
+ send_instructions: "Du erhältst in ein paar Minuten eine E-Mail mit
38
+ der Anleitung, wie Du Dein Passwort zurücksetzen kannst."
39
+ updated: "Dein Passwort wurde erfolgreich gesetzt. Du bist nun
40
+ angemeldet."
41
+ confirmations:
42
+ send_instructions: "Du erhältst in wenigen Minuten eine E-Mail mit der
43
+ Anleitung, wie Du Deinen Account aktivierst."
44
+ confirmed: "Dein Account wurde erfolgreich bestätigt. Du bist nun
45
+ angemeldet."
46
+ registrations:
47
+ signed_up: "Du hast Dich erfolgreich registriert und erhältst zur
48
+ Bestätigung eine E-Mail."
49
+ updated: "Du hast Deinen Account erfolgreich aktualisiert."
50
+ destroyed: "Auf Wiedersehen! Dein Account wurde erfolgreich gelöscht.
51
+ Wir hoffen trotzdem Dich bald wiederzusehen."
52
+ unlocks:
53
+ send_instructions: "Du erhältst in ein paar Minuten eine E-Mail mit
54
+ der Anleitung, wie Du Deinen Account entsperren kannst."
55
+ unlocked: "Dein Account wurde erfolgreich entsperrt. Du bist nun
56
+ angemeldet."
57
+ mailer:
58
+ confirmation_instructions: "Anleitung für die Aktivierung Deines Accounts"
59
+ reset_password_instructions: "Anleitung für das Zurücksetzen Deines Passworts"
60
+ unlock_instructions: "Anleitung für das Entsperren Deines Accounts"
@@ -0,0 +1,78 @@
1
+ de:
2
+ activerecord:
3
+ attributes:
4
+ <%= name %>:
5
+ email: "E-Mail-Adresse"
6
+ password: "Passwort"
7
+ current_password: "Aktuelles Passwort"
8
+ password_confirmation: "Passwort (Wiederholung)"
9
+ remember_me: "Anmeldung merken"
10
+
11
+ devise:
12
+ views:
13
+ cmds:
14
+ cancel_account: "Account löschen"
15
+ change_password: "Mein Passwort ändern"
16
+ confirm_account: "Account bestätigen"
17
+ forgot_password: "Passwort vergessen?"
18
+ missing_confirm_email: "Bestätigungsmail nicht erhalten?"
19
+ missing_unlock_email: "Entsperrinformation nicht erhalten?"
20
+ resend_confirmation: "Bestätigungslink zusenden"
21
+ reset_password: "Passwort zurücksetzen"
22
+ send_unlock_info: "Bestätigungsmail erneut zusenden"
23
+ sign_in: "Anmelden"
24
+ sign_up: "Registrieren"
25
+ unlock_account: "Account entsperren"
26
+
27
+ errors:
28
+ template:
29
+ header_message: "Daten konnten nicht gespeichert werden."
30
+ message: "Bitte folgende Felder überprüfen:"
31
+
32
+ confirmations:
33
+ title: "Bestätigungslink erneut zusenden"
34
+
35
+ mailer:
36
+ confirmation_instructions:
37
+ text: "<p>Hallo {{account}}!</p>
38
+ <p>Herzlich willkommen! Bitte jetzt noch den folgenden Link anklicken um den
39
+ Account zu bestätigen:</p>"
40
+
41
+ unlock_instructions:
42
+ text: "<p>Hallo {{account}}!</p>
43
+ <p>Dieser Account wurde zur Sicherheit gesperrt, da zu oft versucht wurde sich
44
+ damit mit einem falschen Passwort anzumelden.</p>
45
+ <p>Bitte den folgenden Link anklicken um den Account wieder zu entsperren:</p>"
46
+
47
+ reset_password_instructions:
48
+ upper: "<p>Hallo {{account}}!</p>
49
+ <p>Mit dem folgenden Link kann ein neues Passwort gesetzt werden:</p>"
50
+
51
+ lower: "<p>Wenn ein Fremder ein neues Passwort angefordert hat, dann
52
+ einfach die E-Mail ignorieren: Ohne den Link kann niemand etwas anstellen.</p>"
53
+
54
+ passwords:
55
+ edit:
56
+ title: "Passwort ändern"
57
+
58
+ new:
59
+ title: "Passwort vergessen?"
60
+
61
+ registrations:
62
+ current_password_info: "wird für das Setzen eines neuen Passworts
63
+ benötigt"
64
+ password_info: "nur wenn das Passwort geändert werden soll"
65
+
66
+ edit:
67
+ title: "Account {{account}} bearbeiten"
68
+ cancel_title: "Account löschen"
69
+ cancel_intro: "Unzufrieden?"
70
+
71
+ new:
72
+ title: "Registrierung"
73
+
74
+ sessions:
75
+ title: "Anmelden"
76
+
77
+ unlocks:
78
+ title: "Entsperrinformation zusenden"
@@ -0,0 +1,79 @@
1
+ en:
2
+ activerecord:
3
+ attributes:
4
+ <%= name %>:
5
+ email: "E-mail address"
6
+ password: "Password"
7
+ current_password: "Current password"
8
+ password_confirmation: "Password (confirmation)"
9
+ remember_me: "Remember me"
10
+
11
+ devise:
12
+ views:
13
+ cmds:
14
+ cancel_account: "Cancel my account"
15
+ change_password: "Change my password"
16
+ confirm_account: "Confirm my account"
17
+ forgot_password: "Forgot your password?"
18
+ missing_confirm_email: "Didn't receive confirmation instructions?"
19
+ missing_unlock_email: "Didn't receive unlock instructions?"
20
+ resend_confirmation: "Resend confirmation instructions"
21
+ reset_password: "Send me reset password instructions"
22
+ send_unlock_info: "Resend confirmation instructions"
23
+ sign_in: "Sign in"
24
+ sign_up: "Sign up"
25
+ unlock_account: "Unlock my account"
26
+
27
+ errors:
28
+ template:
29
+ header_message: "Could not save data."
30
+ message: "Please check the following fields:"
31
+
32
+ confirmations:
33
+ title: "Resend confirmation instructions"
34
+
35
+ mailer:
36
+ confirmation_instructions:
37
+ text: "<p>Welcome {{account}}!</p>
38
+ <p>You can confirm your account through the link below:</p>"
39
+
40
+ unlock_instructions:
41
+ text: "<p>Hello {{account}}!</p>
42
+ <p>Your account has been locked due to an excessive amount of unsuccessful
43
+ sign in attempts.</p>
44
+ <p>Click the link below to unlock your account:</p>"
45
+
46
+ reset_password_instructions:
47
+ upper: "<p>Hello {{account}}!</p>
48
+ <p>Someone has requested a link to change your password, and you can do this
49
+ through the link below.</p>"
50
+
51
+ lower: "<p>If you didn't request this, please ignore this email.</p>
52
+ <p>Your password won't change until you access the link above and create a
53
+ new one.</p>"
54
+
55
+ passwords:
56
+ edit:
57
+ title: "Change your password"
58
+
59
+ new:
60
+ title: "Forgot your password?"
61
+
62
+ registrations:
63
+ current_password_info: "we need your current password to confirm your
64
+ changes"
65
+ password_info: "leave blank if you don't want to change it"
66
+
67
+ edit:
68
+ title: "Edit {{account}}"
69
+ cancel_title: "Cancel my account"
70
+ cancel_intro: "Unhappy?"
71
+
72
+ new:
73
+ title: "Sign up"
74
+
75
+ sessions:
76
+ title: "Sign in"
77
+
78
+ unlocks:
79
+ title: "Resend unlock instructions"
@@ -0,0 +1,23 @@
1
+ <%% title(t('devise.views.confirmations.title')) %>
2
+
3
+ <%%= form_for(resource, :as => resource_name,
4
+ :url => confirmation_path(resource_name)) do |f| %>
5
+ <%%= f.error_messages :header_message => t('devise.views.errors.template.header_message'),
6
+ :message => t('devise.views.errors.template.message') %>
7
+
8
+ <div class="field">
9
+ <%%= f.label :email, t('activerecord.attributes.<%= name %>.email') %><br />
10
+ <%%= f.text_field :email %>
11
+ </div>
12
+
13
+ <p>
14
+ <%%= f.submit t('devise.views.cmds.resend_confirmation') %>
15
+
16
+ <span class="decent">
17
+ <%%= t('standard.labels.or') %>
18
+ <%%= link_to t('standard.cmds.cancel'), root_path %>
19
+ </span>
20
+ </p>
21
+ <%% end %>
22
+
23
+ <%%= render :partial => 'devise/shared/links' %>
@@ -0,0 +1,6 @@
1
+ <%%= t('devise.views.mailer.confirmation_instructions.text', :account => @resource.email) %>
2
+
3
+ <p>
4
+ <%%= link_to t('devise.views.cmds.confirm_account'),
5
+ confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>
6
+ </p>
@@ -0,0 +1,8 @@
1
+ <%%= t('devise.views.mailer.reset_password_instructions.upper', :account => @resource.email) %>
2
+
3
+ <p>
4
+ <%%= link_to t('devise.views.cmds.change_password'),
5
+ edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>
6
+ </p>
7
+
8
+ <%%= t('devise.views.mailer.reset_password_instructions.lower') %>
@@ -0,0 +1,6 @@
1
+ <%%= t('devise.views.mailer.unlock_instructions.text', :account => @resource.email) %>
2
+
3
+ <p>
4
+ <%%= link_to t('devise.views.cmds.unlock_account'),
5
+ unlock_url(@resource, :unlock_token => @resource.unlock_token) %>
6
+ </p>
@@ -0,0 +1,30 @@
1
+ <%% title(t('devise.views.passwords.edit.title')) %>
2
+
3
+ <%%= form_for(resource, :as => resource_name,
4
+ :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
5
+ <%%= f.error_messages :header_message => t('devise.views.errors.template.header_message'),
6
+ :message => t('devise.views.errors.template.message') %>
7
+ <%%= f.hidden_field :reset_password_token %>
8
+
9
+ <div class="field">
10
+ <%%= f.label :password, t('activerecord.attributes.<%= name %>.password') %><br />
11
+ <%%= f.password_field :password %>
12
+ </div>
13
+
14
+ <div class="field">
15
+ <%%= f.label :password_confirmation,
16
+ t('activerecord.attributes.<%= name %>.password_confirmation') %><br />
17
+ <%%= f.password_field :password_confirmation %>
18
+ </div>
19
+
20
+ <p>
21
+ <%%= f.submit t('devise.views.cmds.change_password') %>
22
+
23
+ <span class="decent">
24
+ <%%= t('standard.labels.or') %>
25
+ <%%= link_to t('standard.cmds.cancel'), root_path %>
26
+ </span>
27
+ </p>
28
+ <%% end %>
29
+
30
+ <%%= render :partial => 'devise/shared/links' %>
@@ -0,0 +1,23 @@
1
+ <%% title(t('devise.views.passwords.new.title')) %>
2
+
3
+ <%%= form_for(resource, :as => resource_name,
4
+ :url => password_path(resource_name)) do |f| %>
5
+ <%%= f.error_messages :header_message => t('devise.views.errors.template.header_message'),
6
+ :message => t('devise.views.errors.template.message') %>
7
+
8
+ <div class="field">
9
+ <%%= f.label :email, t('activerecord.attributes.<%= name %>.email') %><br />
10
+ <%%= f.text_field :email %>
11
+ </div>
12
+
13
+ <p>
14
+ <%%= f.submit t('devise.views.cmds.reset_password') %>
15
+
16
+ <span class="decent">
17
+ <%%= t('standard.labels.or') %>
18
+ <%%= link_to t('standard.cmds.cancel'), root_path %>
19
+ </span>
20
+ </p>
21
+ <%% end %>
22
+
23
+ <%%= render :partial => 'devise/shared/links' %>
@@ -0,0 +1,54 @@
1
+ <%% title(t('devise.views.registrations.edit.title',
2
+ :account => resource_name.to_s.humanize)) %>
3
+
4
+ <%%= form_for(resource, :as => resource_name,
5
+ :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
6
+ <%%= f.error_messages :header_message => t('devise.views.errors.template.header_message'),
7
+ :message => t('devise.views.errors.template.message') %>
8
+
9
+ <div class="field">
10
+ <%%= f.label :email, t('activerecord.attributes.<%= name %>.email') %><br />
11
+ </div>
12
+
13
+ <div class="field">
14
+ <%%= f.label :password, t('activerecord.attributes.<%= name %>.password') %>
15
+ <span class="decent">
16
+ <%%= t('devise.views.registrations.password_info') %>
17
+ </span><br />
18
+ <%%= f.password_field :password %>
19
+ </div>
20
+
21
+ <div class="field">
22
+ <%%= f.label :password_confirmation,
23
+ t('activerecord.attributes.<%= name %>.password_confirmation') %><br />
24
+ <%%= f.password_field :password_confirmation %>
25
+ </div>
26
+
27
+ <div class="field">
28
+ <%%= f.label :current_password, t('activerecord.attributes.<%= name %>.current_password') %>
29
+ <span class="decent">
30
+ <%%= t('devise.views.registrations.current_password_info') %>
31
+ </span><br />
32
+ <%%= f.password_field :current_password %>
33
+ </div>
34
+
35
+ <p>
36
+ <%%= f.submit t('standard.cmds.update') %>
37
+
38
+ <span class="decent">
39
+ <%%= t('standard.labels.or') %>
40
+ <%%= link_to t('standard.cmds.cancel'), root_path %>
41
+ </span>
42
+ </p>
43
+ <%% end %>
44
+
45
+ <h3><%%= t('devise.views.registrations.edit.cancel_title') %></h3>
46
+
47
+ <p>
48
+ <%%= t('devise.views.registrations.edit.cancel_intro') %>
49
+ <%%= link_to t('devise.views.cmds.cancel_account'),
50
+ registration_path(resource_name),
51
+ :confirm => t('standard.labels.are_you_sure'), :method => :delete %>.
52
+ </p>
53
+
54
+ <%%= link_to t('standard.cmds.back'), :back %>
@@ -0,0 +1,34 @@
1
+ <%% title(t('devise.views.registrations.new.title')) %>
2
+
3
+ <%%= form_for(resource, :as => resource_name,
4
+ :url => registration_path(resource_name)) do |f| %>
5
+ <%%= f.error_messages :header_message => t('devise.views.errors.template.header_message'),
6
+ :message => t('devise.views.errors.template.message') %>
7
+
8
+ <div class="field">
9
+ <%%= f.label :email, t('activerecord.attributes.<%= name %>.email') %><br />
10
+ <%%= f.text_field :email %>
11
+ </div>
12
+
13
+ <div class="field">
14
+ <%%= f.label :password, t('activerecord.attributes.<%= name %>.password') %><br />
15
+ <%%= f.password_field :password %>
16
+ </div>
17
+
18
+ <div class="field">
19
+ <%%= f.label :password_confirmation,
20
+ t('activerecord.attributes.<%= name %>.password_confirmation') %><br />
21
+ <%%= f.password_field :password_confirmation %>
22
+ </div>
23
+
24
+ <p>
25
+ <%%= f.submit t('devise.views.cmds.sign_up') %>
26
+
27
+ <span class="decent">
28
+ <%%= t('standard.labels.or') %>
29
+ <%%= link_to t('standard.cmds.cancel'), root_path %>
30
+ </span>
31
+ </p>
32
+ <%% end %>
33
+
34
+ <%%= render :partial => 'devise/shared/links' %>
@@ -0,0 +1,32 @@
1
+ <%% title(t('devise.views.sessions.title')) %>
2
+
3
+ <%%= form_for(resource, :as => resource_name,
4
+ :url => session_path(resource_name)) do |f| %>
5
+ <div class="field">
6
+ <%%= f.label :email, t('activerecord.attributes.<%= name %>.email') %><br />
7
+ <%%= f.text_field :email %>
8
+ </div>
9
+
10
+ <div class="field">
11
+ <%%= f.label :password, t('activerecord.attributes.<%= name %>.password') %><br />
12
+ <%%= f.password_field :password %>
13
+ </div>
14
+
15
+ <%% if devise_mapping.rememberable? -%>
16
+ <p>
17
+ <%%= f.check_box :remember_me %>
18
+ <%%= f.label :remember_me, t('activerecord.attributes.<%= name %>.remember_me') %>
19
+ </p>
20
+ <%% end -%>
21
+
22
+ <p>
23
+ <%%= f.submit t('devise.views.cmds.sign_in') %>
24
+
25
+ <span class="decent">
26
+ <%%= t('standard.labels.or') %>
27
+ <%%= link_to t('standard.cmds.cancel'), root_path %>
28
+ </span>
29
+ </p>
30
+ <%% end %>
31
+
32
+ <%%= render :partial => 'devise/shared/links' %>
@@ -0,0 +1,25 @@
1
+ <%%- if controller_name != 'sessions' %>
2
+ <%%= link_to t('devise.views.cmds.sign_in'),
3
+ new_session_path(resource_name) %><br />
4
+ <%% end -%>
5
+
6
+ <%%- if devise_mapping.registerable? && controller_name != 'registrations' %>
7
+ <%%= link_to t('devise.views.cmds.sign_up'),
8
+ new_registration_path(resource_name) %><br />
9
+ <%% end -%>
10
+
11
+ <%%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
12
+ <%%= link_to t('devise.views.cmds.forgot_password'),
13
+ new_password_path(resource_name) %><br />
14
+ <%% end -%>
15
+
16
+ <%%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
17
+ <%%= link_to t('devise.views.cmds.missing_confirm_email'),
18
+ new_confirmation_path(resource_name) %><br />
19
+ <%% end -%>
20
+
21
+ <%%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) &&
22
+ controller_name != 'unlocks' %>
23
+ <%%= link_to t('devise.views.cmds.missing_unlock_email'),
24
+ new_unlock_path(resource_name) %><br />
25
+ <%% end -%>
@@ -0,0 +1,23 @@
1
+ <%% title(t('devise.views.sessions.title')) %>
2
+
3
+ <%%= form_for(resource, :as => resource_name,
4
+ :url => unlock_path(resource_name)) do |f| %>
5
+ <%%= f.error_messages :header_message => t('devise.views.errors.template.header_message'),
6
+ :message => t('devise.views.errors.template.message') %>
7
+
8
+ <div class="field">
9
+ <%%= f.label :email, t('activerecord.attributes.<%= name %>.email') %><br />
10
+ <%%= f.text_field :email %>
11
+ </div>
12
+
13
+ <p>
14
+ <%%= f.submit t('devise.views.cmds.send_unlock_info') %>
15
+
16
+ <span class="decent">
17
+ <%%= t('standard.labels.or') %>
18
+ <%%= link_to t('standard.cmds.cancel'), root_path %>
19
+ </span>
20
+ </p>
21
+ <%% end %>
22
+
23
+ <%%= render :partial => 'devise/shared/links' %>
@@ -0,0 +1,11 @@
1
+ <% for attribute in attributes -%>
2
+ <%- next if has_belongsto? and attribute.name == "#{belongsto.file_name}_id" -%>
3
+ <div class="field">
4
+ <%%= f.label :<%= attribute.name %>, t('activerecord.attributes.<%= file_name %>.<%= attribute.name %>') %><br />
5
+ <%- if listifies.include? attribute.name -%>
6
+ <%%= f.select :<%= attribute.name %>, <%= class_name %>.<%= attribute.name.pluralize %>_for_select %>
7
+ <%- else -%>
8
+ <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
9
+ <%- end -%>
10
+ </div>
11
+ <% end -%>
@@ -0,0 +1,54 @@
1
+ <%- if has_belongsto? -%>
2
+ <h3>
3
+ <%%= t('<%= file_name %>.indexpartial.title', :parent => @<%= belongsto.file_name %>.id) %>
4
+ <%- else -%>
5
+ <h3>
6
+ <%%= t('<%= file_name %>.indexpartial.title') %>
7
+ <%- end -%>
8
+
9
+ <%%= link_to t('standard.cmds.add'), <%= path_of_with_belongsto_if_any(:method => :new) %>,
10
+ :class => 'small decent' %>
11
+
12
+ <%%- if (max ||= <%= plural_name %>.count) and <%= plural_name %>.count > max -%>
13
+ <%%= link_to t('standard.cmds.all'), <%= path_of_with_belongsto_if_any %>,
14
+ :class => 'small decent' %>
15
+ <%%- end -%>
16
+ </h3>
17
+
18
+ <%%- if <%= plural_name %>.count == 0 -%>
19
+ <p class="decent">
20
+ <%%= t('<%= file_name %>.indexpartial.empty') %>
21
+ </p>
22
+ <%%- else -%>
23
+ <table class="wide">
24
+ <tr>
25
+ <%- for attribute in attributes -%>
26
+ <%- next if has_belongsto? and attribute.name == "#{belongsto.file_name}_id" -%>
27
+ <th width="<%= 75 / index_attributes.length %>%"><%%= t('activerecord.attributes.<%= file_name %>.<%= attribute.name %>') %></th>
28
+ <%- end -%>
29
+ <th>&nbsp;</th>
30
+ </tr>
31
+
32
+ <%% <%= plural_name %>[0...max].each do |<%= singular_name %>| %>
33
+ <tr>
34
+ <%- for attribute in attributes -%>
35
+ <%- next if has_belongsto? and attribute.name == "#{belongsto.file_name}_id" -%>
36
+ <%- if listifies.include? attribute.name -%>
37
+ <td><%%= <%= class_name %>.<%= attribute.name %>_label(<%= singular_name %>.<%= attribute.name %>) %></td>
38
+ <%- else -%>
39
+ <td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
40
+ <%- end -%>
41
+ <%- end -%>
42
+
43
+ <td class="last cmds">
44
+ <%- if generate_showview? -%>
45
+ <%%= link_to t('standard.cmds.show'), <%= path_of_with_belongsto_if_any(:method => :show, :value1 => "#{singular_name}") %> %> |
46
+ <%- end -%>
47
+ <%%= link_to t('standard.cmds.edit'), <%= path_of_with_belongsto_if_any(:method => :edit, :value1 => "#{singular_name}") %> %> |
48
+ <%%= link_to t('standard.cmds.destroy'), <%= path_of_with_belongsto_if_any(:method => :show, :value1 => "#{singular_name}") %>,
49
+ :confirm => t('standard.labels.are_you_sure'), :method => :delete %>
50
+ </td>
51
+ </tr>
52
+ <%% end %>
53
+ </table>
54
+ <%%- end -%>
@@ -0,0 +1,20 @@
1
+ <%% title(t('<%= file_name %>.edit.title'), <%= file_name %>_breadcrumbs) %>
2
+
3
+ <%%= form_for(@<%= singular_name %>, :url => <%= path_of_with_belongsto_if_any(:method => :update) %>,
4
+ :html => { :multipart => true, :method => :put }) do |f| %>
5
+ <%%= f.error_messages :header_message => t('<%= file_name %>.errors.template.header_message'),
6
+ :message => t('<%= file_name %>.errors.template.message') %>
7
+
8
+ <%%= render :partial => 'form', :locals => { :f => f } %>
9
+
10
+ <p>
11
+ <%%= f.submit t('standard.cmds.update') %>
12
+
13
+ <span class="decent">
14
+ <%%= t('standard.labels.or') %>
15
+ <%%= link_to t('standard.cmds.cancel'), <%= path_of_with_belongsto_if_any(:method => :show) %> %> |
16
+ <%%= link_to t('standard.cmds.destroy'), <%= path_of_with_belongsto_if_any(:method => :show) %>,
17
+ :confirm => t('standard.labels.are_you_sure'), :method => :delete %>
18
+ </span>
19
+ </p>
20
+ <%% end %>
@@ -0,0 +1,73 @@
1
+ <%- if has_belongsto? -%>
2
+ <%% title(t('<%= file_name %>.index.title', :parent => @<%= belongsto.file_name %>.id),
3
+ <%= file_name %>_breadcrumbs) %>
4
+ <%- else -%>
5
+ <%% title(t('<%= file_name %>.index.title'), <%= file_name %>_breadcrumbs) %>
6
+ <%- end -%>
7
+
8
+ <%- if has_searchbar? and (has_javascript_jquery? or has_javascript_prototype?) -%>
9
+ <%% content_for(:patches) do %>
10
+ <script type="text/javascript">
11
+
12
+ <%- if has_javascript_jquery? -%>
13
+ $("input#searchbar-term").click(function(e) {
14
+ this.value = "";
15
+ });
16
+ <%- elsif has_javascript_prototype? -%>
17
+ $("searchbar-term").onclick = function() { $("searchbar-term").value = ""; }
18
+ <%- end -%>
19
+
20
+ </script>
21
+ <%% end %>
22
+
23
+ <%%= <%= file_name %>_searchbar(@searchbar.chars, @searchbar.term) %>
24
+
25
+ <%- end -%>
26
+ <table class="wide">
27
+ <tr>
28
+ <%- for attribute in index_attributes -%>
29
+ <%- next if has_belongsto? and attribute.name == "#{belongsto.file_name}_id" -%>
30
+ <th width="<%= 75 / index_attributes.length %>%"><%%= t('activerecord.attributes.<%= file_name %>.<%= attribute.name %>') %></th>
31
+ <%- end -%>
32
+ <th>&nbsp;</th>
33
+ </tr>
34
+
35
+ <%% @<%= plural_name %>.each do |<%= singular_name %>| %>
36
+ <tr>
37
+ <%- for attribute in index_attributes -%>
38
+ <%- next if has_belongsto? and attribute.name == "#{belongsto.file_name}_id" -%>
39
+ <%- if listifies.include? attribute.name -%>
40
+ <td><%%= <%= class_name %>.<%= attribute.name %>_label(<%= singular_name %>.<%= attribute.name %>) %></td>
41
+ <%- else -%>
42
+ <td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
43
+ <%- end -%>
44
+ <%- end -%>
45
+
46
+ <td class="last cmds">
47
+ <%- if generate_showview? -%>
48
+ <%%= link_to t('standard.cmds.show'), <%= path_of_with_belongsto_if_any(:method => :show, :value1 => "#{singular_name}") %> %> |
49
+ <%- end -%>
50
+ <%%= link_to t('standard.cmds.edit'), <%= path_of_with_belongsto_if_any(:method => :edit, :value1 => "#{singular_name}") %> %> |
51
+ <%%= link_to t('standard.cmds.destroy'), <%= path_of_with_belongsto_if_any(:method => :show, :value1 => "#{singular_name}") %>,
52
+ :confirm => t('standard.labels.are_you_sure'), :method => :delete %>
53
+ </td>
54
+ </tr>
55
+ <%% end %>
56
+ </table>
57
+
58
+ <p>
59
+ <%- if has_will_paginate? -%>
60
+ <%%= <%= file_name %>_pagination @<%= table_name %> %>
61
+
62
+ <%- end -%>
63
+ <%%= link_to t('<%= file_name %>.cmds.new'), <%= path_of_with_belongsto_if_any(:method => :new) %> %>
64
+
65
+ <span class="decent">
66
+ <%%= t('standard.labels.or') %>
67
+ <%- if has_belongsto? -%>
68
+ <%%= link_to t('standard.cmds.back'), <%= belongsto.singular_name %>_path(@<%= belongsto.singular_name %>) %>
69
+ <%- else -%>
70
+ <%%= link_to t('standard.cmds.home'), root_path %>
71
+ <%- end -%>
72
+ </span>
73
+ </p>