{% extends "base_generic.html" %}
{% block lefPanel %}{% include "leftMenuBar.html" %}{% endblock %}
{% block dash-title %}

		<b>{{form.text.value|default:"Noticias"|capfirst}}</b>
		[{{form.startDate.value}}, {{form.endDate.value}}]
{% endblock %}


{% block dash %}

            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Noticias
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">



                            <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-news">
                                <thead>
                                    <tr>
                                        <th>Titulo</th>
                                        <th>URL</th>
					<th>Fecha</th>
                                    </tr>
                                </thead>
                               <tfoot>
                                    <tr>
                                        <th>Titulo</th>
                                        <th>URL</th>
                                        <th>Fecha</th>
                                    </tr>
                                </tfoot>

                            </table>
                            <!-- /.table-responsive -->



                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->

{% endblock %}


{% block scripts %}
    <script>
    $(document).ready(function() {
        $('#dataTables-news').DataTable({
		"order": [[ 2, "desc" ]],
		"responsive": true,
	        "processing": true,
        	"serverSide": true,
                "language": {"url": "/static/languages/Spanish.json" },
		"ajax": {
			"url":"/catalog/ws/news/",
			"data":{"startDate":"{{form.startDate.value}}", "endDate":"{{form.endDate.value}}", "ajaxPublishers":[{% for p in form.publishers.value %}{{p}}{% if not forloop.last %},{% endif %}{% endfor %}], "text":"{{form.text.value}}"}

			}

        });
    });
	console.log(" {{form.publishers.data|safe}} ");
    </script>

{% endblock %}

