{% extends "base.html" %}
{% load compressed djblets_deco i18n %}

{% block title %}{% trans "New Review Request" %}{% endblock %}

{% block css %}
{{block.super}}
{%  compressed_css "newReviewRequest" %}
{% endblock %}

{% block content %}
<div id="new-review-request"></div>
{% endblock %}

{% block scripts-post %}
{{block.super}}
{%  compressed_js "newReviewRequest" %}
<script type="text/javascript">
$(function() {
    var creator,
        creatorView;

    creator = new RB.NewReviewRequest({
        repositories: new Backbone.Collection([
{% for repo in repos %}
            new RB.Repository({
                name: '{{repo.name|escapejs}}',
                {% if repo.id %}id: {{repo.id}},{% endif %}
                filesOnly: {{repo.files_only|yesno:"true,false"}},
                supportsPostCommit: {{repo.supports_post_commit|yesno:"true,false"}},
                scmtoolName: '{{repo.scmtool_name|escapejs}}',
                localSitePrefix: '{% if repo.local_site_name %}s/{{repo.local_site_name|escapejs}}/{% endif %}',
                requiresChangeNumber: {{repo.requires_change_number|yesno:"true,false"}},
                requiresBasedir: {{repo.requires_basedir|yesno:"true,false"}}
            }){% if not forloop.last %},{% endif %}
{% endfor %}
        ], {
            model: RB.Repository
        })
    });

    creatorView = new RB.NewReviewRequestView({
        model: creator
    });
    creatorView.render();
})
</script>
{% endblock %}
