<!doctype html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

        <title>{{object.title}}</title>
        <meta name="description" content="">

        <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
        <link id="page_favicon" href="{{MEDIA_URL}}frog/i/favicon.ico" rel="icon" type="image/x-icon" />
        <link rel="stylesheet" href="{{MEDIA_URL}}frog/c/ext-all-gray.css">
        <link rel="stylesheet" href="{{MEDIA_URL}}frog/c/style.css">
        {% for stylesheet in plugins.css%}
        <link rel="stylesheet" href="{{MEDIA_URL}}{{stylesheet}}">
        {% endfor %}

        <script src="{{MEDIA_URL}}frog/j/libs/modernizr-2.5.3.min.js"></script>
        <script src="{{MEDIA_URL}}frog/j/ext-all.js"></script>
        <script src="{{MEDIA_URL}}frog/j/mootoolsCore.js"></script>

        <script>
            {% block script %}
            window.addEvent('domready', function() {
                Frog.StaticRoot = '{{MEDIA_URL}}';

                {% if object.private %}
                    {% if user == object.owner %}
                        new Frog.Gallery(undefined, {{object.id}}, {
                            private: {{object.private|yesno:'true,false'}},
                            upload: {{object.uploads|yesno:'true,false'}}
                        });
                        {% for button in plugins.buttons %}
                        Frog.UI.addTool(
                            '{{button.0}}',
                            '{{MEDIA_URL}}{{button.1}}',
                            {{button.2}}
                        );
                        {% endfor %}
                    {% else %}
                        $('main').set('html', '<h1>Gallery is private</h1>');
                    {% endif %}
                {% else %}
                    new Frog.Gallery(undefined, {{object.id}}, {
                        private: {{object.private|yesno:'true,false'}},
                        upload: {{object.uploads|yesno:'true,false'}}
                    });
                    {% for button in plugins.buttons %}
                    Frog.UI.addTool(
                        '{{button.0}}',
                        '{{MEDIA_URL}}{{button.1}}',
                        {{button.2}}
                    );
                    {% endfor %}
                {% endif %}
            });
            {% endblock %}
        </script>
    </head>
    <body>
        {% block content %}
        <div id="main">
            
        </div>
        {% endblock %}
        <!-- JavaScript at the bottom for fast page loading -->
        <script src="{{MEDIA_URL}}frog/j/mootoolsMore.js"></script>

        <script src="{{MEDIA_URL}}frog/j/libs/plupload.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/plupload.html5.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/Meio.Autocomplete.min.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/sylvester.js"></script>

        <!-- scripts concatenated and minified via build script -->
        <script src="{{MEDIA_URL}}frog/j/libs/frog.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/frog.thumbnail.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/frog.viewer.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/frog.queryBuilder.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/frog.uploader.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/frog.observer.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/frog.ui.js"></script>
        <script src="{{MEDIA_URL}}frog/j/libs/frog.gallery.js"></script>

        <script src="{{MEDIA_URL}}frog/j/plugins.js"></script>
        <script src="{{MEDIA_URL}}frog/j/script.js"></script>

        {% for script in plugins.js%}
        <script src="{{MEDIA_URL}}{{script}}"></script>
        {% endfor %}
        <!-- end scripts -->
    </body>
</html>