-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #637 from ZeusWPI/tom-allow-cancelling-a-registration
Add ticket overview screen
- Loading branch information
Showing
20 changed files
with
202 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'barby/barcode/ean_13' | ||
require 'barby/outputter/html_outputter' | ||
|
||
class GenerateHtmlBarcodes | ||
def initialize(barcode_data) | ||
@barcode_data = barcode_data | ||
end | ||
|
||
def call | ||
barcode = Barby::EAN13.new(@barcode_data) | ||
|
||
html_outputter = Barby::HtmlOutputter.new(barcode) | ||
html_outputter.to_html.html_safe # rubocop:disable Rails/OutputSafety | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
table.barby-barcode { border-spacing: 0; } | ||
tr.barby-row {} | ||
td.barby-cell { width: 3px; height: 70px; } | ||
td.barby-cell.on { background: #000; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<h3>Description</h3> | ||
<table class="table word-break"> | ||
<tr> | ||
<th class="col-md-3 col-xs-3">Organisation</th> | ||
<td><%= event.club.name %></td> | ||
</tr> | ||
<tr> | ||
<th>Location</th> | ||
<td><%= event.location %></td> | ||
</tr> | ||
<tr> | ||
<th>Start date</th> | ||
<td><%= nice_time event.start_date %></td> | ||
</tr> | ||
<tr> | ||
<th>End date</th> | ||
<td><%= nice_time event.end_date %></td> | ||
</tr> | ||
<tr> | ||
<td colspan="2"> | ||
<%= event.description.html_safe %> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Website</th> | ||
<td><%= link_to event.website, event.website %></td> | ||
</tr> | ||
<tr> | ||
<th>Contact e-mail</th> | ||
<td><%= mail_to event.contact_email, event.contact_email %></td> | ||
</tr> | ||
</table> | ||
|
||
<% unless event.access_levels.blank? %> | ||
<h3>Tickets</h3> | ||
<div class="row"> | ||
<div class="col-sm-12"> | ||
<ul class="list-group"> | ||
<% event.access_levels.public?.each do |al| %> | ||
<%= render partial: "events/ticket", locals: {al: al} %> | ||
<% end %> | ||
</ul> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<div class="row"> | ||
<div class="col-sm-6"> | ||
<%= render partial: 'events/event_details', locals: { event: @event } %> | ||
<p> | ||
<%= link_to "Register another ticket", event_path(@registration.event) %> | ||
</p> | ||
</div> | ||
|
||
<div class="col-sm-5 col-sm-offset-1"> | ||
<h3>Your ticket</h3> | ||
<table class="table word-break"> | ||
<tr> | ||
<th class="col-md-3 col-xs-3">Name</th> | ||
<td><%= @registration.name %></td> | ||
</tr> | ||
<tr> | ||
<th class="col-md-3 col-xs-3">Email</th> | ||
<td><%= @registration.email %></td> | ||
</tr> | ||
<tr> | ||
<th class="col-md-3 col-xs-3">Ticket</th> | ||
<td><%= @registration.access_level.name %></td> | ||
</tr> | ||
</table> | ||
|
||
<% if @registration.paid? %> | ||
<div> | ||
<%= @barcode %> | ||
</div> | ||
<div style="transform: rotate(-90deg); transform-origin: top left; margin-top: 300px;"> | ||
<div> | ||
<%= @barcode %> | ||
</div> | ||
</div> | ||
<% else %> | ||
<h3>Payment</h3> | ||
<table class="table word-break"> | ||
<tr> | ||
<th class="col-md-3 col-xs-3">Price</th> | ||
<td><%= euro @registration.access_level.price %></td> | ||
</tr> | ||
<tr> | ||
<th class="col-md-3 col-xs-3">Already paid</th> | ||
<td>- <%= euro @registration.paid %></td> | ||
</tr> | ||
<tr> | ||
<th class="col-md-3 col-xs-3">Remaining</th> | ||
<td><%= euro @registration.to_pay %></td> | ||
</tr> | ||
</table> | ||
|
||
<p> | ||
Om uw ticket te ontvangen via e-mail, schrijft u <strong><%= nice_amount @registration.to_pay %> euro</strong> | ||
over op het rekeningnummer <strong><%= @registration.event.bank_number || "our bank account" %></strong>. Plaats de code | ||
<strong>"<%= @registration.payment_code %>"</strong> in de mededeling van de overschrijving (zonder aanhalingstekens). <br /> | ||
Als u de | ||
code vergeet mee te geven of niet correct vermeldt in de beschrijving, dan kunnen wij uw betaling niet verwerken | ||
en zal u uw ticket niet ontvangen. U mag maximaal één code ingeven per overschrijving. | ||
</p> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class AddTokenToRegistration < ActiveRecord::Migration[6.1] | ||
def up | ||
# To be converted to UUID type when there's support for it in Rails+MySQL | ||
add_column :registrations, :token, :string, null: true | ||
Registration.find_each do |r| | ||
r.update_column(:token, SecureRandom.uuid) | ||
end | ||
change_column_null :registrations, :token, false | ||
|
||
add_index :registrations, :token | ||
end | ||
|
||
def down | ||
remove_index :registrations, :token | ||
remove_column :registrations, :token | ||
end | ||
end |
Oops, something went wrong.