bhf 0.3.10 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/app/controllers/bhf/application_controller.rb +0 -2
  2. data/app/controllers/bhf/embed_entries_controller.rb +78 -0
  3. data/app/controllers/bhf/entries_controller.rb +7 -6
  4. data/app/controllers/bhf/pages_controller.rb +1 -0
  5. data/app/helpers/bhf/entries_helper.rb +8 -4
  6. data/app/views/bhf/entries/_form.haml +1 -1
  7. data/app/views/bhf/entries/edit.haml +1 -1
  8. data/app/views/bhf/entries/form/belongs_to/_select.haml +1 -1
  9. data/app/views/bhf/entries/form/belongs_to/_static.haml +2 -5
  10. data/app/views/bhf/entries/form/column/_array.haml +8 -0
  11. data/app/views/bhf/entries/form/embeds_many/_static.haml +14 -0
  12. data/app/views/bhf/entries/form/embeds_one/_static.haml +13 -0
  13. data/app/views/bhf/entries/form/has_and_belongs_to_many/_static.haml +2 -6
  14. data/app/views/bhf/entries/form/has_many/_static.haml +2 -6
  15. data/app/views/bhf/entries/form/has_one/_static.haml +2 -5
  16. data/app/views/bhf/entries/new.haml +1 -1
  17. data/app/views/bhf/helper/_reflection_node.haml +2 -2
  18. data/app/views/bhf/pages/_platform.haml +6 -8
  19. data/app/views/bhf/pages/macro/belongs_to/_default.haml +1 -1
  20. data/app/views/bhf/pages/macro/column/_array.haml +1 -0
  21. data/app/views/bhf/pages/macro/column/_boolean.haml +1 -1
  22. data/app/views/bhf/pages/macro/embeds_many/_default.haml +1 -0
  23. data/app/views/bhf/pages/macro/embeds_one/_default.haml +1 -0
  24. data/app/views/bhf/pages/macro/has_and_belongs_to_many/_default.haml +1 -2
  25. data/app/views/bhf/pages/macro/has_many/_default.haml +2 -2
  26. data/app/views/bhf/pages/macro/has_one/_default.haml +2 -2
  27. data/app/views/bhf/pages/show.haml +1 -1
  28. data/app/views/kaminari/bhf/_gap.html.haml +1 -0
  29. data/app/views/kaminari/bhf/_next_page.html.haml +2 -0
  30. data/app/views/kaminari/bhf/_page.html.haml +2 -0
  31. data/app/views/kaminari/bhf/_paginator.html.haml +10 -0
  32. data/app/views/kaminari/bhf/_prev_page.html.haml +2 -0
  33. data/app/views/layouts/bhf/application.haml +1 -1
  34. data/app/views/layouts/bhf/quick_edit.haml +4 -2
  35. data/config/locales/de.yml +3 -4
  36. data/config/locales/en.yml +9 -6
  37. data/config/routes.rb +1 -0
  38. data/lib/bhf.rb +1 -0
  39. data/lib/bhf/active_record/active_record.rb +11 -2
  40. data/lib/bhf/active_record/upload.rb +9 -9
  41. data/lib/bhf/data.rb +2 -2
  42. data/lib/bhf/mongoid/document.rb +138 -0
  43. data/lib/bhf/pagination.rb +42 -42
  44. data/lib/bhf/platform.rb +8 -9
  45. data/lib/engine.rb +1 -2
  46. data/public/images/bhf/pictos.png +0 -0
  47. data/public/javascripts/bhf.js +1 -1
  48. data/public/stylesheets/bhf.css +1 -1
  49. metadata +22 -23
  50. data/public/images/bhf/button_bg.png +0 -0
  51. data/public/images/bhf/button_bg_2.png +0 -0
  52. data/public/images/bhf/button_bg_a.png +0 -0
  53. data/public/images/bhf/icon_delete.png +0 -0
  54. data/public/images/bhf/icon_delete_a.png +0 -0
  55. data/public/images/bhf/icon_delete_h.png +0 -0
  56. data/public/images/bhf/icon_drag.png +0 -0
  57. data/public/images/bhf/icon_drag_a.png +0 -0
  58. data/public/images/bhf/icon_drag_h.png +0 -0
  59. data/public/images/bhf/icon_edit.png +0 -0
  60. data/public/images/bhf/icon_edit_a.png +0 -0
  61. data/public/images/bhf/icon_edit_h.png +0 -0
