{#
	Requires:
		actionsJSON: string
		siteName: string
		primaryKeyword: PrimaryKeywordNode
		modals: string[]
		groupLabelsJSON: string
		actionCallersJSON: string
		actionCallerConfig: string
#}

<script type="text/javascript">
/* <![CDATA[ */
var SiteManagerActions = {{ actionsJSON|raw }};
var SiteManagerActionGroupLabels = {{ groupLabelsJSON|raw }};
var ActionCallersRegistry = {{ actionCallersJSON|raw }};
var ActionCallerConfig = {{ actionCallerConfig|raw }};
var DetailLabelsJSON = {{ detailLabelsJSON|raw }};
var IndicatorGroups = {{ indicatorGroups|raw }};
var Indicators = {{ indicators|raw }};
var CallerIndicators = {{ callerIndicators|raw }};
var ActionThreads = {};
var ActionLoaders = {};
var BlockedActions = [];
/* ]]> */
</script>

{% include '@dashnex/header.twig' %}

<header class="dashnex-frame-header" id="dnc-page-header">
	<h3 class="pull-left">Site Manager</h3>
	<div class="dashnex-frame-primary-actions">
	</div>

	<div class="clearfix"></div>

	{% include '@dashnex/dashnex-log/dashnex-log.twig' %}
</header>

<div class="dashnex-frame-rounded-container">
	<div class="row">
		<div class="col-sm-6" id="ptm-tree">
			<div class="ptm-sidebar">
				<div class="ptm-sidebar__heading">
					<h4 class="pull-left" title="{{ siteName }}">{{ siteName }}</h4>
					<div class="pull-right" id="ptm-_add-actions"></div>
				</div>
				<div class="ptm-sidebar__content">

 					{% include '@dashnex/site-manager/nodes/primary-keyword.twig' %}

					{% for categoryKeyword in primaryKeyword.GetCategoryKeywords() %}

						{% include '@dashnex/site-manager/nodes/category-keyword.twig' with {includeChildren : true} %}

					{% endfor %}
				</div>
			</div>
		</div>
		<div class="col-sm-6" id="ptm-details">

			{% include '@dashnex/site-manager/details/primary-keyword.twig' %}

			{% for categoryKeyword in primaryKeyword.GetCategoryKeywords() %}

				{% include '@dashnex/site-manager/details/category-keyword.twig' %}

			{% endfor %}
		</div>
	</div>
	{% if indicatorsConfig|length > 0 %}
		<div class="ptm__legend">
			{% set first = true %}
			{% for group, groupIndicators in indicatorsConfig %}
				{% if first %}
					{% set first = false %}
				{% else %}
					<hr/>
				{% endif %}
				{% if groupsConfig[group] %}
					<h5>{{ groupsConfig[group] }}:</h5>
				{% endif %}
				{% for indicatorId, indicator in groupIndicators %}
					<div class="legend__item">
						<i
							class="{{ indicator.icon ? indicator.icon : 'fa fa-circle' }}"
							{% if indicator.color %}style="color:{{ indicator.color }};"{% endif %}
							{% if indicator.description %}
								data-trigger="hover"
								data-toggle="popover"
								data-placement="top"
								data-content="{{ indicator.description }}"
							{% endif %}
						></i>{{ indicator.label }}
					</div>
				{% endfor %}
			{% endfor %}
		</div>
	{% endif %}
</div>

<div class="dashnex-frame-popover">
	<div class="dashnex-frame-popover-arrow"></div>
	<h3 class="dashnex-frame-popover-title">Help</h3>
	<div class="dashnex-frame-popover-content">
		<p><a id="show-support-modal-btn" href="#">I need to email support.</a></p>
	</div>
</div>

{% include '@dashnex/modal/support.twig' %}

{% for modalPath in modals %}

	{% include modalPath %}

{% endfor %}
