Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to allow admins to edit post payment #200

Merged
merged 2 commits into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions app/views/ticket_requests/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
%div{"data-controller": "tickets-request"}
.card
.card-header.bg-dark-subtle
- unless is_update && [email protected]?(current_user)
- if @user
%h4 Ticket Request for #{@user.name}
- else
%h5 Please sign-in or register to request tickets.
- if signed_in? && @user.present?
%h4 Ticket Request for #{@user.name}
- else
%h5 Please sign-in or register to request tickets.

.card-body
= render 'shared/form_errors', resource: @ticket_request

- if signed_in? && @user.present?
Signed in as
= "#{@user.name} <#{@user.email}>"
- if is_update && @event.admin?(current_user)
= "#{current_user.name} <#{current_user.email}>"
- else
= "#{@user.name} <#{@user.email}>"
- else
= turbo_frame_tag :turbo_login do
= render partial: "devise/shared/login", layout: false, locals: { resource: devise_mapping.singular,
Expand All @@ -31,8 +33,7 @@
redirect_to: new_event_ticket_request_url(@event) }

#ticket-request-form{"data-controller": "popovers"}
- if !(signed_in? && @user)
- else
- if signed_in? && @user.present?
= form_for @ticket_request,
url: { controller: :ticket_requests, action: form_action_name }, data: { "turbo-target": "_top", turbo: false } do |f|
= f.hidden_field :event_id, value: @event.id
Expand Down Expand Up @@ -84,7 +85,7 @@
-# on create, set user into guests list
= f.hidden_field :guests, value: @user.name_and_email

- unless @ticket_request.post_payment?
- if !@ticket_request.post_payment? || (@event.admin?(current_user) && is_update)
%hr
%h4 How are you contributing to the event?
.content-fluid
Expand Down Expand Up @@ -143,7 +144,7 @@
= f.text_area :previous_contribution, style: 'min-width: 100%',
rows: 2, maxlength: 250, required: false

- if signed_in? && @event.admin?(current_user) && form_action_name == :update
- if signed_in? && @event.admin?(current_user) && is_update
.well
= f.label :special_price, 'Total Special Price ($)'

Expand Down Expand Up @@ -238,7 +239,7 @@
= f.text_area :notes,
rows: 4, columns: 100, maxlength: 500, style: 'width: 100%'

- if signed_in? && @event.admin?(current_user) && form_action_name == :update
- if signed_in? && @event.admin?(current_user) && is_update
.well
= f.label :admin_notes do
Additional Notes
Expand Down