From d85485ef4e32d7667e0b319882d8b82afddc416a Mon Sep 17 00:00:00 2001 From: Edward Phillips Date: Sat, 29 Jun 2019 01:05:37 +0200 Subject: [PATCH] added conditional statement to _form.html.haml --- app/views/admin/tickets/_form.html.haml | 5 ++++- docker-compose.override.yml.example | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/admin/tickets/_form.html.haml b/app/views/admin/tickets/_form.html.haml index f66cea51..81bdcbbb 100644 --- a/app/views/admin/tickets/_form.html.haml +++ b/app/views/admin/tickets/_form.html.haml @@ -12,7 +12,10 @@ = f.input :title, input_html: { autofocus: true } = f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } } = f.input :price - = f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false + - if (@conference.tickets.count >= 1 && @ticket.new_record?) || @conference.tickets.count > 1 + = f.input :price_currency, as: :select, class: 'form-control', collection: [@conference.tickets.first.price_currency], include_blank: false + - else + = f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false = f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.' %p.text-right = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/docker-compose.override.yml.example b/docker-compose.override.yml.example index f5dca21d..16fbc57f 100644 --- a/docker-compose.override.yml.example +++ b/docker-compose.override.yml.example @@ -3,4 +3,4 @@ services: osem: build: args: - CONTAINER_USERID: 13042 + CONTAINER_USERID: 501