{% extends "new/adminLTE2_base.html" %}
{% load static %}
{% load humanize %}

{% block headMedia %}
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.css"/>
{% endblock %}

{% block leftbar %}
        {% include "new/index-leftbar.html" %}
{% endblock %}

{% block dash-title %}

		<b>{{form.text.value|default:"Fuentes de Información"|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">
                            Fuentes de Información
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">



                            <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                    <tr>
                                        <th>Nombre</th>
					<th>ID</th>
                                        <th>url</th>
					<th>Desde</th>
					<th>Noticias</th>
					<th>Tipo</th>
                                    </tr>
                                </thead>
                                <tbody>
					{% for p in publishers %}
                                    <tr class="odd gradeX">
                                        <td>{{p.name}}</td>
					<td>{{p.shortName}}</td>
                                        <td><a href="{{p.url}}" target="blank">{{p.url}}</a></td>
					<td>{{p.date}}</td>
					<td><a href="{% url 'news-list'%}?publishers={{p.id}}&{{queryurl}}">{{p.news|intcomma}}</a></td>
					<td>{{p.type}}</td>
                                    </tr>
					{% endfor %}
                                </tbody>
                            </table>
                            <!-- /.table-responsive -->



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

{% endblock %}


{% block scripts %}
        <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.js"></script>

    <script>
    $(document).ready(function() {
        $('#dataTables-example').DataTable({
            responsive: true,
                "language": {"url": "/static/languages/Spanish.json" }
        });
    });
    </script>

{% endblock %}

