<commit_before>{% extends "./preregistration/preregbase.html" %}
{% block title %}Preregistration{% endblock %}
{% block backlink %}{% endblock %}
{% block content %}

<script type="text/javascript">
    $().ready(function() {
        $("a[href^='delete']").click(function(event){
            var urlToUse = $(this).attr('href');
            event.preventDefault();
            bootbox.confirm({
                message: "Are you sure you want to delete this preregistration?",
                buttons: {
                    confirm: {
                        label: 'Delete Preregistration',
                        className: 'btn-danger'
                    },
                    cancel: {
                        label: 'Nevermind',
                        className: 'btn-default'
                    }
                },
                callback: function (result) {
                    if(result) {
                        window.location.href = urlToUse
                    }
                }
            });
        })
    });
</script>

<div class="masthead"></div>

<div class="panel panel-default">
  <div class="panel-body">
    {{ macros.prereg_wizard(c.PAGE_PATH, c.PREREG_REQUEST_HOTEL_INFO_OPEN) }}

    <div class="row">
        <div class="col-sm-8 col-sm-offset-2">
            <div class="col-sm-5 text-center">
                {% if charge.total_cost > 0 %}
                    {{ stripe_form('prereg_payment',charge) }}
                {% else %}
                    <a href="process_free_prereg">{{ macros.stripe_button("Complete Registration!") }}</a>
                {% endif %}
            </div>
            <div class="col-sm-2 text-center">
                or
            </div>
            <div class="col-sm-5 text-center">
                <a href="form">{{ macros.stripe_button("Add Another Prereg") }}</a>
            </div>
        </div>
    </div>
  </div>

  <table class="charge table table-striped">
    <thead>
      <tr>
        <th>Preregistration</th>
        <th data-hide="phone" data-sort-ignore="true">Details</th>
        <th data-type="numeric">Price</th>
        <th data-sort-ignore="true"></th>
      </tr>
    </thead>
    <tbody>
      {% for attendee in charge.attendees %}
        <tr>
          <td>{{ attendee.full_name }}</td>
          <td>
            <ul style="padding-left:15px">
              <li>Membership for {{ c.EVENT_NAME }}</li>
              {% if attendee.requested_hotel_info %}
                <li>Requested hotel booking info</li>
              {% endif %}
              {% if not attendee.default_cost and attendee.age_discount and not attendee.promo_code %}
                <li>Attendees who are {{ attendee.age_group_conf.desc|lower }} get in for free!</li>
              {% elif attendee.age_discount %}
                <li>${{ attendee.age_group_conf.discount }} discount for attendees who are {{ attendee.age_group_conf.desc|lower }}.</li>
              {% endif %}
              {% for swag in attendee.donation_swag|list + attendee.addons|list %}
                <li>{{ swag }}</li>
              {% endfor %}
              {% if attendee.promo_code %}
                <li>{{ attendee.promo_code.discount_str }} with promo code "{{ attendee.promo_code.code }}"</li>
              {% endif %}
            </ul>
          </td>
          <td>${{ attendee.total_cost|round(2) }}</td>
          <td>
            <a href="form?edit_id={{ attendee.id }}">Edit</a> / <a href="delete?id={{ attendee.id }}">Delete</a>
          </td>
        </tr>
      {% endfor %}

      {% for group in charge.groups %}
        <tr>
          <td>{{ group.name }}</td>
          <td>
            <ul style="padding-left:15px">
              <li>{{ group.badges }} badges</li>
              {% if group.requested_hotel_info %}
                <li>Requested hotel booking info</li>
              {% endif %}
              {% for swag in group.attendees.0.donation_swag|list + group.addons|list %}
                <li>{{ swag }}</li>
              {% endfor %}
            </ul>
          </td>
          <td>${{ group.default_cost|round(2) }}</td>
          <td>
            <a href="form?edit_id={{ group.id }}">Edit</a> /
            <a href="delete?id={{ group.id }}">Delete</a>
          </td>
        </tr>
      {% endfor %}
    </tbody>
    {% if charge.has_targets %}
      <tfoot>
        <tr>
          <th></th>
          <th style="text-align:right;"><i>Total:</i></th>
          <th><b>${{ charge.dollar_amount|round(2) }}</b></th>
          <th></th>
        </tr>
      </tfoot>
    {% endif %}
  </table>

  <div class="panel-body">
    {% include "preregistration/disclaimers.html" %}
  </div>
