Add default currencies
This commit is contained in:
parent
33d32b9294
commit
ff6497ea46
6 changed files with 11 additions and 4 deletions
|
|
@ -542,7 +542,7 @@ Style/NumericLiteralPrefix:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'spec/controllers/admin/conferences_controller_spec.rb'
|
- 'spec/controllers/admin/conferences_controller_spec.rb'
|
||||||
- 'spec/controllers/conference_registration_controller_spec.rb'
|
- 'spec/controllers/conference_registration_controller_spec.rb'
|
||||||
- 'spec/helpers/date_time_helper_spec.rb'
|
- 'spec/helpers/date_time_currency_helper_spec.rb'
|
||||||
- 'spec/models/conference_spec.rb'
|
- 'spec/models/conference_spec.rb'
|
||||||
- 'spec/models/email_settings_spec.rb'
|
- 'spec/models/email_settings_spec.rb'
|
||||||
- 'spec/models/registration_spec.rb'
|
- 'spec/models/registration_spec.rb'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
module DateTimeHelper
|
module DateTimeCurrencyHelper
|
||||||
##
|
##
|
||||||
# Includes functions related to date or time manipulations
|
# Includes functions related to date or time manipulations
|
||||||
##
|
##
|
||||||
|
|
@ -34,4 +34,8 @@ module DateTimeHelper
|
||||||
"#{h} h #{min.round} min"
|
"#{h} h #{min.round} min"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def currencies
|
||||||
|
default_currencies = YAML::load(ENV['OSEM_DEFAULT_CURRENCIES'])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
= f.input :title, input_html: { autofocus: true }
|
= f.input :title, input_html: { autofocus: true }
|
||||||
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }
|
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }
|
||||||
= f.input :price
|
= f.input :price
|
||||||
= f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false
|
= f.input :price_currency, as: :select, class: 'form-control', collection: currencies, include_blank: false
|
||||||
= f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.'
|
= f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.'
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||||
|
|
|
||||||
|
|
@ -80,3 +80,5 @@ RECAPTCHA_SECRET_KEY=""
|
||||||
|
|
||||||
# The url of the redis server
|
# The url of the redis server
|
||||||
OSEM_REDIS_URL='redis://localhost:6379/1'
|
OSEM_REDIS_URL='redis://localhost:6379/1'
|
||||||
|
|
||||||
|
OSEM_DEFAULT_CURRENCIES="['USD', 'EURO', 'GBP', 'INR', 'CNY']"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature Ticket do
|
feature Ticket do
|
||||||
|
ENV['OSEM_DEFAULT_CURRENCIES'] = "['USD', 'EURO', 'GBP', 'INR', 'CNY']"
|
||||||
let!(:conference) { create(:conference, title: 'ExampleCon') }
|
let!(:conference) { create(:conference, title: 'ExampleCon') }
|
||||||
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
|
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
|
||||||
let!(:organizer) { create(:user, email: 'admin@example.com', role_ids: [organizer_role.id]) }
|
let!(:organizer) { create(:user, email: 'admin@example.com', role_ids: [organizer_role.id]) }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe DateTimeHelper, type: :helper do
|
describe DateTimeCurrencyHelper, type: :helper do
|
||||||
|
|
||||||
describe 'format_datetime' do
|
describe 'format_datetime' do
|
||||||
it 'returns nothing if there is no parameter' do
|
it 'returns nothing if there is no parameter' do
|
||||||
Loading…
Add table
Add a link
Reference in a new issue