Skip to content

Commit

Permalink
Update Guest/Music checklist for Super 2025
Browse files Browse the repository at this point in the history
Updates text for existing steps and adds a "performer badges" step that lets groups indicate they've assigned all performer badges. Fixes https://jira.magfest.net/browse/MAGDEV-1330.
  • Loading branch information
kitsuta committed Aug 25, 2024
1 parent 5632261 commit f457ee0
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"""Guest/Music checklist updates for Super 2025
Revision ID: 72225013a93d
Revises: 643d80417d4a
Create Date: 2024-08-24 21:44:25.261247
"""


# revision identifiers, used by Alembic.
revision = '72225013a93d'
down_revision = '643d80417d4a'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa



try:
is_sqlite = op.get_context().dialect.name == 'sqlite'
except Exception:
is_sqlite = False

if is_sqlite:
op.get_context().connection.execute('PRAGMA foreign_keys=ON;')
utcnow_server_default = "(datetime('now', 'utc'))"
else:
utcnow_server_default = "timezone('utc', current_timestamp)"

def sqlite_column_reflect_listener(inspector, table, column_info):
"""Adds parenthesis around SQLite datetime defaults for utcnow."""
if column_info['default'] == "datetime('now', 'utc')":
column_info['default'] = utcnow_server_default

sqlite_reflect_kwargs = {
'listeners': [('column_reflect', sqlite_column_reflect_listener)]
}

# ===========================================================================
# HOWTO: Handle alter statements in SQLite
#
# def upgrade():
# if is_sqlite:
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op:
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False)
# else:
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False)
#
# ===========================================================================


def upgrade():
op.add_column('guest_group', sa.Column('badges_assigned', sa.Boolean(), server_default='False', nullable=False))
op.add_column('guest_travel_plans', sa.Column('completed', sa.Boolean(), server_default='False', nullable=False))


def downgrade():
op.drop_column('guest_travel_plans', 'completed')
op.drop_column('guest_group', 'badges_assigned')
17 changes: 9 additions & 8 deletions uber/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1791,20 +1791,21 @@ def _make_room_trie(rooms):

# A list of checklist items for display on the guest group admin page
c.GUEST_CHECKLIST_ITEMS = [
{'name': 'bio', 'header': 'Announcement Info Provided'},
{'name': 'panel', 'header': 'Panel'},
{'name': 'mc', 'header': 'MC'},
{'name': 'autograph'},
{'name': 'bio', 'header': 'Announcement Info Provided'},
{'name': 'info', 'header': 'Agreement Completed'},
{'name': 'taxes', 'header': 'W9 Uploaded', 'is_link': True},
{'name': 'merch', 'header': 'Merch'},
{'name': 'charity', 'header': 'Charity'},
{'name': 'badges', 'header': 'Badges Claimed'},
{'name': 'stage_plot', 'header': 'Stage Plans', 'is_link': True},
{'name': 'autograph'},
{'name': 'interview'},
{'name': 'travel_plans'},
{'name': 'performer_badges', 'header': 'Performer Badges'},
{'name': 'mc', 'header': 'MC'},
{'name': 'stage_plot', 'header': 'Stage Plans', 'is_link': True},
{'name': 'rehearsal'},
{'name': 'taxes', 'header': 'W9 Uploaded', 'is_link': True},
{'name': 'badges', 'header': 'Badges Claimed'},
{'name': 'hospitality'},
{'name': 'travel_plans'},
{'name': 'charity', 'header': 'Charity'},
]

# Generate the possible template prefixes per step
Expand Down
6 changes: 4 additions & 2 deletions uber/models/guests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class GuestGroup(MagModel):

wants_mc = Column(Boolean, nullable=True)
needs_rehearsal = Column(Choice(c.GUEST_REHEARSAL_OPTS), nullable=True)
badges_assigned = Column(Boolean, default=False)
info = relationship('GuestInfo', backref=backref('guest', load_on_pending=True), uselist=False)
bio = relationship('GuestBio', backref=backref('guest', load_on_pending=True), uselist=False)
taxes = relationship('GuestTaxes', backref=backref('guest', load_on_pending=True), uselist=False)
Expand Down Expand Up @@ -92,7 +93,7 @@ def sorted_checklist_items(self):

@property
def uses_detailed_travel_plans(self):
return self.group_type == c.BAND
return # Disabled for now

@property
def all_badges_claimed(self):
Expand Down Expand Up @@ -649,9 +650,10 @@ def no_details_if_no_interview(self):

class GuestTravelPlans(MagModel):
guest_id = Column(UUID, ForeignKey('guest_group.id'), unique=True)
modes = Column(MultiChoice(c.GUEST_TRAVEL_OPTS))
modes = Column(MultiChoice(c.GUEST_TRAVEL_OPTS), default=c.OTHER)
modes_text = Column(UnicodeText)
details = Column(UnicodeText)
completed = Column(Boolean, default=False)

