{% extends "directories/base.html" %}
{% load directory_tags %}
{% load perm_tags %}
{% load base_filters %}
{% load i18n %}

{% block title %}{% trans "View Price Details:" %} {% firstof MODULE_DIRECTORIES_LABEL trans 'Directory' %} {% endblock %}

{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}css/directories.css">
{% endblock %}

{% block body %}
<div class="t">

    {% directory_pricing_nav request.user directory_pricing %}

    <h1>{% trans "View Price Details:" %} {% firstof MODULE_DIRECTORIES_LABEL trans 'Directory' %} </h1>
    
	<div class="directory-pricing-details">
	
		<div class="quick-options">
			{% directory_pricing_options request.user directory_pricing %} 	       
          </div>

		<div class="clear"></div>
	
		<div class="pricing-item">
			<div class="label">{% trans "Duration:" %}</div>
			<div class="field"><b>{{ directory_pricing.get_duration_display }}</b></div>
			<div class="clear-left"></div>
		</div>

		<div class="pricing-item">
			<div class="label">{% trans "Regular Price:" %}</div>
			<div class="field"><b>{{ directory_pricing.regular_price|format_currency }}</b></div>
			<div class="clear-left"></div>
		</div>

		<div class="pricing-item">
			<div class="label">{% trans "Premium Price:" %}</div>
			<div class="field"><b>{{ directory_pricing.premium_price|format_currency }}</b></div>
			<div class="clear-left"></div>
		</div>
		
		<div class="pricing-item">
			<div class="label">{% trans "Member Regular Price:" %}</div>
			<div class="field"><b>{{ directory_pricing.regular_price_member|format_currency }}</b></div>
			<div class="clear-left"></div>
		</div>

		<div class="pricing-item">
			<div class="label">{% trans "Member Premium Price:" %}</div>
			<div class="field"><b>{{ directory_pricing.premium_price_member|format_currency }}</b></div>
			<div class="clear-left"></div>
		</div>

		<div class="pricing-item">
			<div class="label">{% trans "Show Member Pricing:" %}</div>
			<div class="field"><b>{{ directory_pricing.show_member_pricing }}</b></div>
			<div class="clear-left"></div>
		</div>
		
		
		<div class="sep-line"></div>

		<div class="pricing-item">
			<div class="label"><b>{% trans "Status:" %}</b></div>
			<div class="field">{% if directory_pricing.status %}{% trans "Active" %}{%else%}{% trans "Inactive" %}{%endif%}</div>
			<div class="clear-left"></div>
		</div>
		<div class="pricing-item">
			<div class="label"><b>{% trans "Created by:" %}</b></div>
			<div class="field"><a href="{% url profile directory_pricing.creator_username %}">{{ directory_pricing.creator_username }}</a></div>
			<div class="clear-left"></div>
		</div>
		<div class="pricing-item">
			<div class="label"><b>{% trans "Created on:" %}</b></div>
			<div class="field">{{ directory_pricing.create_dt|date:"long" }}</div>
			<div class="clear-left"></div>
		</div>
		
		
		 <!-- delete-directory_pricing form -->
            <form name="directory-pricing-delete" method="POST" action="{% url directory_pricing.delete directory_pricing.pk %}">{% csrf_token %}
                <input type="hidden" name="action" value="delete">
            </form>
		
    </div>
 

</div>
{% endblock %}

{% block extra_body %}
    {{ block.super }}
    <script type="text/javascript">
		$(document).ready(function(){

			// delete confirmation
			$('.delete').click(function(){
				var delete_directory_pricing = confirm("Permenantly delete this directory price?");	// confirm
				if(delete_directory_pricing) $(this).parents('.directory-pricing-details').find('form[name="directory-pricing-delete"]').submit() // delete: if OK
				return false;	// cancel
			});
		});
    </script>
    
{% endblock %}
