Created a new payment admin page

This commit is contained in:
Godwin
2016-08-14 00:38:10 -07:00
parent 070a292c2b
commit 2f375f7ff2
13 changed files with 781 additions and 481 deletions
+16 -15
View File
@@ -1,28 +1,29 @@
= columns(medium: 12) do
- if @registration.registration_fees_paid.present?
%p
%strong=_'articles.conference_registration.paragraphs.Payment_Made', :p, vars: { fees_paid: @registration.registration_fees_paid }
%strong=_'articles.conference_registration.paragraphs.Payment_Made', :p, vars: { fees_paid: (number_to_currency @registration.registration_fees_paid, unit: '$') }
= _'articles.conference_registration.paragraphs.Payment_Add'
= @this_conference.payment_message.html_safe if @this_conference.payment_message.present?
- elsif @this_conference.payment_message.present?
= @this_conference.payment_message.html_safe
- else
%p=_'articles.conference_registration.paragraphs.Payment', :p
%p=@this_conference.payment_message || (_'articles.conference_registration.paragraphs.Payment', :p)
= columns(large: 9, push: 1) do
= form_tag register_path(@this_conference.slug), :class => :payment do
= form_tag register_path(@this_conference.slug), class: :payment do
= hidden_field_tag :button, :payment
.three-options
= button_tag :amount_25, :name => :amount, :value => '25.0' do
=_! '$25.00'
= button_tag :amount_50, :name => :amount, :value => '50.0' do
=_! '$50.00'
= button_tag :amount_100, :name => :amount, :value => '100.0' do
= _!'$100.00'
= form_tag register_path(@this_conference.slug), :class => ['custom-payment', :centered] do
- payment_amounts = @this_conference.payment_amounts.present? ? @this_conference.payment_amounts : Conference.default_payment_amounts
.graded-options{class: "option-count-#{payment_amounts.size}"}
- payment_amounts.each_with_index do | amount, i |
= button_tag :amount_25, name: :amount, value: amount.to_f.to_s, class: "option-#{i + 1}" do
=_! (number_to_currency amount, unit: '$')
= form_tag register_path(@this_conference.slug), class: ['custom-payment', :centered] do
%span.currency=_!'$'
= numberfield :amount, nil, :required => true, :step => 0.01, :min => 0.00, label: false
= button_tag :custom_amount, :value => :payment
= numberfield :amount, nil, required: true, step: 0.01, min: 0.00, label: false
= button_tag :custom_amount, value: :payment
%p=_'articles.conference_registration.paragraphs.currency','(amounts are in $USD)'
= form_tag register_path(@this_conference.slug), :class => :payment do
= form_tag register_path(@this_conference.slug), class: :payment do
= hidden_field_tag :button, :payment
.actions.skip
= button_tag :skip, :name => :amount, :value => '0.0'
= button_tag :skip, name: :amount, value: '0.0'
= columns(large: 2)
@@ -1 +0,0 @@
%p= _'articles.conference_registration.paragraphs.admin.broadcast.sent'
@@ -4,12 +4,6 @@
- I18n.backend.enabled_locales.each do | locale |
- if locale.to_s != @this_conference.locale.to_s
= textarea "info_translations[#{locale.to_s}]", @this_conference._info(locale), label: 'translate.pages.Locale_Translation', vars: { language: _("languages.#{locale}") }, lang: locale, edit_on: :focus
%h4=_'articles.admin.edit.headings.paypal_info', :t
%p=(_'articles.admin.edit.paragraphs.paypal_info', :p).html_safe
= emailfield :paypal_email_address, @this_conference.paypal_email_address || @this_conference.email_address || (@this_conference.organizations.present? && @this_conference.organizations.first.present? ? @this_conference.organizations.first.email_address : nil)
= textfield :paypal_username, @this_conference.paypal_username
= passwordfield :paypal_password, @this_conference.paypal_password
= textfield :paypal_signature, @this_conference.paypal_signature
.actions.right
= button_tag :save, value: :save
%h4=_'articles.admin.edit.headings.host_organizations'
@@ -0,0 +1,20 @@
= form_tag administration_update_path(@this_conference.slug, :payment) do
= textarea :payment_message, (@this_conference.payment_message! || "<p>#{I18n.t('articles.conference_registration.paragraphs.Payment', locale: @this_conference.locale)}</p>"), help: 'articles.conference_registration.paragraphs.admin.payment.message', lang: @this_conference.locale, edit_on: :focus, short: true
- I18n.backend.enabled_locales.each do | locale |
- if locale.to_s != @this_conference.locale.to_s
= textarea "payment_message_translations[#{locale.to_s}]", (@this_conference._payment_message(locale) || "<p>#{I18n.t('articles.conference_registration.paragraphs.Payment', locale: locale)}</p>"), label: 'translate.pages.Locale_Translation', vars: { language: _("languages.#{locale}") }, lang: locale, edit_on: :focus, short: true
%h4=_'articles.admin.payment.headings.payment_amounts', :t
= fieldset :payment_amounts, help: 'articles.admin.payment.paragraphs.payment_amounts' do
- payment_amounts = @this_conference.payment_amounts.present? ? @this_conference.payment_amounts : Conference.default_payment_amounts
- for i in 1..5 do
= numberfield "payment_amounts[#{i - 1}]", payment_amounts[i - 1], step: 0.01, min: 0.00, label: false
%h4=_'articles.admin.edit.headings.paypal_info', :t
%p=(_'articles.admin.edit.paragraphs.paypal_info', :p).html_safe
= emailfield :paypal_email_address, @this_conference.paypal_email_address || @this_conference.email_address || (@this_conference.organizations.present? && @this_conference.organizations.first.present? ? @this_conference.organizations.first.email_address : nil)
= textfield :paypal_username, @this_conference.paypal_username
= passwordfield :paypal_password, @this_conference.paypal_password
= textfield :paypal_signature, @this_conference.paypal_signature
.actions.right
= button_tag :save, value: :save