


	{% set allkeys = [filterkeys,limitkeys,delimitkeys,amountkeys] | combine_dicts %}



	{% if limitkeys != {} %}

		<div>
			{% set thisrange = limitkeys.timerange %}
			{% set prevrange = thisrange.next(-1) %}
			{% set nextrange = thisrange.next(1) %}

			{% if prevrange is not none %}
				<a href='{{ mlj_uri.create_uri("",filterkeys,limitkeys,delimitkeys,{'timerange':prevrange}) }}'><span class='stat_selector'>{{ prevrange.desc() }}</span></a>
				«
			{% endif %}
			{% if prevrange is not none or nextrange is not none %}
				<span class='stat_selector' style='opacity:0.5;'>{{ thisrange.desc() }}</span>
			{% endif %}
			{% if nextrange is not none %}
				»
				<a href='{{ mlj_uri.create_uri("",filterkeys,limitkeys,delimitkeys,{'timerange':nextrange}) }}'><span class='stat_selector'>{{ nextrange.desc() }}</span></a>
			{% endif %}

		</div>


		<div>
			{% for r in xcurrent %}
				{% if r.range == limitkeys.timerange %}
					<span class='stat_selector' style='opacity:0.5;'>{{ r.localisation }}</span>
				{% elif r.heavy and settings['DISCOURAGE_CPU_HEAVY_STATS'] %}
					<span class='stat_selector blocked' title="CPU heavy statistics are discouraged at the moment.">{{ r.localisation }}</span>
				{% else %}
					<a href='{{ mlj_uri.create_uri("",allkeys,{"timerange":r.range}) }}'><span class='stat_selector'>{{ r.localisation }}</span></a>
				{% endif %}
				{{ "|" if not loop.last }}
			{% endfor %}
		</div>
	{% endif %}


	{% if delimitkeys != {} %}
		<div>
			{% for cat in [xdelimiters,xtrails] %}
				{% for r in cat %}
					{# {% if all(r.keys[k] == allkeys[k] for k in r.keys) %} #}
					{% if r.replacekeys | map('compare_key_in_dicts',r.replacekeys,allkeys) | alltrue %}
						<span class='stat_selector' style='opacity:0.5;'>{{ r.localisation }}</span>
					{% elif r.heavy and settings['DISCOURAGE_CPU_HEAVY_STATS'] %}
						<span class='stat_selector blocked' title="CPU heavy statistics are discouraged at the moment.">{{ r.localisation }}</span>
					{% else %}
						<a href='{{ mlj_uri.create_uri("",allkeys,r.replacekeys) }}'><span class='stat_selector'>{{ r.localisation }}</span></a>
					{% endif %}
					{{ "|" if not loop.last }}
				{% endfor %}
				<br/>
			{% endfor %}
		</div>

	{% endif %}
