{% load i18n %} 
{% load base_filters %}
{% load perm_tags %}


{% if registration.enabled %}
    {% if event.is_over and not request.user.is_superuser %}
        <div class="registration-red">
            {% trans "Event has ended" %}
        </div>
    {% else %}
        {% if spots_taken >= limit and limit > 0 %}
            <div class="registration-orange">
                {% trans "Event is full" %}
            </div>          
        {% else %}
            {% if reg_ended %}
                <div class="registration-red">
                    {% trans "Registration has ended" %}
                </div>
            {% endif %}
            {% if not reg_started %}
                <div class="registration-red">
                    <div>{% trans "Registration starts on " %}</div>
                    <div><strong>{{ earliest_time }}</strong></div>
                </div>
            {% endif %}
            {% if pricing %}
                <div class="pricing-list-wrap">
                	<form action="{% url event.register event.pk %}" method="get">
                	{% if pricing|length == 1 and pricing.0.amount == 0 %}
                	 <input class="registration-green-button" type="submit" name="submit" value="{% trans 'Register for Free' %}" />
                	{% else %}
                	<ul>
                		{% for price in pricing %}
                		<li>
                		    {{ price.title }}{% if price.target_display %} ({{ price.target_display }}) {% endif %} - &nbsp;<strong>{{ SITE_GLOBAL_CURRENCYSYMBOL }}{{ price.price }}</strong><br>
                            ({% trans "ends" %} {{ price.end_dt|date:"m/d/Y" }})
                		</li>
                		
                		{% endfor %}
                	</ul>
                	<input class="registration-green-button" type="submit" name="submit" value="{% trans 'Register' %}" />
                	{% endif %}
                	
                	</form>
                	
                {% include "events/include/spots_status.html" %}	
                 
                {% if is_registrant %}
                <div id="is-registrant"><a href="{% url event.registrant.search event.pk %}?q={{ user.email }}">You have already registered</a></div>
                {% endif %}

                </div>
            {% endif %}
        {% endif %}
    {% endif %}
{% endif %}
