{% extends "ldt/ldt_base.html" %}
{% load i18n %}

{% block js_import %}
{{block.super}}
	<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/projectscontents.js" ></script>
{% endblock %}


{% block js_declaration %}
{{block.super}}
<script type="text/javascript">

var content_filter_url = "{% url ldt.ldt_utils.views.contentsfilter filter='__FILTER__' %}";
var project_filter_url = "{% url ldt.ldt_utils.views.projectsfilter filter='__FILTER__' is_owner='false' status='0' %}";
var publish_project_url = "{% url ldt.ldt_utils.views.publish '__PROJECT_ID__' 'false' %}";
var unpublish_project_url = "{% url ldt.ldt_utils.views.unpublish '__PROJECT_ID__' 'false' %}";


function init_events(base_node) {

	init_events_all(base_node, "{% url ldt.ldt_utils.views.popup_embed %}", content_filter_url, project_filter_url, publish_project_url, unpublish_project_url);
	
}
	
var global_csrf_token = "{{ csrf_token }}";

$(document).ready(function(){
	
	input_list_init = [
		{'input_selector':"#searchcontentsinput", 'container_selector':"#contentslistcontainer", 'url':content_filter_url},
		{'input_selector':"#searchprojectsinput", 'container_selector':"#projectslistcontainer", 'url':project_filter_url}
	];
	
	searchFieldInit(input_list_init);
	
	init_events(document);

});
</script>

{% endblock %}

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

{% block content %}
<div class="span-24 last" id="allcontentsdiv">
	<div class="span-12" id="contentsdiv">
	    <div class="span-12 last titlediv" >
			<div class="span-8 projectscontentstitle">{% trans "content list" %}</div>
			<div class="span-4 last searchfielddiv" >
			    <div class="searchfield rounded"><input id="searchcontentsinput" class="searchfieldinput searchfieldinputbase" value="{% trans 'search' %}" type="text" /><img id="contentsajaxloader" class="searchajaxloader" src="{{LDT_MEDIA_PREFIX}}/img/ajax-loader-16x16.gif" alt="loader"/><img id="contentsclear" class="searchclear" src="{{LDT_MEDIA_PREFIX}}img/clear-left.png"/></div>
			</div>
		</div>
		<div class="span-12 last projectscontentsdiv" id="contentslistcontainer">
		{% include "ldt/ldt_utils/partial/contentslist.html" %}
		</div>
	</div>		
	<div class="span-12 last" id="projectsdiv">
		<div class="span-12 last titlediv" >
			<div class="span-8 projectscontentstitle" >{% trans "project list" %}</div>
			<div class="span-4 last searchfielddiv" >
			    <div class="searchfield rounded"><input id="searchprojectsinput" class="searchfieldinput searchfieldinputbase" value="{% trans 'search' %}" type="text" /><img id="projectsajaxloader" class="searchajaxloader" src="{{LDT_MEDIA_PREFIX}}/img/ajax-loader-16x16.gif" alt="loader"/><img id="projecsclear" class="searchclear" src="{{LDT_MEDIA_PREFIX}}img/clear-left.png"/></div>
			</div>
		</div>
		<div class="span-12 last projectscontentsdiv" id="projectslistcontainer">
		{% include "ldt/ldt_utils/partial/projectslist.html" %}
		</div>
	</div>
</div>
{% endblock %}