</div>
{% endblock %}
<commit_msg>Display age discounts correctly (#2811)<commit_after>{% extends "./preregistration/preregbase.html" %}
{% block title %}Preregistration{% endblock %}
{% block backlink %}{% endblock %}
{% block content %}

<script type="text/javascript">
    $().ready(function() {
        $("a[href^='delete']").click(function(event){
            var urlToUse = $(this).attr('href');
            event.preventDefault();
            bootbox.confirm({
                message: "Are you sure you want to delete this preregistration?",
                buttons: {
                    confirm: {
                        label: 'Delete Preregistration',
                        className: 'btn-danger'
                    },
                    cancel: {
                        label: 'Nevermind',
                        className: 'btn-default'
                    }
                },
                callback: function (result) {
                    if(result) {
                        window.location.href = urlToUse
                    }
                }
            });
        })
    });
</script>

<div class="masthead"></div>

<div class="panel panel-default">
  <div class="panel-body">
    {{ macros.prereg_wizard(c.PAGE_PATH, c.PREREG_REQUEST_HOTEL_INFO_OPEN) }}

    <div class="row">
        <div class="col-sm-8 col-sm-offset-2">
            <div class="col-sm-5 text-center">
                {% if charge.total_cost > 0 %}
                    {{ stripe_form('prereg_payment',charge) }}
                {% else %}
                    <a href="process_free_prereg">{{ macros.stripe_button("Complete Registration!") }}</a>
                {% endif %}
            </div>
            <div class="col-sm-2 text-center">
                or
            </div>
            <div class="col-sm-5 text-center">
                <a href="form">{{ macros.stripe_button("Add Another Prereg") }}</a>
            </div>
        </div>
    </div>
  </div>

  <table class="charge table table-striped">
    <thead>
      <tr>
        <th>Preregistration</th>
        <th data-hide="phone" data-sort-ignore="true">Details</th>
        <th data-type="numeric">Price</th>
        <th data-sort-ignore="true"></th>
      </tr>
    </thead>
    <tbody>
      {% for attendee in charge.attendees %}
        <tr>
          <td>{{ attendee.full_name }}</td>
          <td>
            <ul style="padding-left:15px">
              <li>Membership for {{ c.EVENT_NAME }}</li>
              {% if attendee.requested_hotel_info %}
                <li>Requested hotel booking info</li>
              {% endif %}
              {% if not attendee.badge_cost and attendee.age_discount and not attendee.promo_code_id %}
                <li>Attendees who are {{ attendee.age_group_conf.desc|lower }} get in for free!</li>
              {% elif attendee.age_discount and attendee.age_group_conf.discount != 0 %}
                <li>${{ attendee.age_group_conf.discount }} discount for attendees who are {{ attendee.age_group_conf.desc|lower }}.</li>
              {% endif %}
              {% for swag in attendee.donation_swag|list + attendee.addons|list %}
                <li>{{ swag }}</li>
              {% endfor %}
              {% if attendee.promo_code %}
                <li>{{ attendee.promo_code.discount_str }} with promo code "{{ attendee.promo_code.code }}"</li>
              {% endif %}
            </ul>
          </td>
          <td>${{ attendee.total_cost|round(2) }}</td>
          <td>
            <a href="form?edit_id={{ attendee.id }}">Edit</a> / <a href="delete?id={{ attendee.id }}">Delete</a>
          </td>
        </tr>
      {% endfor %}

      {% for group in charge.groups %}
        <tr>
          <td>{{ group.name }}</td>
          <td>
            <ul style="padding-left:15px">
              <li>{{ group.badges }} badges</li>
              {% if group.requested_hotel_info %}
                <li>Requested hotel booking info</li>
              {% endif %}
              {% for swag in group.attendees.0.donation_swag|list + group.addons|list %}
                <li>{{ swag }}</li>
              {% endfor %}
            </ul>
          </td>
          <td>${{ group.default_cost|round(2) }}</td>
          <td>
            <a href="form?edit_id={{ group.id }}">Edit</a> /
            <a href="delete?id={{ group.id }}">Delete</a>
          </td>
        </tr>
      {% endfor %}
    </tbody>
    {% if charge.has_targets %}
      <tfoot>
        <tr>
          <th></th>
          <th style="text-align:right;"><i>Total:</i></th>
          <th><b>${{ charge.dollar_amount|round(2) }}</b></th>
          <th></th>
        </tr>
      </tfoot>
    {% endif %}
  </table>

  <div class="panel-body">
    {% include "preregistration/disclaimers.html" %}
  </div>
</div>
{% endblock %}

{'fraction_non_alphanumeric': 0.1651733951723411, 'fraction_numerical': 0.0034784441867819122, 'mean_word_length': 1.5512234471632158, 'pattern_counts': {'":': 0, '<': 215, '<?xml version=': 0, '>': 217, 'https://': 0, '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': '5096054', 'n_tokens_mistral': 3054, 'n_tokens_neox': 2793, 'n_words': 547}