bhf 0.4.2.2 → 0.4.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/app/controllers/bhf/application_controller.rb +2 -2
  2. data/app/controllers/bhf/embed_entries_controller.rb +8 -8
  3. data/app/controllers/bhf/entries_controller.rb +10 -10
  4. data/app/controllers/bhf/pages_controller.rb +2 -2
  5. data/app/helpers/bhf/application_helper.rb +3 -3
  6. data/app/helpers/bhf/entries_helper.rb +4 -4
  7. data/app/views/bhf/_user.haml +2 -2
  8. data/app/views/bhf/application/index.haml +1 -1
  9. data/app/views/bhf/entries/_form.haml +5 -5
  10. data/app/views/bhf/entries/_validation_errors.haml +1 -1
  11. data/app/views/bhf/entries/form/belongs_to/_account_scope.haml +1 -1
  12. data/app/views/bhf/entries/form/belongs_to/_radio.haml +1 -1
  13. data/app/views/bhf/entries/form/belongs_to/_select.haml +2 -2
  14. data/app/views/bhf/entries/form/belongs_to/_static.haml +1 -1
  15. data/app/views/bhf/entries/form/column/_array.haml +2 -2
  16. data/app/views/bhf/entries/form/column/_date.haml +1 -1
  17. data/app/views/bhf/entries/form/column/_file.haml +2 -2
  18. data/app/views/bhf/entries/form/column/_markdown.haml +2 -2
  19. data/app/views/bhf/entries/form/column/_multiple_fields.haml +1 -1
  20. data/app/views/bhf/entries/form/column/_number.haml +1 -1
  21. data/app/views/bhf/entries/form/column/_static.haml +1 -1
  22. data/app/views/bhf/entries/form/column/_wysiwyg.haml +1 -1
  23. data/app/views/bhf/entries/form/embeds_many/_static.haml +5 -5
  24. data/app/views/bhf/entries/form/embeds_one/_static.haml +5 -5
  25. data/app/views/bhf/entries/form/has_and_belongs_to_many/_account_scope.haml +1 -1
  26. data/app/views/bhf/entries/form/has_and_belongs_to_many/_static.haml +1 -1
  27. data/app/views/bhf/entries/form/has_many/_static.haml +4 -4
  28. data/app/views/bhf/entries/form/has_one/_account_scope.haml +1 -1
  29. data/app/views/bhf/entries/form/has_one/_static.haml +4 -4
  30. data/app/views/bhf/helper/_flash.haml +1 -1
  31. data/app/views/bhf/helper/_frontend_edit.haml +1 -1
  32. data/app/views/bhf/helper/_node.haml +3 -3
  33. data/app/views/bhf/helper/_reflection_node.haml +2 -2
  34. data/app/views/bhf/pages/_platform.haml +15 -15
  35. data/app/views/bhf/pages/_search.haml +7 -7
  36. data/app/views/bhf/pages/macro/belongs_to/_default.haml +1 -1
  37. data/app/views/bhf/pages/macro/column/_date.haml +1 -1
  38. data/app/views/bhf/pages/macro/column/_text.haml +1 -1
  39. data/app/views/bhf/pages/macro/embeds_many/_default.haml +1 -1
  40. data/app/views/bhf/pages/macro/embeds_one/_default.haml +1 -1
  41. data/app/views/bhf/pages/macro/has_and_belongs_to_many/_default.haml +1 -1
  42. data/app/views/bhf/pages/macro/has_many/_default.haml +1 -1
  43. data/app/views/bhf/pages/macro/has_one/_default.haml +1 -1
  44. data/app/views/bhf/pages/show.haml +1 -1
  45. data/app/views/kaminari/bhf/_next_page.html.haml +1 -1
  46. data/app/views/kaminari/bhf/_page.html.haml +1 -1
  47. data/app/views/kaminari/bhf/_prev_page.html.haml +1 -1
  48. data/app/views/layouts/bhf/application.haml +10 -11
  49. data/app/views/layouts/bhf/quick_edit.haml +2 -2
  50. data/config/routes.rb +6 -6
  51. data/lib/bhf/active_record/upload.rb +1 -1
  52. data/lib/bhf/form.rb +1 -1
  53. data/lib/bhf/i18n.rb +3 -3
  54. data/lib/bhf/mongoid/document.rb +2 -2
  55. data/lib/bhf/pagination.rb +14 -14
  56. data/lib/bhf/platform.rb +17 -17
  57. data/lib/bhf/view_helpers.rb +1 -1
  58. data/vendor/assets/images/bhf/ajax_loader.gif +0 -0
  59. data/vendor/assets/images/bhf/bg.png +0 -0
  60. data/vendor/assets/images/bhf/mooeditable-toolbarbuttons-tango.png +0 -0
  61. data/vendor/assets/images/bhf/pictos.png +0 -0
  62. data/vendor/assets/images/bhf/small_ajax_loader.gif +0 -0
  63. data/vendor/assets/images/bhf/small_ajax_loader_h.gif +0 -0
  64. data/vendor/assets/images/bhf/wmd-buttons.png +0 -0
  65. data/vendor/assets/images/logo_bhf.png +0 -0
  66. data/vendor/assets/javascripts/bhf/application.js +280 -0
  67. data/vendor/assets/javascripts/bhf/classes/AjaxEdit.js +104 -0
  68. data/vendor/assets/javascripts/bhf/classes/Ajaxify.js +63 -0
  69. data/vendor/assets/javascripts/bhf/classes/ArrayFields.js +25 -0
  70. data/vendor/assets/javascripts/bhf/classes/BrowserUpdate.js +185 -0
  71. data/vendor/assets/javascripts/bhf/classes/Datepicker.js +38 -0
  72. data/vendor/assets/javascripts/bhf/classes/MooEditable.js +1549 -0
  73. data/vendor/assets/javascripts/bhf/classes/MultipleFields.js +50 -0
  74. data/vendor/assets/javascripts/bhf_includes/wmd.js +1 -1
  75. data/vendor/assets/stylesheets/bhf/MooEditable.css.scss +176 -0
  76. data/vendor/assets/stylesheets/bhf/application.css.sass +1067 -0
  77. data/vendor/assets/stylesheets/bhf/functions.css.sass +137 -0
  78. data/vendor/assets/stylesheets/bhf/reset.css.sass +32 -0
  79. data/vendor/assets/stylesheets/bhf/typo.css.scss +62 -0
  80. metadata +24 -3
