<commit_before>{# template for user (or admin) to view their profile #}
{% extends "form_base.html" %}
{% from "_macros.html" import show_flashed, render_field %}

{% block formblock %}
<div class="row my-3">
	<h3 class="col-auto mr-auto">{{ this_user.get_name() }} {% if this_user.nickname %}({{ this_user.nickname }}){% endif %}</h3>
	<div class="col-auto">
		<a href="#edit-user-container" data-toggle="collapse" class="btn btn-lg btn-outline-primary">Edit Profile</a>
	</div>
</div>
{{ show_flashed() }}
<div id="edit-user-container" class="collapse mb-3">
	<form id="edit-user" method="post" role="form">
		{{ edit_user.csrf }}
		{{ render_field(edit_user.first_name) }}
		{{ render_field(edit_user.last_name) }}
		{{ render_field(edit_user.nickname) }}
		{{ render_field(edit_user.venmo_id) }}
		{{ render_field(edit_user.submit) }}
	</form>
</div>

{# TODO collapse this table when editing profile #}
<table class="table">
	<tr>
		<th scope="row">Email</th>
		<td>{{ this_user.email }}</td>
	</tr>
	<tr>
		<th scope="row">Current Login</th>
		<td>{{ this_user.current_login_at }}</td>
	</tr>
	<tr>
		<th scope="row">Login IP</th>
		<td>{{ this_user.current_login_ip }}</td>
	</tr>
	<tr>
		<th scope="row">Roles</th>
		<td>{{ this_user.get_role_names() }}</td>
	</tr>
{% if 'bartender' in this_user.get_role_names() %}
	<tr>
		<th scope="row">Works at</th>
		<td>{{ this_user.get_bar_names() }}</td>
	</tr>
{% endif %}
{% if this_user.venmo_id %}
	</tr>
		<th scope="row">Venmo ID</th>
		<td>{{ this_user.venmo_id }}</td>
	</tr>
{% endif %}
</table>

<h5>Order history:</h5>
<table>
	<tr>
		<th>What</th>
		<th>Where</th>
		<th>When</th>
		<th>Confirmed</th>
	</tr>
	{% for order in this_user.orders %}
	<tr>
		<td>{{ order.recipe_name }}</td>
		<td>{{ order.where() }}</td>
		<td>{{ order.timestamp }}</td>
		<td>{{ order.confirmed }}</td>
	</tr>
	{% endfor %}
</table>

{% if 'bartender' in this_user.get_role_names() %}
<h5>Orders served:</h5>
<table>
	<tr>
		<th>What</th>
		<th>Where</th>
		<th>When</th>
		<th>Confirmed</th>
	</tr>
	{% for order in this_user.orders_served %}
	<tr>
		<td>{{ order.recipe_name }}</td>
		<td>{{ order.where() }}</td>
		<td>{{ order.timestamp }}</td>
		<td>{{ order.confirmed }}</td>
	</tr>
	{% endfor %}
</table>
{% endif %}
{% endblock formblock %}<commit_msg>Adds venmo icon to user edit profile<commit_after>{# template for user (or admin) to view their profile #}
{% extends "form_base.html" %}
{% from "_macros.html" import show_flashed, render_field %}

{% block formblock %}
<div class="row my-3">
	<h3 class="col-auto mr-auto">{{ this_user.get_name() }} {% if this_user.nickname %}({{ this_user.nickname }}){% endif %}</h3>
	<div class="col-auto">
		<a href="#edit-user-container" data-toggle="collapse" class="btn btn-outline-primary">Edit Profile</a>
	</div>
</div>
{{ show_flashed() }}

{% from "_macros.html" import bulletproof_button %}
{{ bulletproof_button("#", "Send confirmation", font_style="color:#ffffff") }}

<div id="edit-user-container" class="collapse mb-3">
	<form id="edit-user" method="post" role="form">
		{{ edit_user.csrf }}
		{{ render_field(edit_user.first_name) }}
		{{ render_field(edit_user.last_name) }}
		{{ render_field(edit_user.nickname) }}
		{{ render_field(edit_user.venmo_id, prepend={'tag': "img", 'class': "input-group-addon", 'style': "height:calc(2.25rem + 2px)", 'src': "https://cdn1.venmo.com/marketing/images/branding/venmo-icon.svg"}) }}
		{{ render_field(edit_user.submit) }}
	</form>
</div>

{# TODO collapse this table when editing profile #}
<table class="table">
	<tr>
		<th scope="row">Email</th>
		<td>{{ this_user.email }}</td>
	</tr>
	<tr>
		<th scope="row">Current Login</th>
		<td>{{ this_user.current_login_at }}</td>
	</tr>
	<tr>
		<th scope="row">Login IP</th>
		<td>{{ this_user.current_login_ip }}</td>
	</tr>
	<tr>
		<th scope="row">Roles</th>
		<td>{{ this_user.get_role_names() }}</td>
	</tr>
{% if 'bartender' in this_user.get_role_names() %}
	<tr>
		<th scope="row">Works at</th>
		<td>{{ this_user.get_bar_names() }}</td>
	</tr>
{% endif %}
{% if this_user.venmo_id %}
	</tr>
		<th scope="row">Venmo ID</th>
		<td>{{ this_user.venmo_id }}</td>
	</tr>
{% endif %}
</table>

<h5>Order history:</h5>
<table>
	<tr>
		<th>What</th>
		<th>Where</th>
		<th>When</th>
		<th>Confirmed</th>
	</tr>
	{% for order in this_user.orders %}
	<tr>
		<td>{{ order.recipe_name }}</td>
		<td>{{ order.where() }}</td>
		<td>{{ order.timestamp }}</td>
		<td>{{ order.confirmed }}</td>
	</tr>
	{% endfor %}
</table>

{% if 'bartender' in this_user.get_role_names() %}
<h5>Orders served:</h5>
<table>
	<tr>
		<th>What</th>
		<th>Where</th>
		<th>When</th>
		<th>Confirmed</th>
	</tr>
	{% for order in this_user.orders_served %}
		{% if order.confirmed %}
		<tr>
			<td>{{ order.recipe_name }}</td>
			<td>{{ order.where() }}</td>
			<td>{{ order.timestamp }}</td>
			<td>{{ order.confirmed }}</td>
		</tr>
		{% endif %}
	{% endfor %}
</table>
{% endif %}
{% endblock formblock %}
{'fraction_non_alphanumeric': 0.23818145242405955, 'fraction_numerical': 0.004224502112251056, 'mean_word_length': 4.363538295577131, 'pattern_counts': {'":': 0, '<': 199, '<?xml version=': 0, '>': 199, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2958943', 'n_tokens_mistral': 2221, 'n_tokens_neox': 2021, 'n_words': 401}