{% extends "admin/base_site.html" %}

{% block title %}Simple Medias Manager {{ block.super }}{% endblock %}

{% block extrahead %}{{ block.super }}
<link href="/static/js/colorbox/colorbox.css" type="text/css" media="all" rel="stylesheet" />

<script type="text/javascript" src="/static/admin/js/jquery.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
<script type="text/javascript" src="/static/js/colorbox/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="/static/js/colorbox/app.colorbox.js"></script>
{% endblock %}

{% block content %}
<div id="page">
        

        <div id="wrapper" role="main">
            <p><a href="/admin/simple_medias_manager/file/add/" class="colorbox-iframe-r">Ajouter un fichier</a></p>
            <ul id="list-files">
                {% for file in file_list %}
                    <li rel="{{ file.the_file.url }}"><a href="#">{{ file.the_file }} - {{ file.name }}</a></li>
                {% endfor %}
            </ul>
        </div>


        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="{{ STATIC_URL }}js/libs/jquery-1.7.1.min.js"><\/script>')</script>
        <script type="text/javascript">
            $('document').ready(function(){
                $('#list-files li').click(function(e){
                    window.opener.CKEDITOR.tools.callFunction({{ callback }}, $(this).attr('rel'));
                    window.close();
                });
            });
        </script>
    </div>
{% endblock %}
