<script src="{$urls.JS_PATH}/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
	jQuery.noConflict();
</script>
<script src="{$urls.JS_PATH}/ractive/Ractive.min.js"></script>
<link href="{$urls.CSS_PATH}/{$moduleName}.css" rel="stylesheet" type="text/css" media="all" />
<link href="{$urls.CSS_PATH}/ReportBuilder.css" rel="stylesheet" type="text/css" media="all" />

<a class="ar-button" style="margin:20px 0 0 20px;" href="{$urls.index}">Back to reports</a>

{* If reportID is passed, then offer to return to current report *}
{if $REPORTID neq false}
    <a class="ar-button green" style="margin:5px;" href="{$urls.report}{$REPORTID}">Back to report</a>
{/if}

{if empty($simpleBuilder)}
	<a class="ar-button blue" style="margin:20px 0 0 20px;" href="{$urls.reportBuilderSimple}">Simple</a>
{/if}

{include file="$TPL_PATH/ReportBuilder/templates.tpl"}

<div id="ar-report-builder"></div>

{literal}
<script>
//passed to reportBuilder
var reportBuilderOptions = {
    //lists of predefined elements
    types:{
        {/literal}
        reportTypes:{$reportTypes},
        relationTypes:{$relationTypes},
        moduleTypes:{$modules},
        modulesFieldTypes:{$modulesFields},
        categoryTypes:{$categories},
        manyToManyTypes:{$manyToManyConfig},
        {literal}
    },
    //internal attributes, server urls, server response
    {/literal}
    urls:{$urlsJSON},
    predefinedChildren:{$predefinedChildren},
    reportOptions:{$reportOptions},
    {literal}
};
var translated_labels = {/literal}{$DICTIONARY}{literal};
var systemModuleName = "{/literal}{$moduleName}{literal}";
</script>
{/literal}
<!-- env:dev --#>
<script src="{$urls.JS_PATH}/components/reportBuilder.js"></script>
<!-- env:dev:end -->
<!-- env:prod -->
<script src="{$urls.JS_PATH}/builder.min.js?v=3.0.278"></script>
<!-- env:prod:end -->
