diff --git a/app/controllers/payments_controller.rb b/app/controllers/payments_controller.rb index ca0217bca..17a4b94b2 100644 --- a/app/controllers/payments_controller.rb +++ b/app/controllers/payments_controller.rb @@ -50,7 +50,8 @@ def create notice: 'Thanks! Your ticket is booked successfully.' end else - @total_amount_to_pay = convert_currency(@conference, Ticket.total_price(@conference, current_user, paid: false), from_currency, selected_currency) + # TODO-SNAPCON: This case is not tested at all + @total_amount_to_pay = CurrencyConversion.convert_currency(@conference, Ticket.total_price(@conference, current_user, paid: false), from_currency, selected_currency) @unpaid_ticket_purchases = current_user.ticket_purchases.unpaid.by_conference(@conference) flash.now[:error] = @payment.errors.full_messages.to_sentence + ' Please try again with correct credentials.' render :new diff --git a/app/models/payment.rb b/app/models/payment.rb index 5fa61c2f9..6ae089a0a 100644 --- a/app/models/payment.rb +++ b/app/models/payment.rb @@ -7,7 +7,6 @@ # id :bigint not null, primary key # amount :integer # authorization_code :string -# currency :string # last4 :string # status :integer default("unpaid"), not null # created_at :datetime not null diff --git a/app/views/schedules/_date_event_types.haml b/app/views/schedules/_date_event_types.haml index 2ba3cd4d2..c129e782e 100644 --- a/app/views/schedules/_date_event_types.haml +++ b/app/views/schedules/_date_event_types.haml @@ -5,6 +5,8 @@ The conference timezone is #{timezone_mapping(conference.timezone)}. - if current_user Visit your #{link_to('user profile page', edit_user_path(current_user.id))} to set your timezone. + - else + (#{link_to('Log in', new_user_session_path)} to view the schedule in your preferred timezone.) - if current_user %p.text-center Click the star next to each event to add or remove it from diff --git a/app/views/schedules/_event.html.haml b/app/views/schedules/_event.html.haml index 122d3e1e1..e3438bde0 100644 --- a/app/views/schedules/_event.html.haml +++ b/app/views/schedules/_event.html.haml @@ -14,7 +14,7 @@ %h3.event-panel-title = link_to conference_program_proposal_path(@conference.short_title, event.id), - style: color_style do + style: "#{color_style}; line-height: 1.7" do = event.title - if event.subtitle.present? %br diff --git a/app/views/schedules/events.html.haml b/app/views/schedules/events.html.haml index 14a1669ca..0db544063 100644 --- a/app/views/schedules/events.html.haml +++ b/app/views/schedules/events.html.haml @@ -40,38 +40,33 @@ .row / scheduled events :ruby - date = nil - time = nil - tz_object = current_user&.timezone ? current_user : @conference + prev_date, prev_time = nil + display_tz = current_user&.timezone.presence || @conference.timezone / TODO-SNAPCON: Explore caching this. - - @events_schedules.each do |event_schedule| - - next if event_schedule.event.parent_event.present? - - new_start_time = convert_timezone(event_schedule.start_time, @conference.timezone, tz_object.timezone) - - start_ymd = new_start_time.strftime('%Y-%m-%d') - - unless start_ymd.eql?(date) - .col-xs-12.col-md-12 - .date-content - %span.date-title - = inyourtz(event_schedule.start_time, @conference.timezone) do - = date = start_ymd - %a.pull-right{ title: "Go up", href: "#program" } - %i.fa-solid.fa-angles-up.fa-lg{ 'aria-hidden': true } - .col-xs-12.col-md-1 - - if !event_schedule.start_time.strftime('%H:%M').eql?(time) || !start_ymd.eql?(date) - - time = new_start_time.strftime('%H:%M') - = inyourtz(event_schedule.start_time, @conference.timezone) do - = time + ' ' + timezone_text(tz_object) - .col-xs-12.col-md-11 - - cache [@program, event_schedule, event_schedule.event, current_user, event_schedule.happening_now?, '#scheduled#full#panel'] do - .event-item{ data: { time: event_schedule.start_time.iso8601 }, class: "event-#{event_schedule.event.id}" } - = render 'event', event: event_schedule.event, event_schedule: event_schedule + - @events_schedules.select { |es| es.event.parent_event.nil? }.each do |event_schedule| + - event = event_schedule.event + - start_time = convert_timezone(event_schedule.start_time, @conference.timezone, display_tz) + + - unless start_time.to_date.eql?(prev_date) + .date-content + %h2.date-title{ style: "margin: 0;" } + = prev_date = start_time.to_date + %a.pull-right{ title: "Go up", href: "#program" } + %i.fa-solid.fa-angles-up.fa-lg{ 'aria-hidden': true } + - if !start_time.eql?(prev_time) + - prev_time = start_time + %h3= start_time.strftime('%H:%M %p %Z') + .col-12 + - cache [@program, event_schedule, event, current_user, event_schedule.happening_now?, '#scheduled#full#panel'] do + .event-item{ data: { time: event_schedule.start_time.iso8601 }, id: dom_id(event) } + = render 'event', event: event, event_schedule: event_schedule / confirmed events that are not scheduled - if @unscheduled_events.any? - .col-xs-12.col-md-12 + .col-12 .date-content - %span.date-title#unscheduled + %h2.date-title#unscheduled{ style: "margin: 0;" } Unscheduled events %a.pull-right{ title: "Go up", href: "#program" } %i.fa-solid.fa-angles-up.fa-lg{ 'aria-hidden': true } diff --git a/package-lock.json b/package-lock.json index fedc26385..e5e7a779a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "snapcon2", + "name": "snapcon", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/spec/models/payment_spec.rb b/spec/models/payment_spec.rb index 34b0132d2..246fc8424 100644 --- a/spec/models/payment_spec.rb +++ b/spec/models/payment_spec.rb @@ -7,7 +7,6 @@ # id :bigint not null, primary key # amount :integer # authorization_code :string -# currency :string # last4 :string # status :integer default("unpaid"), not null # created_at :datetime not null