lib/para/form_builder/containers.rb in para-0.6.9 vs lib/para/form_builder/containers.rb in para-0.7.0
- old
+ new
@@ -1,33 +1,29 @@
module Para
module FormBuilder
module Containers
def fieldset(options = {}, &block)
- template.content_tag(:div, class: 'block form-inputs') do
+ template.content_tag(:div, class: 'form-inputs') do
buffer = if (title = options[:title])
- template.content_tag(:div, class: 'form-group') do
- template.content_tag(:legend, title)
- end
+ template.content_tag(:legend, title)
else
''.html_safe
end
buffer + template.capture(&block)
end
end
def actions(options = {}, &block)
- template.content_tag(:div, class: 'block form-actions form-group') do
- template.content_tag(:div, class: 'col-sm-9 col-sm-offset-3') do
- if block
- template.capture(&block)
- else
- if options.empty?
- options[:only] = template.instance_variable_get(:@component).default_form_actions
- end
- actions_buttons_for(options).join("\n").html_safe
+ template.content_tag(:div, class: 'form-actions') do
+ if block
+ template.capture(&block)
+ else
+ if options.empty?
+ options[:only] = template.instance_variable_get(:@component).default_form_actions
end
+ actions_buttons_for(options).join("\n").html_safe
end
end
end
def actions_buttons_for(options)
@@ -43,11 +39,11 @@
def return_to_hidden_field
template.hidden_field_tag(:return_to, return_to_path)
end
def para_submit_button(options = {})
- button(:submit, ::I18n.t('para.shared.save'), name: '_save', class: 'btn-success')
+ button(:submit, ::I18n.t('para.shared.save'), name: '_save', class: 'btn-success btn-shadow')
end
def para_submit_and_edit_button
# Create a hidden field that will hold the last tab used by the user,
# allowing redirection and re-rendering to display it directly
@@ -57,24 +53,24 @@
)
button_tag = button(
:submit,
::I18n.t('para.shared.save_and_edit'),
- name: '_save_and_edit', class: 'btn-primary'
+ name: '_save_and_edit', class: 'btn-primary btn-shadow'
)
current_anchor_tag + button_tag
end
def para_submit_and_add_another_button
- button(:submit, ::I18n.t('para.shared.save_and_add_another_button'), name: '_save_and_add_another', class: 'btn-primary')
+ button(:submit, ::I18n.t('para.shared.save_and_add_another_button'), name: '_save_and_add_another', class: 'btn-primary btn-shadow')
end
def para_cancel_button
template.link_to(
::I18n.t('para.shared.cancel'),
return_to_path,
- class: 'btn btn-danger'
+ class: 'btn btn-danger btn-shadow'
)
end
def return_to_path
template.params[:return_to].presence || component_path