@property
def num_detailed_travel_plans(self):
Expand Down
13 changes: 12 additions & 1 deletion uber/site_sections/guests.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def travel_plans(self, session, guest_id, message='', **params):
detailed_travel_plans = compile_travel_plans_from_params(session, **params) or \
guest_travel_plans.detailed_travel_plans
else:
guest_travel_plans = session.guest_travel_plans(params, checkgroups=['modes'])
guest_travel_plans = session.guest_travel_plans(params, restricted=True)

if cherrypy.request.method == 'POST':
if guest.uses_detailed_travel_plans:
Expand Down Expand Up @@ -399,6 +399,17 @@ def hospitality(self, session, guest_id, message='', **params):
'guest_hospitality': guest.hospitality or guest_hospitality,
'message': message
}

def performer_badges(self, session, guest_id, message='', **params):
guest = session.guest_group(guest_id)
if cherrypy.request.method == 'POST':
guest.badges_assigned = bool(params.get('badges_assigned'))
raise HTTPRedirect('index?id={}&message={}', guest.id, 'Thank you for assigning your badges!')

return {
'guest': guest,
'message': message
}

def mivs_core_hours(self, session, guest_id, message='', **params):
guest = session.guest_group(guest_id)
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/dept_checklist/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2>{{ conf.name }} for {{ department.name }}</h2>
<h3><a href="{{ conf.external_form_url }}" target="_blank">{{ c.EVENT_NAME }} {{ conf.name }} Form</a></h3>
Once you've filled out the form above, please click the button below.<br/>
<br/>
<button type="submit" name="comments" value="">I Have Filled out the {{ conf.name }} Form</button>
<button type="submit" name="comments" value="">I Have Filled Out the {{ conf.name }} Form</button>
{% else %}
<br/> <br/>
<textarea name="comments" rows="5" cols="80">{{ item.comments|default('', boolean=True) }}</textarea>
Expand Down
7 changes: 1 addition & 6 deletions uber/templates/guest_checklist/band_bio_deadline.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{% extends "guest_checklist/bio_deadline.html" %}

{% block deadline_headline %}Performer Announcement Information{% endblock %}

{% block form_desc %}
Please provide a short bio that we can use on our website and in social media announcements leading up to the event.
Everything else is optional, but is extremely helpful in promoting you to our attendees.
{% endblock %}
{% block deadline_headline %}Performer Announcement Information{% endblock %}
7 changes: 3 additions & 4 deletions uber/templates/guest_checklist/bio_deadline.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
{% else %}
<h2>{% block form_title %}Social Media Info for {{ guest.group.name }}{% endblock %}</h2>
{% block form_desc %}
Please provide a short bio for our website. Everything else is optional, but if you provide a picture and any social media
information, we'll include that as well.
Please provide a short bio and a photo for our social media and website announcements. Everything else is optional, but if you provide social media information, we'll include that as well. (Lengthy bios may be shortened for certain platforms)
{% endblock %}

<form method="post" action="bio" class="form-horizontal" role="form" enctype="multipart/form-data">
Expand All @@ -43,8 +42,8 @@ <h2>{% block form_title %}Social Media Info for {{ guest.group.name }}{% endbloc
guest_bio,
'member_info',
type='textarea',
label="Group Member Info",
help="Please list the names and pronouns for the members of your group, in case our social media or streaming teams need them!") }}
label="Group Member(s)",
help="Please list the names and pronouns for performing members of your group, in case our social media or streaming teams need them!") }}

<div class="form-group">
<label class="col-sm-3 control-label optional-field">Website</label>
Expand Down
4 changes: 0 additions & 4 deletions uber/templates/guest_checklist/guest_bio_deadline.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
{% endblock %}

{% block form_headline %}Guest/Group Info for {{ guest.group.name }}{% endblock %}
{% block form_desc %}
Please provide a short bio and a photo for our website. Everything else is optional, but if you provide social media
information, we'll include that as well.
{% endblock %}

