{% extends "ldt/user/user_base.html" %}
{# list of projects ldt #}
{%load i18n %}
{% block js_import %}{{ block.super }}
<script type="text/javascript">           
        $(document).ready(function(){
        	$('.ldt_link').nyroModal({
        		height:662, 
        		width:1022, 
        		type:'iframe',
        		forceType:'iframe',
        		padding:5,
        		bgColor: 'rgb(239, 239, 239)',
                titleFromIframe: false,
                beforeHideContent: function(elts, settings, callback){
                    try {                       
                        var res = $('#ldtInitSwf',$('#nyroModalIframe').contents());
                        if(res.length > 0)
                        {
                            var swfobj = res.get(0);
                            if(swfobj && swfobj.forceSave != undefined)          
                                swfobj.forceSave();
                        }
                    }
                    catch(err)
                    {
                        // do nothing
                    }                   
                    callback();
                }        		
            	});
            $('.create_ldt_link').nyroModal({
        		height:662, 
        		width:1022, 
        		type:'ajax', 
        		padding:5,
        		bgColor: 'rgb(239, 239, 239)',
            	});       
        });        	        
</script>
{% endblock %}

{% block css_import %}
{{ block.super }}
	<link rel="stylesheet" type="text/css"
		href="{{ BASE_URL }}static/ldt/css/ldt.css" />
{% endblock %}

{% block breadcrumb %}
<li></li>
<li><a href="{% url ldt.userpanel.views.space %}">{% trans "Space" %}</a></li>
<li>{% trans "Ldt Project" %}</li>
{% endblock %}

{% block content_title %}{% trans "Ldt Project" %}{%endblock %}

{% block iricontent %}
<div id='ldtlist'><a
	href="{% url ldt.ldt_utils.views.create_ldt_view %}" class="create_ldt_link">{% trans 'Create new project'%}</a>
<table>
	<caption>{% trans "Project" %}</caption>
	<thead>
		<tr>
			<th width="170">{% trans "title" %}</th>
			<th width="20">{% trans " published" %}</th>
		</tr>
	</thead>
	<tbody>
		{% for ldt in projects %}
		<tr>
			<th><a href="{% url ldt.ldt_utils.views.indexProject ldt.ldt_id %}"
				class="ldt_link">{{ ldt.title }}</a></th>
			{% ifequal ldt.state 2%}
			<td><a href="{% url ldt.ldt_utils.views.unpublish ldt.ldt_id%}"><img
				alt="True" src="{{BASE_URL}}static/admin/img/admin/icon-yes.gif" /></a></td>
			{% else %}
			<td><a href="{% url ldt.ldt_utils.views.publish ldt.ldt_id %}"><img
				alt="False" src="{{BASE_URL}}static/admin/img/admin/icon-no.gif" /></a></td>
			{% endifequal %}
		</tr>
		{% endfor %}
	</tbody>
</table>
</div>
{% endblock %}

