Skip to content

Commit

Permalink
Merge pull request #4429 from MidwestFurryFandom/pre-con-final
Browse files Browse the repository at this point in the history
Merge Docker build fix from MFF
  • Loading branch information
kitsuta authored Nov 8, 2024
2 parents 6b5b335 + b73797a commit 7a20818
Show file tree
Hide file tree
Showing 19 changed files with 200 additions and 68 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN --mount=type=cache,target=/var/cache/apk \

ADD requirements.txt /app/
#RUN --mount=type=cache,target=/root/.cache \
RUN uv pip install --system -r requirements.txt;
RUN /root/.local/bin/uv pip install --system -r requirements.txt;

ADD uber-wrapper.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/uber-wrapper.sh
Expand All @@ -39,7 +39,7 @@ ENV uber_plugins=$PLUGIN_NAMES
FROM build as test
ADD requirements_test.txt /app/
#RUN --mount=type=cache,target=/root/.cache \
RUN uv pip install --system -r requirements_test.txt
RUN /root/.local/bin/uv pip install --system -r requirements_test.txt
CMD python -m pytest
ADD . /app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('indie_game_image', sa.Column('is_header', sa.Boolean(), server_default='False', nullable=False))
op.add_column('indie_game_image', sa.Column('is_thumbnail', sa.Boolean(), server_default='False', nullable=False))
op.create_unique_constraint(op.f('uq_lottery_application_attendee_id'), 'lottery_application', ['attendee_id'])
#op.create_unique_constraint(op.f('uq_lottery_application_attendee_id'), 'lottery_application', ['attendee_id'])
# ### end Alembic commands ###


Expand Down
4 changes: 2 additions & 2 deletions uber/models/art_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,10 @@ def print_bidsheet(self, pdf, sheet_num, normal_font_name, bold_font_name, set_f
pdf.set_font(normal_font_name, size=8)
pdf.set_xy(242 + xplus, 90 + yplus)
# Note: we want the prices on the PDF to always have a trailing .00
pdf.cell(53, 14, txt=('${:,.2f}'.format(self.opening_bid)) if self.valid_for_sale else 'N/A', ln=1)
pdf.cell(53, 14, txt=('${:,.2f}'.format(self.opening_bid)) if self.valid_for_sale else 'NFS', ln=1)
pdf.set_xy(242 + xplus, 116 + yplus)
pdf.cell(
53, 14, txt=('${:,.2f}'.format(self.quick_sale_price)) if self.valid_quick_sale else 'N/A', ln=1)
53, 14, txt=('${:,.2f}'.format(self.quick_sale_price)) if self.valid_quick_sale else 'NFS', ln=1)


class ArtShowPayment(MagModel):
Expand Down
25 changes: 25 additions & 0 deletions uber/site_sections/art_show_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,31 @@ def save_and_check_in_out(self, session, **params):
'success': success,
}

@ajax
def update_location(self, session, message='', **params):
app = session.art_show_application(params)
session.commit()
return {'success': True,
'message': f"Updated {app.artist_or_full_name}'s location."}

@ajax
def update_all(self, session, message='', **params):
if 'id' in params:
app_list = []
for id in params.get('id'):
app_params = {key.replace(f'_{id}', ''): val for key, val in params.items() if f'_{id}' in key}
app_params['id'] = id
app = session.art_show_application(app_params)
if app.locations != app.orig_value_of('locations'):
app_list.append(app.artist_or_full_name)

session.commit()
message = "No locations to update." if not app_list \
else f"Updated the following applications: {readable_join(app_list)}"

return {'success': True,
'message': message}

def assign_locations(self, session, message='', **params):
valid_apps = session.query(ArtShowApplication).filter_by(status=c.APPROVED)

Expand Down
3 changes: 1 addition & 2 deletions uber/site_sections/promo_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ def update_all(self, session, message='', **params):
for id in params.get('id'):
code_params = {key.replace(f'_{id}', ''): val for key, val in params.items() if f'_{id}' in key}
code_params['id'] = id
from pockets.autolog import log
log.error(code_params)

promo_code = session.promo_code(code_params)
message = check(promo_code)
if message:
Expand Down
9 changes: 8 additions & 1 deletion uber/site_sections/reg_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,21 @@ def attendees_nonzero_balance(self, session, include_no_receipts=False):
def self_service_refunds(self, session):
refunds = session.query(ReceiptTransaction).filter(ReceiptTransaction.amount < 0,
ReceiptTransaction.who == 'non-admin').all()


