<div class="report-export-popover row">

    <div class="col l6">
        <div piwik-field uicontrol="radio" name="format"
             data-title="{{ 'CoreHome_ExportFormat'|translate }}"
             ng-model="$parent.reportFormat"
             full-width="true"
             value="XML"
             options="availableReportFormats[$parent.reportType]">
        </div>

        <div piwik-field uicontrol="checkbox" name="option_flat"
             data-title="{{ 'CoreHome_FlattenReport'|translate }}"
             ng-model="$parent.optionFlat" ng-show="$parent.hasSubtables">
        </div>
        <div piwik-field uicontrol="checkbox" name="option_expanded"
             data-title="{{ 'CoreHome_ExpandSubtables'|translate }}"
             ng-model="$parent.optionExpanded" ng-show="$parent.hasSubtables && !$parent.optionFlat"
        >
        </div>
        <div piwik-field uicontrol="checkbox" name="option_format_metrics"
             data-title="{{ 'CoreHome_FormatMetrics'|translate }}"
             ng-model="$parent.optionFormatMetrics"
        >
        </div>
    </div>

    <div class="col l6">
        <div piwik-field uicontrol="radio" name="filter_type"
             data-title="{{ 'CoreHome_ReportType'|translate }}"
             ng-model="$parent.reportType"
             full-width="true"
             options="availableReportTypes">
        </div>

        <div class="filter_limit">
            <div piwik-field uicontrol="radio" name="filter_limit_all"
                 data-title="{{ 'CoreHome_RowLimit'|translate }}"
                 ng-model="$parent.reportLimitAll"
                 ng-hide="maxFilterLimit > 0"
                 full-width="false"
                 options="limitAllOptions">
            </div>
            <div piwik-field uicontrol="number" name="filter_limit"
                 min="1"
                 ng-model="$parent.reportLimit"
                 full-width="false"
                 ng-show="$parent.reportLimitAll == 'no' && maxFilterLimit <= 0">
            </div>

            <div piwik-field uicontrol="number" name="filter_limit"
                 min="1"
                 max="{{ scope.reportLimit }}"
                 ng-model="$parent.reportLimit"
                 ng-keypress="scope.checkNumberForLimit"
                 full-width="false"
                 data-title="{{ 'CoreHome_RowLimit'|translate }} ({{ 'General_ComputedMetricMax'|translate:maxFilterLimit }})"
                 ng-show="$parent.reportLimitAll == 'no' && maxFilterLimit > 0">
            </div>
        </div>
    </div>

    <div class="col l12" ng-show="showUrl">
        <textarea piwik-select-on-focus readonly class="exportFullUrl" title="{{ 'CoreHome_ExportTooltip'|translate }}">{{ getExportLink() }}</textarea>
    </div>

    <div class="col l12">
        <a class="btn" ng-attr-href="{{ getExportLink() }}" target="_new" title="{{ 'CoreHome_ExportTooltip'|translate }}">{{ 'General_Export'|translate }}</a>
        <a href="javascript:;" ng-click="showUrl=!showUrl" class="toggle-export-url">
            <span ng-show="!showUrl">{{ 'CoreHome_ShowExportUrl'|translate }}</span>
            <span ng-show="showUrl">{{ 'CoreHome_HideExportUrl'|translate }}</span>
        </a>
    </div>

</div>