@@ -1,7 +1,5 @@
1
1
  class Bhf::ApplicationController < ActionController::Base
2
2
 
3
- protect_from_forgery
4
-
5
3
  before_filter :init_time, :check_admin_account, :setup_current_account, :load_config, :set_title
6
4
 
7
5
  helper_method :current_account
@@ -0,0 +1,78 @@
1
+ class Bhf::EmbedEntriesController < Bhf::EntriesController
2
+
3
+ def new
4
+ @form_url = bhf_entry_embed_index_path(@platform.name, @model.get_embedded_parent(params[:entry_id]))
5
+
6
+ render 'bhf/entries/new', ({:layout => 'bhf/quick_edit'} if @quick_edit) || {}
7
+ end
8
+
9
+ def edit
10
+ @form_url = bhf_entry_embed_path(@platform.name, @model.get_embedded_parent(params[:entry_id]), @object)
11
+
12
+ render 'bhf/entries/edit', ({:layout => 'bhf/quick_edit'} if @quick_edit) || {}
13
+ end
14
+
15
+ def create
16
+ before_save
17
+ if @object.save
18
+ manage_many_to_many
19
+ after_save
20
+
21
+ edit_path = edit_bhf_entry_embed_path(@platform.name, @model.get_embedded_parent(params[:entry_id]), @object)
22
+ if @quick_edit
23
+ render :json => object_to_bhf_display_hash.merge(:edit_path => edit_path), :status => :ok
24
+ else
25
+ redirect_back_or_default(edit_path, :notice => set_message('create.success', @model))
26
+ end
27
+ else
28
+ @form_url = bhf_entry_embed_index_path(@platform.name, @model.get_embedded_parent(params[:entry_id]))
29
+
30
+ r_settings = {:status => :unprocessable_entity}
31
+ r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
32
+ render 'bhf/entries/new', r_settings
33
+ end
34
+ end
35
+
36
+ def update
37
+ before_save
38
+ if @object.update_attributes(params[@model_sym])
39
+ manage_many_to_many
40
+ after_save
41
+
42
+ if @quick_edit
43
+ render :json => object_to_bhf_display_hash, :status => :ok
44
+ else
45
+ redirect_back_or_default(edit_bhf_entry_embed_path(@platform.name, @model.get_embedded_parent(params[:entry_id]), @object), :notice => set_message('update.success', @model))
46
+ end
47
+ else
48
+ @form_url = bhf_entry_embed_path(@platform.name, @model.get_embedded_parent(params[:entry_id]), @object)
49
+
50
+ r_settings = {:status => :unprocessable_entity}
51
+ r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
52
+ render 'bhf/entries/edit', r_settings
53
+ end
54
+ end
55
+
56
+ def destroy
57
+ @object.destroy
58
+ if @quick_edit
59
+ head :ok
60
+ else
61
+ redirect_back_or_default(bhf_page_path(@platform.page_name), :notice => set_message('destory.success', @model))
62
+ end
63
+ end
64
+
65
+
66
+ private
67
+
68
+ def load_object
69
+ @object = @model.bhf_find_embed(params[:entry_id], params[:id])
70
+ after_load
71
+ end
72
+
73
+ def load_new_object
74
+ @object = @model.bhf_new_embed(params[:entry_id], params[@model_sym])
75
+ after_load
76
+ end
77
+
78
+ end
@@ -1,11 +1,9 @@
1
1
  class Bhf::EntriesController < Bhf::ApplicationController
2
2
  before_filter :load_platform, :load_model, :set_page, :set_quick_edit
3
3
  before_filter :load_object, :except => [:create, :new, :sort]
4
+ before_filter :load_new_object, :only => [:create, :new]
4
5
 
5
6
  def new
6
- @object = @model.new
7
- after_load
8
-
9
7
  @form_url = bhf_entries_path(@platform.name)
10
8
  end
11
9
 
@@ -16,9 +14,6 @@ class Bhf::EntriesController < Bhf::ApplicationController
16
14
  end
17
15
 
18
16
  def create
19
- @object = @model.new(params[@model_sym])
20
- after_load
21
-
22
17
  before_save
23
18
  if @object.save
24
19
  manage_many_to_many
@@ -95,6 +90,11 @@ class Bhf::EntriesController < Bhf::ApplicationController
95
90
  after_load
96
91
  end
97
92
 
93
+ def load_new_object
94
+ @object = @model.new(params[@model_sym])
95
+ after_load
96
+ end
97
+
98
98
  def manage_many_to_many