counts = defaultdict(int)
refund_models = defaultdict(dict)
for refund in refunds:
model = session.get_model_by_receipt(refund.receipt)
model_name = ''.join(' ' + char if char.isupper() else
char.strip() for char in model.__class__.__name__).strip()
refund_models[model_name][refund] = model
if c.BADGE_TYPE_PRICES and isinstance(model, Attendee):
if model.badge_type in c.BADGE_TYPE_PRICES:
counts[model.badge_type] += 1
else:
counts[c.ATTENDEE_BADGE] += 1

return {
'refund_models': refund_models,
'counts': counts,
}
2 changes: 1 addition & 1 deletion uber/site_sections/security_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def index(self, session, message='', **params):
active_entries = session.query(WatchList).filter(WatchList.active == True # noqa: E712
).order_by(WatchList.last_name).all()
for entry in active_entries:
entry.attendees_and_guesses = entry.attendees
entry.attendees_and_guesses = entry.attendees.copy()
for attendee in session.guess_watchentry_attendees(entry):
if attendee not in entry.attendees_and_guesses:
entry.attendees_and_guesses.append(attendee)
Expand Down
105 changes: 88 additions & 17 deletions uber/templates/art_show_admin/assign_locations.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,115 @@
{% extends "base.html" %}{% set admin_area=True %}
{% block title %}Assign Locations{% endblock %}
{% set title = "Assign Locations" %}
{% block content %}
<style type="text/css">
.invalid-row>td {background-color: #FFE4E1 !important;}
</style>
{% block admin_controls %}

<h3>Assign Locations</h3>
<div class="card-body">
<form role="form" method="post" action="assign_locations" class="form-inline">
<button class="btn btn-primary" type="submit">Save</button>
<table class="table table-striped datatable">
<script type="text/javascript">
var updateAll = function() {
let bigData = ''
$('[id^=update_location_]').each(function() {
let serializedData = new URLSearchParams($(this).serialize());

if (bigData == '') {
bigData = 'csrf_token=' + serializedData.get('csrf_token')
}

bigData = bigData + '&id=' + serializedData.get('id')

for (const [key, value] of serializedData) {
if (key != 'csrf_token' && key != 'id') {
bigData = bigData + '&' + key + '_' + serializedData.get('id') + '=' + value
}
}
})
$.ajax({
method: 'POST',
url: 'update_all',
dataType: 'json',
data: bigData,
success: function (json) {
hideMessageBox();
var message = json.message;
if (json.success) {
$("#message-alert").addClass("alert-info").show().children('span').html(message);
window.scrollTo(0,0); setTimeout(() => { window.scrollTo(0, 0); }, 100);
} else {
showErrorMessage(message);
}
},
error: function () {
showErrorMessage('Unable to connect to server, please try again.');
}
});
}
$().ready(function () {
$('form[action="update_location"]').on('submit', function(event) {
event.preventDefault();
$.ajax({
type: 'POST',
url: $(this).attr("action"),
data: $(this).serialize(),
success: function (json) {
hideMessageBox();
var message = json.message;
if (json.success) {
$("#message-alert").addClass("alert-info").show().children('span').html(message);
window.scrollTo(0,0); setTimeout(() => { window.scrollTo(0, 0); }, 100);
} else {
showErrorMessage(message);
}
},
error: function () {
showErrorMessage('Unable to connect to server, please try again.');
}
});
})
});
</script>

<h2>Assign Locations</h2>
<div class="card card-body">
<table class="table table-hover datatable">
<thead><tr>
<th>Artist Name</th>
<th>Real Name</th>
<th>General Grids</th>
<th>Mature Grids</th>
<th>General Tables</th>
<th>Mature Tables</th>
<th>Location</th>
<th>Locations</th>
<th></th>
</tr></thead>
{% for app in apps %}
<tr {% if app.amount_unpaid %}class="invalid-row"{% endif %}>
<td>{{ app.artist_name|default('N/A') }}</td>
<td style="text-align:left" data-order="{{ app.attendee.full_name }}" data-search="{{ app.attendee.full_name }}"> <a href="form?id={{ app.id }}">{{ app.attendee.full_name|default("?????") }}</a> </td>
<td>{{ app.artist_name|default('N/A',true) }}</td>
<td data-order="{{ app.attendee.full_name }}" data-search="{{ app.attendee.full_name }}"> <a href="form?id={{ app.id }}" target="_blank">{{ app.attendee.full_name|default("?????") }}</a> </td>
<td>{{ app.panels }}</td>
<td>{{ app.panels_ad }}</td>
<td>{{ app.tables }}</td>
<td>{{ app.tables_ad }}</td>
<td>
<input type="text" class="form-control" name="{{ app.id }}_locations" value="{{ app.locations }}" />
<input type="text" class="form-control" form="update_location_{{ app.id }}" name="locations" value="{{ app.locations }}" />
</td>
<td>
<form id="update_location_{{ app.id }}" method="post" action="update_location">
{{ csrf_token() }}
<input type="hidden" name="id" value="{{ app.id }}" />
<button type="submit" class="btn btn-sm btn-primary update-button">
<i class="fa fa-check"></i>
</button>
</form>
</td>
</tr>
{% endfor %}
<caption align="bottom">
<ul class="pagination"></ul>
</caption>
</table>
<button class="btn btn-primary" type="submit">Save</button>
</form>
<div class="d-flex justify-content-end mt-3">
<div class="flex-grow-1"></div>
<div>
<button type="button" class="btn btn-primary" onClick="updateAll()">Update All</button>
</div>
</div>
</div>
{% endblock admin_controls %}

{% endblock content %}
42 changes: 25 additions & 17 deletions uber/templates/art_show_admin/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,44 @@ <h2>Art Show {{ c.ART_SHOW_APP_TERM|title }} Form{% if app.attendee %} for {{ ap

{{ csrf_token() }}

{% if new_app or c.HAS_ART_SHOW_ADMIN_ACCESS %}
<div class="form-group">
<label for="attendee" class="col-sm-3 form-text">Attendee</label>
<div class="col-sm-6">
<div class="row g-sm-3 form-group">
<div class="col-12 col-sm-6">
<label for="attendee" class="col-12 form-text">Attendee</label>
<div class="mb-3">
<select class="form-select" id="attendee_id" name="attendee_id" required="true">
<option value="" selected="selected">Select an attendee</option>
{{ options(all_attendees, attendee_id) }}
</select>
</div>
</div>
{% else %}
<div class="form-group">
<label for="attendee" class="col-sm-3 form-text">Attendee Badge Status</label>
<div class="col-sm-6">
</div>
{% if not new_app %}
<div class="col-12 col-sm-6">
<label for="attendee" class="col-12 form-text">Attendee Badge Status</label>
<div class="mb-3">
<select class="form-select" id="badge_status" name="badge_status">
{{ options(c.BADGE_STATUS_OPTS, app.attendee.badge_status) }}
</select>
</div>
</div>
{% endif %}
</div>

<div class="form-group">
<label for="status" class="col-sm-3 form-text">{{ c.ART_SHOW_APP_TERM|title }} Status</label>
<div class="col-sm-6">
<select class="form-select" name="status">
{{ options(c.ART_SHOW_STATUS_OPTS, app.status) }}
</select>
<div class="row g-sm-3 form-group">
<div class="col-12 col-sm-6">
<label for="status" class="col-12 form-text">{{ c.ART_SHOW_APP_TERM|title }} Status</label>
<div class="mb-3">
<select class="form-select" name="status">
{{ options(c.ART_SHOW_STATUS_OPTS, app.status) }}
</select>
<p class="form-text">Changing this may trigger an email to the attendee.</p>
</div>
</div>
<div class="col-12 col-sm-6">
<label for="attendee" class="col-12 form-text">Locations</label>
<div class="mb-3">
<input type="text" class="form-control" name="locations" value="{{ app.locations }}" />
</div>
</div>
<div class="clearfix"></div>
<p class="help-block col-sm-6 col-sm-offset-3">Changing this may trigger an email to the attendee.</p>
</div>

<div class="row g-3 form-group">
Expand Down
4 changes: 2 additions & 2 deletions uber/templates/art_show_applications/art_show_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set max_tables = c.MAX_ART_TABLES if not admin_area else 30 %}
{% set max_panels = c.MAX_ART_PANELS if not admin_area else 30 %}

{% if app.delivery_method == c.AGENT and not app.current_agents and not app.is_new %}
{% if app.delivery_method == c.AGENT and not app.current_agents and app.valid_agent_codes %}
<div class="alert alert-warning">
<p>Your art show {{ c.ART_SHOW_APP_TERM }} does not have an agent assigned to bring and hang art.
{% if app.valid_agent_codes|length == 1 %}
Expand Down Expand Up @@ -101,7 +101,7 @@
{% endif %}
</div>

{% if app.delivery_method == c.AGENT and not app.is_new %}
{% if app.delivery_method == c.AGENT and app.valid_agent_codes %}
{% if not c.ONE_AGENT_PER_APP %}
<input type="hidden" form="add_agent_code" name="id" value="{{ app.id }}" />
<button type="submit" form="add_agent_code" class="btn btn-primary">Generate Another Agent Code</button>
Expand Down
13 changes: 13 additions & 0 deletions uber/templates/art_show_common/art_pieces_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,19 @@ <h3 class="card-title">Art Show Information</h3>
<input type="hidden" name="id" value="{{ app.id }}" />
<input type="hidden" name="return_to" value="{{ c.PAGE_PATH }}" />
{{ csrf_token() }}
{% if admin_area %}
<div class="row g-sm-3">
<div class="col-12 col-sm-6">
<label for="banner_name" class="form-text">Locations</label>
{% if readonly %}
{{ app.locations }}
{% else %}
<input type="text" class="form-control" name="locations" id="locations" value="{{ app.locations }}"/>
{% endif %}
</div>
</div>
{% endif %}

<div class="row g-sm-3">
<div class="col-12 col-sm-6">
<label for="banner_name" class="form-text">Banner Name</label>
Expand Down
2 changes: 2 additions & 0 deletions uber/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@
}

$(function() {
{% set message = message if message is string else message|join(' ') %}
{% set error_message = error_message if error_message is string else error_message|join(' ') %}
// This nonsense is so we can have line breaks AND unescaped quotes in our messages
var message = '{{ message|sanitize_html|tojson if message else "" }}';
var error_message = '{{ error_message|sanitize_html|tojson if error_message else "" }}';
Expand Down
13 changes: 3 additions & 10 deletions uber/templates/emails/art_show/mailing_in.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
Dear {{ app.attendee.first_name }},
<p>Thank you for registering to send Art to {{ c.EVENT_NAME }} via our
Mail-In Option. Below you will find the steps you need to follow to
successfully submit/send art to us.</p>
<p>Thank you for registering to send Art to {{ c.EVENT_NAME }} via our Mail-In Option. Below you will find the steps you need to follow to successfully submit/send art to us.</p>
<p>Here is a link to <a href="{{ c.URL_BASE
}}/art_show_applications/edit?id={{ app.id }}" target="_blank">your
application</a>.</p>
<p>**If you have not paid for your space in the show, please do so
now. Any unpaid reservations will be deleted on November 8th, and you
will lose your space to the waitlist.</p>
<p>**If you have not paid for your space in the show, please do so now. Any unpaid reservations will be deleted on November 15th, and you will lose your space to the waitlist.</p>
<ol>
<li>Enter your mailing address.</li>
<li>Enter your pieces into your application.</li>
Expand Down Expand Up @@ -35,10 +31,7 @@
<li>Email {{ c.ART_SHOW_EMAIL|email_only|email_to_link }} with your
Name, Tracking Number and shipper name.</li>
</ol>
<p>I will send back any unsold Art via your prepaid label on Monday,
December 4th. If all of your art sells we will send back your prepaid
label, receipt and the check for your sales during the week after the
convention.</p>
<p>I will send back any unsold Art via your prepaid label on Monday, December 9th. If all of your art sells we will send back your prepaid label, receipt and the check for your sales during the week after the convention.</p>
<p>Thank you,
<br/>Hugmonster
<br/>Art Show Director</p>
2 changes: 1 addition & 1 deletion uber/templates/emails/art_show/pieces_reminder.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We are looking forward to having your Art in the Midwest FurFest Art Show. At th

We will be able to do onsite corrections, but would rather you enter as much as possible ahead of time. Use this link to access your application and start entering today: {{ c.URL_BASE }}/art_show_applications/edit?id={{ app.id }}

Remember check in starts at 9 AM on Friday morning on the second floor of the Convention Center, right next to Artist Alley. If you are around on Thursday we are hoping to allow earlier setup as well but that is dependent on how fast we can get our prep done, feel free to stop by and volunteer.
Remember check in starts at 9 AM on Friday morning on the FIRST floor of the Convention Center, to the right of registration, behind the fountain. If you are around on Thursday we are hoping to allow earlier setup as well but that is dependent on how fast we can get our prep done, feel free to stop by and volunteer.

Thank you,
Hugmonster
Expand Down
Loading

0 comments on commit 7a20818

Please sign in to comment.