<commit_before>{{ partial "header.html" . }}
{{ $url := (print (index .Site.Params.domainapi (getenv "NODE_ENV") | default .Site.Params.domainapi.dev) "/api/action-line/" .Params.id ) }}

{{ $action_line := getJSON $url }}

{{ with $action_line.action_line }}

<article role="main" id="conteudo" class="h-entry">
	<div class="h-entry__e-content e-content">
		<header>
			<h2>
				{{ i18n "actionLine" 1 }}
				{{ .id }}
			</h2>

			<h3>
				{{ i18n "topic" 1 | lower }} {{ .topic.name }}
			</h3>

			<h1 class="h-entry__p-name p-name">{{ trim .title "." }}</h1>
		</header>

		<section class="map-container">
			<h2>{{ i18n "regionalizationMap" }}</h2>
			{{ if not .subprefectures }}
				<p class="warning">{{ i18n "dataNotRestrictedToARegion" }}</p>
			{{ end }}
			<div id="map" class="map"
				{{ if .subprefectures }}
					data-link-for="subprefectures" data-info-panel-for="subprefectures" data-info-panel-for-subprefectures="info-panel__subprefectures--indicator" data-to-draw="subprefectures" data-subprefectures-to-draw="{{ range .subprefectures }}{{ .id }} {{ end }}"
					data-subprefectures-distribute-by="indicator"
				{{ else }}
					data-to-draw="cities"
				{{ end }}
			></div>
		</section>

		{{ if .subprefectures }}
			<section class="projection">
				<h2>{{ i18n "regionalization" }}</h2>
				<table>
					<thead>
						<tr>
							<th>{{ i18n "regionalPrefecture" (len .) | title }}</th>
							<th>{{ i18n "value" | title }} 2017-2020</th>
						</tr>

					</thead>

					<tbody>
						{{ range .subprefectures }}
						<tr>
							<th>
								{{ with .slug }}
									<a href="/prefeituras-regionais/{{ . }}">
								{{ end }}
									{{ .name }}
								{{ with .slug }}
									</a>
								{{ end }}
							</th>

							<td>
								{{ .indicator }}
							</td>
						</tr>
						{{ end }}
					</tbody>
				</table>
				<script>
					var customDistribution = customDistribution || {};

					customDistribution.indicator = {
						{{ range .subprefectures }}
							{{ .id }}: "{{ .indicator }}",
						{{ end }}
					};
				</script>

				<script type="text/template" id="info-panel__subprefectures--indicator"><commit_msg>Hide subprefectures without action lines<commit_after>{{ partial "header.html" . }}
{{ $url := (print (index .Site.Params.domainapi (getenv "NODE_ENV") | default .Site.Params.domainapi.dev) "/api/action-line/" .Params.id ) }}

{{ $action_line := getJSON $url }}

{{ with $action_line.action_line }}

<article role="main" id="conteudo" class="h-entry">
	<div class="h-entry__e-content e-content">
		<header>
			<h2>
				{{ i18n "actionLine" 1 }}
				{{ .id }}
			</h2>

			<h3>
				{{ i18n "topic" 1 | lower }} {{ .topic.name }}
			</h3>

			<h1 class="h-entry__p-name p-name">{{ trim .title "." }}</h1>
		</header>

		<section class="map-container">
			<h2>{{ i18n "regionalizationMap" }}</h2>
			{{ if not .subprefectures }}
				<p class="warning">{{ i18n "dataNotRestrictedToARegion" }}</p>
			{{ end }}
			<div id="map" class="map"
				{{ if .subprefectures }}
					data-link-for="subprefectures" data-info-panel-for="subprefectures" data-info-panel-for-subprefectures="info-panel__subprefectures--indicator" data-to-draw="subprefectures" data-subprefectures-to-draw="{{ range .subprefectures }}{{ .id }} {{ end }}"
					data-subprefectures-distribute-by="indicator"
				{{ else }}
					data-to-draw="cities"
				{{ end }}
			></div>
		</section>

		{{ if .subprefectures }}
			<section class="projection">
				<h2>{{ i18n "regionalization" }}</h2>
				<table>
					<thead>
						<tr>
							<th>{{ i18n "regionalPrefecture" (len .) | title }}</th>
							<th>{{ i18n "value" | title }} 2017-2020</th>
						</tr>
					</thead>

					<tbody>
						{{ range .subprefectures }}
							{{ if ne .indicator "0" }}
								<tr>
									<th>
										{{ with .slug }}
											<a href="/prefeituras-regionais/{{ . }}">
										{{ end }}
											{{ .name }}
										{{ with .slug }}
											</a>
										{{ end }}
									</th>

									<td>
										{{ .indicator }}
									</td>
								</tr>
							{{ end }}
						{{ end }}
					</tbody>
				</table>
				<script>
					var customDistribution = customDistribution || {};

					customDistribution.indicator = {
						{{ range .subprefectures }}
							{{ .id }}: "{{ .indicator }}",
						{{ end }}
					};
				</script>

				<script type="text/template" id="info-panel__subprefectures--indicator">
{'fraction_non_alphanumeric': 0.20388349514563106, 'fraction_numerical': 0.015579137502822308, 'mean_word_length': 2.356060606060606, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1345988', 'n_tokens_mistral': 2173, 'n_tokens_neox': 1570, 'n_words': 292}