{% extends "events/base.html" %}
{% load pagination_tags %}
{% load event_tags %}
{% load base_tags %}
{% load perm_tags %}
{% load search_tags %}
{% load i18n %}

{% block title %}{% trans "Pending Events" %}{% endblock %}

{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}css/events.css">
<link type="text/css" href="{{ STATIC_URL }}css/jquery_ui_all_custom/jquery-ui-1.8.5.custom.css" rel="stylesheet" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/events-pending.css">
<link rel="alternate" type="application/rss+xml" title="Latest Events" href="{% url event.feed %}" />
{% endblock %}

{% block body %}

<div class="t search-view">
{% event_nav request.user %}
    <h1>{% trans "Pending Events" %}</h1>  
    
    {% autopaginate events 10 %}
    
	<div class="events-wrap">
    {% for event in events %}
        {% search_result event %}
	{% empty %}
        {% trans "0 Pending Events" %}
    {% endfor %}
	</div>

    {% paginate %}
</div>
{% endblock %}

{% block extra_body %}
    {{ block.super }}
    <script type="text/javascript">
		$(document).ready(function(){
			// delete confirmation
			$('.delete').click(function(){
				var delete_object = confirm("Permenantly delete {% firstof MODULE_EVENTS_LABEL 'Event' %}?");	// confirm
				if(delete_object) $(this).parents('.event-wrap').find('form[name="event-delete"]').submit() // delete: if OK
				return false;	// cancel
			});
		});
    </script>

    <script type="text/javascript" src="{{ STATIC_URL }}js/global/dropdown.js"></script>
	<script type="text/javascript">
		var iconrow = new dropdown({
			container:	'more-options-wrap',
			trigger:	'more-options-trigger',
			target:		'more-options-target'
		});
	</script>
	<script src="{{ STATIC_URL }}js/jquery.inputfieldtext.js" type="text/javascript"></script>
	<script type="text/javascript">
		$('.search-form input[type="text"]').inputFieldText('Search past, present, and future events', 'search-hint');
	</script>
	<script type="text/javascript" src="{{ STATIC_URL }}js/jquery_ui_all_custom/jquery-ui-1.8.5.custom.min.js"></script>
	<script type="text/javascript">
		// Dialog			
		$('#event_export_dialog').dialog({
			autoOpen: false,
			width: 600,
			buttons: { 
				"Close": function() { 
					$(this).dialog("close"); 
				} 
			}
		});
		// Dialog Link
		$('#event_export_link').click(function(){
			$('#event_export_dialog').show();
	        $('#event_export_dialog').dialog('open'); 
	 
			return false;
		});
	</script>
{% endblock %}