99
99
  return unless params[:has_and_belongs_to_many]
100
100
  params[:has_and_belongs_to_many].each_pair do |relation, ids|
@@ -131,4 +131,5 @@ class Bhf::EntriesController < Bhf::ApplicationController
131
131
  def set_quick_edit
132
132
  @quick_edit = request.xhr?
133
133
  end
134
+
134
135
  end
@@ -14,6 +14,7 @@ class Bhf::PagesController < Bhf::ApplicationController
14
14
 
15
15
  @platforms = platform_options.each_with_object([]) do |opts, obj|
16
16
  platform = Bhf::Platform.new(opts, @page, current_account)
17
+ next if platform.model.bhf_embedded?
17
18
  platform.pagination = Bhf::Pagination.new(platform.entries_per_page)
18
19
  paginate_platform_objects(platform)
19
20
  obj << platform
@@ -13,11 +13,15 @@ module Bhf
13
13
  end
14
14
 
15
15
  def is_image?(file)
16
- ['.png', '.jpg', '.jpeg', '.gif', '.svg'].each do |file_extention|
17
- return true if file.downcase.include? file_extention
18
- end
19
- false
16
+ file.match(/\.png|\.jpg|\.jpeg|\.gif|\.svg/i).to_b
20
17
  end
21
18
 
19
+ def reflection_title(f, field)
20
+ title = f.object.class.human_attribute_name(field.reflection.name)
21
+ if field.link
22
+ title = t("bhf.platforms.#{field.link}.title", :count => f.object.send(field.reflection.name).to_a.count, :default => title)
23
+ end
24
+ title
25
+ end
22
26
  end
23
27
  end
@@ -2,7 +2,7 @@
2
2
  = form_for @object, :url => @form_url, :builder => Bhf::Form::Builder, :html => html do |f|
3
3
 
4
4
  - if f.object.errors.any?
5
- = render :partial => 'validation_errors', :locals => {:f => f}
5
+ = render :partial => 'bhf/entries/validation_errors', :locals => {:f => f}
6
6
 
7
7
  - @platform.fields.each do |field|
8
8
  - unless field.form_type == :hidden
@@ -1,2 +1,2 @@
1
1
  %h3= edit_t @platform
2
- = render 'form'
2
+ = render 'bhf/entries/form'
@@ -1,7 +1,7 @@
1
1
  - data_source ||= field.reflection.klass.all
2
2
  - fk = field.reflection.primary_key_name
3
3
  .node
4
- .label= f.label fk
4
+ .label= f.label fk, reflection_title(f, field)
5
5
  .input
6
6
  = f.select fk, options_from_collection_for_select(data_source, :id, :to_bhf_s, f.object.send(fk)), :include_blank => true
7
7
  = render :partial => 'bhf/helper/field_errors', :locals => {:f => f, :field => fk}
@@ -1,9 +1,6 @@
1
1
  = reflection_node f, field do
2
2
  - ref_object = f.object.send(field.reflection.name)
3
3
  - if ref_object.blank?
4
- = t 'bhf.helpers.entry.empty'
4
+ = t 'bhf.helpers.entry.empty', :count => 1
5
5
  - else