@@ -16,7 +16,7 @@ class Bhf::ApplicationController < ActionController::Base
16
16
  return true
17
17
  end
18
18
 
19
- redirect_to(send(Bhf::Engine.config.on_login_fail.to_sym), :error => t('bhf.helpers.user.login.error')) and return false
19
+ redirect_to(send(Bhf::Engine.config.on_login_fail.to_sym), error: t('bhf.helpers.user.login.error')) and return false
20
20
  end
21
21
 
22
22
  def setup_current_account
@@ -76,7 +76,7 @@ class Bhf::ApplicationController < ActionController::Base
76
76
  def set_message(type, model = nil)
77
77
  key = model && ActiveModel::Naming.singular(model)
78
78
 
79
- I18n.t("bhf.activerecord.notices.models.#{key}.#{type}", :model => model.model_name.human, :default => I18n.t("activerecord.notices.messages.#{type}"))
79
+ I18n.t("bhf.activerecord.notices.models.#{key}.#{type}", model: model.model_name.human, default: I18n.t("activerecord.notices.messages.#{type}"))
80
80
  end
81
81
 
82
82
  def init_time
@@ -3,13 +3,13 @@ class Bhf::EmbedEntriesController < Bhf::EntriesController
3
3
  def new
4
4
  @form_url = bhf_entry_embed_index_path(@platform.name, @model.get_embedded_parent(params[:entry_id]))
5
5
 
6
- render 'bhf/entries/new', ({:layout => 'bhf/quick_edit'} if @quick_edit) || {}
6
+ render 'bhf/entries/new', ({layout: 'bhf/quick_edit'} if @quick_edit) || {}
7
7
  end