{% block form_extra %}
{% endblock %}
10 changes: 7 additions & 3 deletions uber/templates/guest_checklist/hospitality_deadline.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ <h2>{% block form_title %}Hospitality Questionnaire for {{ guest.group.name }}{%

{% block form_desc %}
{% if guest.hospitality_status %}
You've already indicated that you have completed <a href="https://forms.gle/x9a6nWfT5sUQ9PC8A" target="_blank">the hospitality survey</a>. If you need to update something, please contact us at {{ c.GUEST_EMAIL|email_only|email_to_link }}.
You've already indicated that you have completed <a href="https://forms.gle/BvWEK1DYWiT7SkSc7" target="_blank">the hospitality survey</a>. If you need to update something, please contact us at {% if guest.group_type == c.BAND %}{{ c.BAND_EMAIL|email_only|email_to_link }}{% else %}{{ c.GUEST_EMAIL|email_only|email_to_link }}{% endif %}.
{% else %}
Please fill out <a href="https://forms.gle/x9a6nWfT5sUQ9PC8A" target="_blank">this survey</a> to help us make your MAGFest experience an even more positive one.
Please fill out <a href="https://forms.gle/BvWEK1DYWiT7SkSc7" target="_blank">this survey</a> to help us make your MAGFest experience an even more positive one.
{% endif %}
{% endblock %}

<br/><br/>

{% if guest.hospitality_status %}
<a href="index?id={{ guest.id }}" class="btn btn-default">Back to Checklist</a>
{% else %}
<form method="post" action="hospitality" class="form-horizontal" role="form">
<input type="hidden" name="guest_id" value="{{ guest.id }}" />
<input type="hidden" name="id" value="{{ guest_hospitality.db_id }}" />
{{ csrf_token() }}
{% block form_extra %}{% endblock %}
<button type="submit" name="completed" class="btn btn-primary" value="1">I Have Filled out the Survey Above</button>
<button type="submit" name="completed" class="btn btn-primary" value="1">I Have Filled Out the Survey Above</button>
</form>
{% endif %}
{% endif %}
40 changes: 40 additions & 0 deletions uber/templates/guest_checklist/performer_badges_deadline.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% if snippet %}
<tr>
<td width="25">{{ macros.checklist_image(guest.badges_assigned) }}</td>
<td><b><a href="performer_badges?guest_id={{ guest.id }}">
{% block deadline_headline %}Assign Performer Badges{% endblock %}</a></b></td>
<td><i>Deadline:</i> {{ guest.deadline_from_model('performer_badges')|datetime_local }}</td>
</tr>
<tr>
<td colspan="3">
{% block deadline_text %}
Please assign all badges for performers in your group, excluding plus-ones.
{% endblock %}
<br/></br>
</td>
</tr>
{% else %}
<h2>{% block form_title %}Performer Badges for {{ guest.group.name }}{% endblock %}</h2>

{% block form_desc %}
<p><a href="../preregistration/group_members?id={{ guest.group.id }}" class="btn btn-lg btn-info" target="_blank">Manage Badge(s)</a></p>
{% if guest.badges_assigned %}
<p>You've already indicated that you have assigned all performer badges.
You may unassign and re-assign badges using the link above, or use the confirmation link sent to each badge to view and update its information.</p>
{% else %}
<p>Please use the badge assignment page above to enter information for all performer(s).</p>
<p>You can send each "Register someone for this badge" link directly to other group member(s) to fill out. Once you are done, let us know using the button below. You do <strong>NOT</strong> need to fill out information for your plus-ones to complete this step.</p>
{% endif %}
{% endblock %}

{% if guest.badges_assigned %}
<a href="index?id={{ guest.id }}" class="btn btn-default">Back to Checklist</a>
{% else %}
<form method="post" action="performer_badges" class="form-horizontal" role="form">
<input type="hidden" name="guest_id" value="{{ guest.id }}" />
{{ csrf_token() }}
{% block form_extra %}{% endblock %}
<button type="submit" name="badges_assigned" class="btn btn-primary" value="1">I Have Assigned All Performer Badges</button>
</form>
{% endif %}
{% endif %}
4 changes: 4 additions & 0 deletions uber/templates/guest_checklist/stage_plot_deadline.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ <h2>{% block form_title %}Stage Layout for {{ guest.group.name }}{% endblock %}<
<div class="col-sm-6">
<input type="file" name="plot" />
</div>
{% if guest.stage_plot and guest.stage_plot.filename %}
<div class="clearfix"></div>
<p class="help-block col-sm-6 col-sm-offset-3">Uploading a new file will replace the existing one.</p>
{% endif %}
</div>
<div class="form-group">
<label class="col-sm-3 control-label optional-field">Additional Notes</label>
Expand Down
8 changes: 4 additions & 4 deletions uber/templates/guest_checklist/travel_plans_deadline.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<td colspan="3">
{% block deadline_text %}
{% if guest.travel_plans_status %}
You have already told us how you will be traveling to {{ c.EVENT_NAME }}, but you can use the link above to update your
preferences.
You've already indicated that you have completed <a href="https://forms.gle/BvWEK1DYWiT7SkSc7" target="_blank">our travel plans form</a>.
If you need to update something, please contact us at {% if guest.group_type == c.BAND %}{{ c.BAND_EMAIL|email_only|email_to_link }}{% else %}{{ c.GUEST_EMAIL|email_only|email_to_link }}{% endif %}.
{% else %}
Use the link above to let us know your travel plans for getting to {{ c.EVENT_NAME }}.
Please fill out a form so we are aware of your travel plans and can accommodate accordingly.
{% endif %}
{% endblock %}
<br/></br>
Expand All @@ -33,7 +33,7 @@
<h2>{% block form_title %}Travel Plans for {{ guest.group.name }}{% endblock %}</h2>

{% block form_desc %}
To help with scheduling, please include any travel you have arranged through {{ c.EVENT_NAME }}.
Please fill out a form so we are aware of your travel plans and can accommodate accordingly.
{% endblock %}
<br/> <br/>

Expand Down
7 changes: 7 additions & 0 deletions uber/templates/guests/performer_badges.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "guestbase.html" %}
{% set snippet=False %}
{% block body %}

{%- include ['guest_checklist/' ~ guest.group_type_label|lower|replace(' ','_') ~ '_performer_badges_deadline.html', 'guest_checklist/performer_badges_deadline.html'] -%}

{% endblock %}

0 comments on commit f457ee0

Please sign in to comment.