6
- - if field.link
7
- = link_to ref_object.to_bhf_s, edit_bhf_entry_path(field.link, ref_object), :class => 'quick_edit'
8
- - else
9
- = ref_object.to_bhf_s
6
+ = link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_path(field.link || 0, ref_object), :class => 'quick_edit'
@@ -0,0 +1,8 @@
1
+ = node f, field do
2
+ .array_holder
3
+ = f.fields_for field.name do |x|
4
+ - if f.object.send(field.name).blank?
5
+ = x.text_field nil, :class => 'array_fields', :id => nil
6
+ - else
7
+ - f.object.send(field.name).each do |entry|
8
+ = x.text_field nil, :value => entry, :class => 'array_fields', :id => nil
@@ -0,0 +1,14 @@
1
+ = reflection_node f, field do
2
+ - ref_objects = f.object.send(field.reflection.name)
3
+ - if ref_objects.blank?
4
+ = t 'bhf.helpers.entry.empty', :count => 2
5
+ - else
6
+ %ul.relation
7
+ - ref_objects.each do |ref_object|
8
+ %li
9
+ = link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_embed_path(field.link || 0, f.object, ref_object), :class => 'quick_edit'
10
+ = link_to_if field.link, '&times;'.html_safe, bhf_entry_embed_path(field.link || 0, f.object, ref_object), :method => :delete, :confirm => t('bhf.helpers.promts.confirm'), :class => 'delete', :remote => true
11
+
12
+ - # FIXME: empty ul js problem
13
+ - if field.link
14
+ = link_to '+', new_bhf_entry_embed_path(field.link, f.object), :class => 'add_field quick_edit'
@@ -0,0 +1,13 @@
1
+ = reflection_node f, field do
2
+ - ref_objects = f.object.send(field.reflection.name)
3
+ - if ref_objects.blank?
4
+ = t 'bhf.helpers.entry.empty', :count => 0
5
+ - else
6
+ %ul.relation
7
+ - ref_objects.to_a.each do |ref_object|
8
+ %li
9
+ = link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_embed_path(field.link || 0, f.object, ref_object), :class => 'quick_edit'
10
+ = link_to_if field.link, '&times;'.html_safe, bhf_entry_embed_path(field.link || 0, f.object, ref_object), :method => :delete, :confirm => t('bhf.helpers.promts.confirm'), :class => 'delete', :remote => true
11
+
12
+ - if field.link
13
+ = link_to '+', new_bhf_entry_embed_path(field.link, f.object), :class => 'add_field quick_edit'
@@ -1,12 +1,8 @@
1
1
  = reflection_node f, field do
2
2
  - ref_objects = f.object.send(field.reflection.name)
3
3
  - if ref_objects.blank?
4
- = t 'bhf.helpers.entries.empty'
4
+ = t 'bhf.helpers.entry.empty', :count => 2
5
5
  - else
6
6
  %ul
7
7
  - ref_objects.each do |ref_object|
8
- %li
9
- - if field.link
10
- = link_to ref_object.to_bhf_s, edit_bhf_entry_path(field.link, ref_object), :class => 'quick_edit'
11
- - else
12
- = ref_object.to_bhf_s
8
+ %li= link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_path(field.link || 0, ref_object), :class => 'quick_edit'
@@ -1,12 +1,8 @@
1
1
  = reflection_node f, field do
2
2
  - ref_objects = f.object.send(field.reflection.name)
3
3
  - if ref_objects.blank?
4
- = t 'bhf.helpers.entries.empty'
4
+ = t 'bhf.helpers.entry.empty', :count => 2
5
5
  - else
6
6
  %ul
7
7
  - ref_objects.each do |ref_object|
8
- %li
9
- - if field.link
10
- = link_to ref_object.to_bhf_s, edit_bhf_entry_path(field.link, ref_object), :class => 'quick_edit'
11
- - else
12
- = ref_object.to_bhf_s
8
+ %li= link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_path(field.link || 0, ref_object), :class => 'quick_edit'
@@ -1,9 +1,6 @@
1
1
  = reflection_node f, field do
2
2
  - ref_object = f.object.send(field.reflection.name)
3
3
  - if ref_object.blank?
4
- = t 'bhf.helpers.entry.empty'
4
+ = t 'bhf.helpers.entry.empty', :count => 1
5
5
  - else
6
- - if field.link
7
- = link_to ref_object.to_bhf_s, edit_bhf_entry_path(field.link, ref_object), :class => 'quick_edit'
8
- - else
9
- = ref_object.to_bhf_s
6
+ = link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_path(field.link || 0, ref_object), :class => 'quick_edit'
@@ -1,2 +1,2 @@
1
1
  %h3= new_t @platform
2
- = render 'form'
2
+ = render 'bhf/entries/form'
@@ -1,7 +1,7 @@
1
1
  .node
2
2
  .label
3
- %p= f.object.class.human_attribute_name(field.reflection.name)
3
+ %p= reflection_title(f, field)
4
4
  .input
5
5
  = input
6
6
  = render :partial => 'bhf/helper/field_errors', :locals => {:f => f, :field => field.reflection.name}
7
- = render :partial => 'bhf/helper/info', :locals => {:info => field.info}
7
+ = render :partial => 'bhf/helper/info', :locals => {:info => field.info}
@@ -13,9 +13,7 @@
13
13
  - platform.columns.each do |column|
14
14
  %th{:class => "#{column.field.macro} #{column.field.display_type} #{order_class(column.name, platform.name)}"}
15
15
  - column_name = platform.model.human_attribute_name(column.name)
16
- - link = link_to column_name, current_order_path(column.name, platform.name)
17
- = column.field.macro == :column ? link : column_name
18
-
16
+ = link_to_if column.field.macro == :column, column_name, current_order_path(column.name, platform.name)
19
17
  %th.action