8
8
 
9
9
  def edit
10
10
  @form_url = bhf_entry_embed_path(@platform.name, @model.get_embedded_parent(params[:entry_id]), @object)
11
11
 
12
- render 'bhf/entries/edit', ({:layout => 'bhf/quick_edit'} if @quick_edit) || {}
12
+ render 'bhf/entries/edit', ({layout: 'bhf/quick_edit'} if @quick_edit) || {}
13
13
  end
14
14
 
15
15
  def create
@@ -20,14 +20,14 @@ class Bhf::EmbedEntriesController < Bhf::EntriesController
20
20
 
21
21
  edit_path = edit_bhf_entry_embed_path(@platform.name, @model.get_embedded_parent(params[:entry_id]), @object)
22
22
  if @quick_edit
23
- render :json => object_to_bhf_display_hash.merge(:edit_path => edit_path), :status => :ok
23
+ render json: object_to_bhf_display_hash.merge(edit_path: edit_path), status: :ok
24
24
  else
25
- redirect_back_or_default(edit_path, :notice => set_message('create.success', @model))
25
+ redirect_back_or_default(edit_path, notice: set_message('create.success', @model))
26
26
  end
27
27
  else
28
28
  @form_url = bhf_entry_embed_index_path(@platform.name, @model.get_embedded_parent(params[:entry_id]))
29
29
 
30
- r_settings = {:status => :unprocessable_entity}
30
+ r_settings = {status: :unprocessable_entity}
31
31
  r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
32
32
  render 'bhf/entries/new', r_settings
33
33
  end
@@ -40,14 +40,14 @@ class Bhf::EmbedEntriesController < Bhf::EntriesController
40
40
  after_save
41
41
 
42
42
  if @quick_edit
43
- render :json => object_to_bhf_display_hash, :status => :ok
43
+ render json: object_to_bhf_display_hash, status: :ok
44
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))
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
46
  end
47
47
  else
48
48
  @form_url = bhf_entry_embed_path(@platform.name, @model.get_embedded_parent(params[:entry_id]), @object)
49
49
 
50
- r_settings = {:status => :unprocessable_entity}
50
+ r_settings = {status: :unprocessable_entity}
51
51
  r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
52
52
  render 'bhf/entries/edit', r_settings
53
53
  end
@@ -1,7 +1,7 @@
1
1
  class Bhf::EntriesController < Bhf::ApplicationController
2
2
  before_filter :load_platform, :load_model, :set_page, :set_quick_edit
3
- before_filter :load_object, :except => [:create, :new, :sort]
4
- before_filter :load_new_object, :only => [:create, :new]
3
+ before_filter :load_object, except: [:create, :new, :sort]
4
+ before_filter :load_new_object, only: [:create, :new]
5
5
 
6
6
  def new
7
7
  @form_url = bhf_entries_path(@platform.name)
@@ -10,7 +10,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
10
10
  def edit
11
11
  @form_url = bhf_entry_path(@platform.name, @object)
12
12
 
13
- render :layout => 'bhf/quick_edit' if @quick_edit
13
+ render layout: 'bhf/quick_edit' if @quick_edit
14
14
  end
15
15
 
16
16
  def create
@@ -19,7 +19,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
19
19
  manage_many_to_many
20
20
  after_save
21
21
 
22
- redirect_back_or_default(bhf_entry_path(@platform.name, @object), :notice => set_message('create.success', @model))
22
+ redirect_back_or_default(bhf_entry_path(@platform.name, @object), notice: set_message('create.success', @model))
23
23
  else
24
24
  @form_url = bhf_entries_path(@platform.name)
25
25
  render :new
@@ -33,14 +33,14 @@ class Bhf::EntriesController < Bhf::ApplicationController
33
33
  after_save
34
34
 
35
35
  if @quick_edit
36
- render :json => object_to_bhf_display_hash, :status => :ok
36
+ render json: object_to_bhf_display_hash, status: :ok
37
37
  else
