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

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

{% block extrahead %}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
{% endblock %}

{% block page_class %}new-review-request-page full-page-content has-sidebar mobile-show-page-sidebar{% endblock %}

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

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

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

{% block scripts-post %}
{{block.super}}
{%  compressed_js "newReviewRequest" %}
<script>
$(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 %}