20
18
 
21
19
  %tfoot
@@ -29,7 +27,7 @@
29
27
  - edit_link = edit_bhf_entry_path(platform.name, object)
30
28
  %tr{:id => "#{object.id}_#{platform.name}"}
31
29
  - if platform.sortable
32
- %td
30
+ %td.drag
33
31
  %span.handle &nbsp;
34
32
  - platform.columns.each do |column|
35
33
  %td{:class => "#{column.field.macro} #{column.field.display_type}", :'data-column-name' => column.name}
@@ -37,13 +35,13 @@
37
35
  - '&nbsp;'
38
36
  - else
39
37
  - render(:partial => "bhf/pages/macro/#{column.field.macro}/#{column.field.display_type}", :locals => {:column => column, :object => object})
40
-
41
- = has_link?(column.field.overwrite_display_type) ? a.html_safe : link_to(a.html_safe, edit_link, :class => 'quick_edit')
38
+ = link_to_if !has_link?(column.field.overwrite_display_type), a.html_safe, edit_link, :class => 'quick_edit'
39
+
42
40
  %td.action
43
41
  = link_to edit_t(platform), edit_link, :class => 'edit'
44
42
  = link_to delete_t(platform), bhf_entry_path(platform.name, object), :method => :delete, :confirm => t('bhf.helpers.promts.confirm'), :class => 'delete'
45
- -# TODO: :remote => true, authlogic problem?
43
+ - # TODO: :remote => true
46
44
  - else
47
45
  %td.no_entries{:colspan => platform.columns_count}
48
- = t 'bhf.pagination.info.nothing_found', :name => t('bhf.pagination.entries')
46
+ = t 'bhf.pagination.info', :name_zero => platform.title, :count => 0
49
47
  = link_to new_t(platform), new_bhf_entry_path(platform.name)
@@ -1,2 +1,2 @@
1
1
  - ref_object = object.send(column.name)
2
- = ref_object.blank? ? t('bhf.helpers.entry.empty') : ref_object.to_bhf_s
2
+ = ref_object.blank? ? t('bhf.helpers.entry.empty', :count => 1) : ref_object.to_bhf_s
@@ -0,0 +1 @@
1
+ = object.send(column.name)[0..5].join(', ')
@@ -1 +1 @@
1
- = t("bhf.helpers.boolean.#{object.send(column.name) ? 'a' : 'b'}")
1
+ = t("bhf.helpers.boolean.#{object.send(column.name) ? 'a' : 'b'}")
@@ -0,0 +1 @@
1
+ = render :partial => 'bhf/pages/macro/has_many/default', :locals => {:ref_objects => object.send(column.name)}
@@ -0,0 +1 @@
1
+ = render :partial => 'bhf/pages/macro/has_one/default', :locals => {:ref_object => object.send(column.name)}
@@ -1,2 +1 @@
1
- - ref_objects = object.send(column.name)
2
- = ref_objects.blank? ? t('bhf.helpers.entries.empty') : ref_objects.collect(&:to_bhf_s).join(', ')
1
+ = render :partial => 'bhf/pages/macro/has_many/default', :locals => {:ref_objects => object.send(column.name)}
@@ -1,2 +1,2 @@
1
- - ref_objects = object.send(column.name)
2
- = ref_objects.blank? ? t('bhf.helpers.entries.empty') : ref_objects.collect(&:to_bhf_s).join(', ')
1
+ - ref_objects ||= object.send(column.name)
2
+ = ref_objects.blank? ? t('bhf.helpers.entry.empty', :count => 2) : ref_objects.collect(&:to_bhf_s).join(', ')
@@ -1,2 +1,2 @@
1
- - ref_object = object.send(column.name)
2
- = ref_object.blank? ? t('bhf.helpers.entry.empty') : ref_object.to_bhf_s
1
+ - ref_object ||= object.send(column.name)
2
+ = ref_object.blank? ? t('bhf.helpers.entry.empty', :count => 1) : ref_object.to_bhf_s
@@ -1,3 +1,3 @@
1
- -# %h2= t('bhf.pages.headline')
1
+ - # %h2= t('bhf.pages.headline')
2
2
  - @platforms.each do |platform|
3
3
  .platform= render :partial => 'platform', :locals => {:platform => platform}