38
- redirect_back_or_default(bhf_entry_path(@platform.name, @object), :notice => set_message('update.success', @model))
38
+ redirect_back_or_default(bhf_entry_path(@platform.name, @object), notice: set_message('update.success', @model))
39
39
  end
40
40
  else
41
41
  @form_url = bhf_entry_path(@platform.name, @object)
42
42
 
43
- r_settings = {:status => :unprocessable_entity}
43
+ r_settings = {status: :unprocessable_entity}
44
44
  r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
45
45
  render :edit, r_settings
46
46
  end
@@ -65,17 +65,17 @@ class Bhf::EntriesController < Bhf::ApplicationController
65
65
  if @quick_edit
66
66
  head :ok
67
67
  else
68
- redirect_back_or_default(bhf_page_url(@platform.page_name, :anchor => "#{@platform.name}_platform"), :notice => set_message('destory.success', @model))
68
+ redirect_back_or_default(bhf_page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), notice: set_message('destory.success', @model))
69
69
  end
70
70
  end
71
71
 
72
72
  private
73
73
 
74
74
  def object_to_bhf_display_hash
75
- @platform.columns.each_with_object({:to_bhf_s => @object.to_bhf_s}) do |column, hash|
75
+ @platform.columns.each_with_object({to_bhf_s: @object.to_bhf_s}) do |column, hash|
76
76
  unless column.field.macro == :column && @object.send(column.name).blank?
77
77
  p = "bhf/pages/macro/#{column.field.macro}/#{column.field.display_type}"
78
- hash[column.name] = render_to_string :partial => p, :locals => {:column => column, :object => @object}
78
+ hash[column.name] = render_to_string partial: p, locals: {column: column, object: @object}
79
79
  end
80
80
  end
81
81
  end
@@ -33,7 +33,7 @@ class Bhf::PagesController < Bhf::ApplicationController
33
33
  platform.pagination = Bhf::Pagination.new(platform.entries_per_page)
34
34
  paginate_platform_objects(platform)
35
35
 
36
- render :layout => false, :partial => 'platform', :locals => {:platform => platform}
36
+ render layout: false, partial: 'platform', locals: {platform: platform}
37
37
  end
38
38
 
39
39
  def check_params(platform)
@@ -47,7 +47,7 @@ class Bhf::PagesController < Bhf::ApplicationController
47
47
  per_page = params[platform.name][:per_page].to_i
48
48
  end
49
49
 
50
- return :page => page, :per_page => per_page
50
+ return { page: page, per_page: per_page }
51
51
  end
52
52
 
53
53
  def paginate_platform_objects(platform)
@@ -2,15 +2,15 @@ module Bhf
2
2
  module ApplicationHelper
3
3
 
4
4
  def new_t(platform)
5
- t("bhf.helpers.entry.models.#{platform.model_name}.new", :platform_name => platform.title_singular, :default => t('bhf.helpers.entry.new'))
5
+ t("bhf.helpers.entry.models.#{platform.model_name}.new", platform_name: platform.title_singular, default: t('bhf.helpers.entry.new'))
6
6
  end
7
7
 
8
8
  def edit_t(platform)
9
- t("bhf.helpers.entry.models.#{platform.model_name}.edit", :platform_name => platform.title_singular, :default => t('bhf.helpers.entry.edit'))
9
+ t("bhf.helpers.entry.models.#{platform.model_name}.edit", platform_name: platform.title_singular, default: t('bhf.helpers.entry.edit'))
10
10
  end
11
11
 
12
12
  def delete_t(platform)
13
- t("bhf.helpers.entry.models.#{platform.model_name}.delete", :platform_name => platform.title_singular, :default => t('bhf.helpers.entry.delete'))
13
+ t("bhf.helpers.entry.models.#{platform.model_name}.delete", platform_name: platform.title_singular, default: t('bhf.helpers.entry.delete'))
14
14
  end
15
15
 
16
16
  end
@@ -2,13 +2,13 @@ module Bhf
2
2
  module EntriesHelper
3
3
 
4
4
  def node(f, field, &block)