@@ -0,0 +1 @@
1
+ %span.page_number.gap= t('bhf.pagination.truncate')
@@ -0,0 +1,2 @@
1
+ = link_to_unless current_page.last?, t('bhf.pagination.next_label'), url, :remote => remote do |name|
2
+ %span= name
@@ -0,0 +1,2 @@
1
+ = link_to_unless page.current?, page, url, :remote => remote, :class => 'page_number' do |name|
2
+ %em= name
@@ -0,0 +1,10 @@
1
+ = paginator.render do
2
+ = prev_page_tag
3
+
4
+ - each_page do |page|
5
+ - if page.left_outer? || page.right_outer? || page.inside_window?
6
+ = page_tag page
7
+ - elsif !page.was_truncated?
8
+ = gap_tag
9
+
10
+ = next_page_tag
@@ -0,0 +1,2 @@
1
+ = link_to_unless current_page.first?, t('bhf.pagination.previous_label'), url, :remote => remote do |name|
2
+ %span= name
@@ -8,7 +8,7 @@
8
8
  - ([:bhf] + Bhf::Engine.config.css.to_a).each do |css|
9
9
  = stylesheet_link_tag "/stylesheets/#{css}"
10
10
  = javascript_include_tag '/javascripts/bhf'
11
- =# javascript_include_tag '/javascripts/bhf/mootools-core-1.3.2-full-compat-yc.js', '/javascripts/bhf/mootools-more-1.3.2.1.js', '/javascripts/bhf/mootools_rails_driver-0.4.1.js', '/javascripts/bhf/class/BrowserUpdate', '/javascripts/bhf/class/Ajaxify', '/javascripts/bhf/class/AjaxEdit', '/javascripts/bhf/class/MooEditable', '/javascripts/bhf/class/Datepicker', '/javascripts/bhf/class/MultipleFields', '/javascripts/bhf/bhf_application'
11
+ =# javascript_include_tag '/javascripts/bhf/mootools-core-1.3.2-full-compat-yc.js', '/javascripts/bhf/mootools-more-1.3.2.1.js', '/javascripts/bhf/mootools_rails_driver-0.4.1.js', '/javascripts/bhf/class/BrowserUpdate', '/javascripts/bhf/class/Ajaxify', '/javascripts/bhf/class/AjaxEdit', '/javascripts/bhf/class/MooEditable', '/javascripts/bhf/class/Datepicker', '/javascripts/bhf/class/MultipleFields', '/javascripts/bhf/class/ArrayFields', '/javascripts/bhf/bhf_application'
12
12
  %body
13
13
  %header
14
14
  %h1= link_to image_tag('/images/logo_bhf.png'), root_url
@@ -1,5 +1,7 @@
1
1
  %button.alt_button.cancel= t('bhf.quick_edit.buttons.cancel')
2
2
  %button.alt_button.open= t('bhf.quick_edit.buttons.open')
3
3
  = yield
4
- %button.save= t('bhf.quick_edit.buttons.save')
5
- %button.save_and_next= t('bhf.quick_edit.buttons.save_and_next')
4
+ .button.group
5
+ %button.save{:class => ('create' if @object.new_record?)}= @object.new_record? ? t('bhf.quick_edit.buttons.create') : t('bhf.quick_edit.buttons.save')
6
+ - unless @object.new_record?
7
+ %button.save_and_next{:title => t('bhf.quick_edit.buttons.save_and_next')}= t('bhf.quick_edit.buttons.save_and_next')
@@ -14,8 +14,6 @@ de:
14
14
  delete: "%{platform_name} löschen"
15
15
  empty: Leer
16
16
  cancel: Abbrechen
17
- entries:
18
- empty: Leer
19
17
  login:
20
18
  success: Login war erfolgreich
21
19
  error: Konnte nicht eingeloggen
@@ -34,14 +32,15 @@ de:
34
32
  cancel: Abbrechen
35
33
  open: Öffnen
36
34
  save: Speichern
37
- save_and_next: Speichern und weiter
35
+ create: Erstellen
36
+ save_and_next: Speichern und weiter zum nächsten Eintrag gehen
38
37
 
39
38
  pagination:
40
39
  previous_label: « Vorheriges
41
40
  next_label: Nächstes »
41
+ truncate: …
42
42
  load_more: Mehr anzeigen
43
43
  load_less: Weniger anzeigen
44
- entry: Eintrag
45
44
  entries: Einträge
46
45
  info:
47
46
  default: "Es werden <strong>%{offset_start} - %{offset_end}</strong> von <strong>%{count}</strong> %{name} angezeigt"