5
- render :partial => 'bhf/helper/node', :locals => {:f => f, :field => field, :input => with_output_buffer(&block)}
5
+ render partial: 'bhf/helper/node', locals: {f: f, field: field, input: with_output_buffer(&block)}
6
6
  end
7
7
 
8
8
  def reflection_node(f, field, &block)
9
9
  return if field.form_type == :static && f.object.new_record? && f.object.send(field.reflection.name).blank?
10
- render :partial => 'bhf/helper/reflection_node', :locals => {
11
- :f => f, :field => field, :input => with_output_buffer(&block)
10
+ render partial: 'bhf/helper/reflection_node', locals: {
11
+ f: f, field: field, input: with_output_buffer(&block)
12
12
  }
13
13
  end
14
14
 
@@ -19,7 +19,7 @@ module Bhf
19
19
  def reflection_title(f, field)
20
20
  title = f.object.class.human_attribute_name(field.reflection.name)
21
21
  if field.link
22
- title = t("bhf.platforms.#{field.link}.title", :count => f.object.send(field.reflection.name).to_a.count, :default => title)
22
+ title = t("bhf.platforms.#{field.link}.title", count: f.object.send(field.reflection.name).to_a.count, default: title)
23
23
  end
24
24
  title
25
25
  end
@@ -1,5 +1,5 @@
1
1
  - if defined?(current_account) && current_account
2
2
  %p.user
3
- = t('bhf.helpers.user.login.as', :user => current_account.to_bhf_s).html_safe
3
+ = t('bhf.helpers.user.login.as', user: current_account.to_bhf_s).html_safe
4
4
  - if self.respond_to?(Bhf::Engine.config.logout_path)
5
- = link_to t('bhf.helpers.user.logout.link'), self.send(Bhf::Engine.config.logout_path), :method => :delete
5
+ = link_to t('bhf.helpers.user.logout.link'), self.send(Bhf::Engine.config.logout_path), method: :delete
@@ -1,3 +1,3 @@
1
1
  %ul.basic_info_list
2
2
  - @config.pages.each do |page|
3
- %li= link_to t("bhf.pages.navigation.#{page}", :default => page.capitalize), bhf_page_path(page)
3
+ %li= link_to t("bhf.pages.navigation.#{page}", default: page.capitalize), bhf_page_path(page)
@@ -1,16 +1,16 @@
1
- - html = { :id => (:main_form unless @quick_edit), :multipart => (!@quick_edit && @platform.has_file_upload?) }
2
- = form_for @object, :url => @form_url, :builder => Bhf::Form::Builder, :html => html do |f|
1
+ - html = { id: (:main_form unless @quick_edit), multipart: (!@quick_edit && @platform.has_file_upload?) }
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 => 'bhf/entries/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
9
- = render :partial => "bhf/entries/form/#{field.macro}/#{field.form_type}", :locals => {:f => f, :field => field}
9
+ = render partial: "bhf/entries/form/#{field.macro}/#{field.form_type}", locals: {f: f, field: field}
10
10
 
11
11
  - unless @quick_edit
12
12
  .node
13
13
  .label
14
14
  .input
15
15
  = f.submit f.object.new_record? ? new_t(@platform) : edit_t(@platform)
16
- = link_to t('bhf.helpers.entry.cancel'), bhf_page_path(@platform.page_name), :class => 'cancel'
16
+ = link_to t('bhf.helpers.entry.cancel'), bhf_page_path(@platform.page_name), class: 'cancel'
@@ -1,5 +1,5 @@
1
1
  .error_explanation
2
- %h5= t 'bhf.helpers.validation.header', :error => pluralize(f.object.errors.count, t('bhf.helpers.validation.error')), :name => f.object.class.model_name.human
2
+ %h5= t 'bhf.helpers.validation.header', error: pluralize(f.object.errors.count, t('bhf.helpers.validation.error')), name: f.object.class.model_name.human
3
3
  %ul
4
4
  - f.object.errors.each do |name, message|
5
5
  %li= f.error_label name, message
@@ -1,2 +1,2 @@
1
1
  - data_source = current_account.send(field.reflection.name.to_s.pluralize)
2
- = render :partial => 'bhf/entries/form/belongs_to/select', :locals => {:data_source => data_source, :field => field, :f => f}
2
+ = render partial: 'bhf/entries/form/belongs_to/select', locals: {data_source: data_source, field: field, f: f}
@@ -4,5 +4,5 @@
4
4
  %ul
5
5
  - data_source.each do |obj|
6
6
  %li
7
- = f.radio_button fk, obj.id, :id => "belongs_to_#{fk}_#{obj.id}"
7
+ = f.radio_button fk, obj.id, id: "belongs_to_#{fk}_#{obj.id}"
8
8
  = label_tag "belongs_to_#{fk}_#{obj.id}", obj.to_bhf_s
@@ -3,5 +3,5 @@
3
3
  .node
4
4
  .label= f.label fk, reflection_title(f, field)
5
5
  .input
6
- = f.select fk, options_from_collection_for_select(data_source, :id, :to_bhf_s, f.object.send(fk)), :include_blank => true
7
- = render :partial => 'bhf/helper/field_errors', :locals => {:f => f, :field => fk}
6
+ = f.select fk, options_from_collection_for_select(data_source, :id, :to_bhf_s, f.object.send(fk)), include_blank: true
7
+ = render partial: 'bhf/helper/field_errors', locals: {f: f, field: fk}
@@ -1 +1 @@
1
- = render :partial => 'bhf/entries/form/has_one/static', :locals => {:ref_object => f.object.send(field.reflection.name), :field => field, :f => f}
1
+ = render partial: 'bhf/entries/form/has_one/static', locals: {ref_object: f.object.send(field.reflection.name), field: field, f: f}
@@ -2,7 +2,7 @@
2
2
  .array_holder
3
3
  = f.fields_for field.name do |x|
4
4
  - if f.object.send(field.name).blank?
5
- = x.text_field nil, :class => 'array_fields', :id => nil
5
+ = x.text_field nil, class: 'array_fields', id: nil
6
6
  - else
7
7
  - f.object.send(field.name).each do |entry|
8
- = x.text_field nil, :value => entry, :class => 'array_fields', :id => nil
8
+ = x.text_field nil, value: entry, class: 'array_fields', id: nil
@@ -1,2 +1,2 @@
1
1
  = node f, field do
2
- = f.text_field field.name, :class => "picker #{field.type}", :value => f.object.send(field.name) ? l(f.object.send(field.name), :format => '%Y-%m-%d %H:%M') : nil
2
+ = f.text_field field.name, class: "picker #{field.type}", value: f.object.send(field.name) ? l(f.object.send(field.name), format: '%Y-%m-%d %H:%M') : nil
@@ -11,9 +11,9 @@
11
11
  - file = f.object.send("#{field.name}_was")
12
12
  - if file.is_a?(String)
13
13
  - if is_image?(file)
14
- = image_tag file, :class => 'uploaded_image'
14
+ = image_tag file, class: 'uploaded_image'
15
15
  - else
16
- = link_to file, file, :class => 'uploaded_file'
16
+ = link_to file, file, class: 'uploaded_file'
17
17
  - unless file.blank?
18
18
  .file_delete
19
19
  = f_file.check_box :delete
@@ -2,12 +2,12 @@
2
2
 
3
3
  = node f, field do
4
4
  - if @quick_edit
5
- = f.text_area field.name, :class => 'markdown'
5
+ = f.text_area field.name, class: 'markdown'
6
6
  - else
7
7
  = javascript_include_tag 'bhf_includes/showdown.js'
8
8
  #wmd-editor.wmd-pane
9
9
  #wmd-button-bar
10
- = f.text_area field.name, :id => 'wmd-input', :class => 'markdown'
10
+ = f.text_area field.name, id: 'wmd-input', class: 'markdown'
11
11
  %h6.preview_switch
12
12
  Preview
13
13
  %span#toggle_html_preview HTML
@@ -1,2 +1,2 @@
1
1
  = node f, field do
2
- = f.text_field field.name, :class => 'multiple_fields', :'data-spliter' => (f.object.send("#{field.name}_spliter") if f.object.respond_to?(:"#{field.name}_spliter"))
2
+ = f.text_field field.name, class: 'multiple_fields', :'data-spliter' => (f.object.send("#{field.name}_spliter") if f.object.respond_to?(:"#{field.name}_spliter"))
@@ -1,2 +1,2 @@
1
1
  = node f, field do
2
- = f.text_field field.name, :class => 'number'
2
+ = f.text_field field.name, class: 'number'
@@ -3,6 +3,6 @@
3
3
  - if field.display_type == :primary_key
4
4
  %strong= value
5
5
  - elsif field.display_type == :date
6
- = l value, :format => :long
6
+ = l value, format: :long
7
7
  - else
8
8
  = value
@@ -1,2 +1,2 @@
1
1
  = node f, field do
2
- = f.text_area field.name, :class => 'wysiwyg'
2
+ = f.text_area field.name, class: 'wysiwyg'
@@ -1,12 +1,12 @@
1
1
  = reflection_node f, field do
2
2
  - ref_objects = f.object.send(field.reflection.name)
3
- %p.empty{:class => ('hide' unless ref_objects.blank?)}= t 'bhf.helpers.entry.empty', :count => 2
4
- %ul.relation{:class => field.macro}
3
+ %p.empty{class: ('hide' unless ref_objects.blank?)}= t 'bhf.helpers.entry.empty', count: 2
4
+ %ul.relation{class: field.macro}
5
5
  - ref_objects.each do |ref_object|
6
6
  %li
7
- = 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
7
+ = 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
8
8
  - if field.link
9
- = link_to '&times;'.html_safe, bhf_entry_embed_path(field.link, f.object, ref_object), :method => :delete, :class => :delete, :remote => true, :confirm => t('bhf.helpers.promts.confirm')
9
+ = link_to '&times;'.html_safe, bhf_entry_embed_path(field.link, f.object, ref_object), method: :delete, class: :delete, remote: true, confirm: t('bhf.helpers.promts.confirm')
10
10
 
11
11
  - if field.link
12
- = link_to '+', new_bhf_entry_embed_path(field.link, f.object), :class => 'add_field quick_edit'
12
+ = link_to '+', new_bhf_entry_embed_path(field.link, f.object), class: 'add_field quick_edit'
@@ -1,12 +1,12 @@
1
1
  = reflection_node f, field do
2
2
  - ref_object = f.object.send(field.reflection.name)
3
- %p.empty{:class => ('hide' if ref_object)}= t 'bhf.helpers.entry.empty', :count => 1
4
- %ul.relation{:class => field.macro}
3
+ %p.empty{class: ('hide' if ref_object)}= t 'bhf.helpers.entry.empty', count: 1
4
+ %ul.relation{class: field.macro}
5
5
  %li
6
6
  - if ref_object
7
- = 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
7
+ = 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
8
8
  - if field.link
9
- = link_to '&times;'.html_safe, bhf_entry_embed_path(field.link, f.object, ref_object), :method => :delete, :class => :delete, :remote => true, :confirm => t('bhf.helpers.promts.confirm')
9
+ = link_to '&times;'.html_safe, bhf_entry_embed_path(field.link, f.object, ref_object), method: :delete, class: :delete, remote: true, confirm: t('bhf.helpers.promts.confirm')
10
10
 
11
11
  - if field.link
12
- = link_to '+', new_bhf_entry_embed_path(field.link, f.object), :class => "add_field quick_edit #{('hide' if ref_object)}"
12
+ = link_to '+', new_bhf_entry_embed_path(field.link, f.object), class: "add_field quick_edit #{('hide' if ref_object)}"
@@ -1,2 +1,2 @@
1
1
  - data_source = current_account.send(field.reflection.name.to_s.pluralize)
2
- = render :partial => 'bhf/entries/form/has_and_belongs_to_many/check_box', :locals => {:data_source => data_source, :field => field, :f => f}
2
+ = render partial: 'bhf/entries/form/has_and_belongs_to_many/check_box', locals: {data_source: data_source, field: field, f: f}
@@ -1 +1 @@
1
- = render :partial => 'bhf/entries/form/has_many/static', :locals => {:ref_objects => f.object.send(field.reflection.name), :field => field, :f => f}
1
+ = render partial: 'bhf/entries/form/has_many/static', locals: {ref_objects: f.object.send(field.reflection.name), field: field, f: f}
@@ -1,9 +1,9 @@
1
1
  = reflection_node f, field do
2
2
  - ref_objects ||= f.object.send(field.reflection.name)
3
- %p.empty{:class => ('hide' unless ref_objects.blank?)}= t 'bhf.helpers.entry.empty', :count => 2
4
- %ul.relation{:class => field.macro}
3
+ %p.empty{class: ('hide' unless ref_objects.blank?)}= t 'bhf.helpers.entry.empty', count: 2
4
+ %ul.relation{class: field.macro}
5
5
  - ref_objects.each do |ref_object|
6
- %li= link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_path(field.link || 0, ref_object), :class => :quick_edit
6
+ %li= link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_path(field.link || 0, ref_object), class: :quick_edit
7
7
 
8
8
  -# if field.link
9
- = link_to '+', new_bhf_entry_path(field.link), :class => 'add_field quick_edit'
9
+ = link_to '+', new_bhf_entry_path(field.link), class: 'add_field quick_edit'
@@ -1,3 +1,3 @@
1
1
  - # TODO: this doesnt work
2
2
  - data_source = current_account.send(field.reflection.name.to_s.pluralize)
3
- = render :partial => 'bhf/entries/form/belongs_to/select', :locals => {:data_source => data_source, :field => field, :f => f}
3
+ = render partial: 'bhf/entries/form/belongs_to/select', locals: {data_source: data_source, field: field, f: f}
@@ -1,9 +1,9 @@
1
1
  = reflection_node f, field do
2
2
  - ref_object ||= f.object.send(field.reflection.name)
3
- %p.empty{:class => ('hide' if ref_object)}= t 'bhf.helpers.entry.empty', :count => 1
4
- %ul.relation{:class => field.macro}
3
+ %p.empty{class: ('hide' if ref_object)}= t 'bhf.helpers.entry.empty', count: 1
4
+ %ul.relation{class: field.macro}
5
5
  - if ref_object
6
- %li= link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_path(field.link || 0, ref_object), :class => :quick_edit
6
+ %li= link_to_if field.link, ref_object.to_bhf_s, edit_bhf_entry_path(field.link || 0, ref_object), class: :quick_edit
7
7
 
8
8
  -# if field.link
9
- = link_to '+', new_bhf_entry_path(field.link), :class => 'add_field quick_edit'
9
+ = link_to '+', new_bhf_entry_path(field.link), class: 'add_field quick_edit'
@@ -1,4 +1,4 @@
1
1
  - unless flash.blank?
2
2
  %ul#flash_massages
3
3
  - flash.each do |type, msg|
4
- %li{:class => type}= msg
4
+ %li{class: type}= msg
@@ -1 +1 @@
1
- = link_to t('bhf.helpers.entry.edit', :platform_name => object.to_bhf_s), edit_bhf_entry_path(platform_name, object), :class => 'bhf_edit'
1
+ = link_to t('bhf.helpers.entry.edit', platform_name: object.to_bhf_s), edit_bhf_entry_path(platform_name, object), class: 'bhf_edit'
@@ -1,6 +1,6 @@
1
- .node{:class => field.display_type}
1
+ .node{class: field.display_type}
2
2
  .label= f.label field.name
3
3
  .input
4
4
  = input
5
- = render :partial => 'bhf/helper/field_errors', :locals => {:f => f, :field => field.name}
6
- = render :partial => 'bhf/helper/info', :locals => {:info => field.info}
5
+ = render partial: 'bhf/helper/field_errors', locals: {f: f, field: field.name}
6
+ = render partial: 'bhf/helper/info', locals: {info: field.info}