{% extends "layouts/base.html" %}

{% block title %} Organisasi {% endblock %} 

<!-- Specific Page CSS goes HERE  -->
{% block stylesheets %}
{% endblock stylesheets %}
{% block content %}

{% load static %}
	<div class="content">
		<div class="page-inner">
			<div class="page-header">
				<h4 class="page-title">Organisasi</h4>
				<ul class="breadcrumbs">
					<li class="nav-home">
						<a href="#">
							<i class="flaticon-home"></i>
						</a>
					</li>
					<li class="separator">
						<i class="flaticon-right-arrow"></i>
					</li>
					<li class="nav-item">
						<a href="{% url 'home' %}">Home</a>
					</li>
					<li class="separator">
						<i class="flaticon-right-arrow"></i>
					</li>
					<li class="nav-item">
						<a href="{% url 'organisasiNew' %}">Organisasi</a>
					</li>
					{% if 'q' in request.GET %}
						<li class="separator">
							<i class="flaticon-right-arrow"></i>
						</li>
						<li class="nav-item">
							<a href="#">{{ esl3|title }}</a>
						</li>
					{% endif %}
				</ul>
			</div>

			{% if 'q' not in request.GET %}
			<div class="row justify-content-center align-items-center mb-1">
				<div class="col-md-12">
					<div class="card">
						<div class="card-body">
							<div class="row row-demo-grid">
								<div class="col-md-6 ml-auto mr-auto">
									{% for i in es1 %}
										<button class="btn btn-danger mr-auto ml-auto">{{i.unit}}</button>
									{% endfor %}
								</div>
							</div>

							<!-- <div class="row row-demo-grid"> -->
								<!-- {% for a, b in data.items %} -->
								<!-- <div class="col-2 col-md-2 ml-auto mr-auto" style="padding-left: 0px;padding-right: 0px;"> -->
									<!-- <div class="nav flex-column nav-pills nav-secondary" id="v-pills-tab" role="tablist" aria-orientation="vertical"> -->
										<!-- <a href="#" class="nav-link btn-primary">{{ a }}</a> -->
										<!-- {% for c in b %} -->
										<!-- <a class="nav-link btn-xs" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true"><p style="font-size:11px;" >{{ c }}</p></a> -->
										<!-- <a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Profile</a>
										<a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">Messages</a> -->
										<!-- {% endfor %} -->
									<!-- </div> -->
								<!-- </div> -->
								<!-- {% endfor %} -->
								<!-- <div class="col-7 col-md-8">
									<div class="tab-content" id="v-pills-tabContent">
										<div class="tab-pane fade active show" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
											<p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.</p>

											<p>A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.</p>
										</div>
										<div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab">
											<p>Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar.</p>
											<p>The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen. She packed her seven versalia, put her initial into the belt and made herself on the way.
											</p>
										</div>
										<div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab">
											<p>Pityful a rethoric question ran over her cheek, then she continued her way. On her way she met a copy. The copy warned the Little Blind Text, that where it came from it would have been rewritten a thousand times and everything that was left from its origin would be the word "and" and the Little Blind Text should turn around and return to its own, safe country.</p>

											<p> But nothing the copy said could convince her and so it didn’t take long until a few insidious Copy Writers ambushed her, made her drunk with Longe and Parole and dragged her into their agency, where they abused her for their</p>
										</div>
									</div>
								</div> -->
							<!-- </div> -->
							<div class="row row-demo-grid">
								{% for a, b in data.items %}
								<div class="col-2 col-md-2 ml-auto mr-auto" style="padding-left: 0px;padding-right: 0px;">
									<a href="#" class="nav-link btn-info">{{ a }}</a>
									{% for c in b %}
										<a href="?q={{ c }}" class="nav-link btn-info btn-border mt-1" >
											<p style="font-family: Arial, Helvetica, sans-serif; font-size:11px; margin-bottom: 0; line-height: 15px;" >{{ c }}</p></a>
									{% endfor %}
								</div>
								{% endfor %}
							</div>
						</div>
					</div>
				</div>


				{% for a, b in data.items %}
					<!-- <div class="col-md-2 pl-md-0">
						<div class="card card-pricing card-pricing-focus card-primary">
							<div class="card-body">
								<h5>{{ a }}</h5>
								<ul class="specification-list">
									{% for c in b %}
										<li>
											<span class="name-specification">{{ c|title }}</span>
										</li>
									{% endfor %}
								</ul>
							</div>
						</div>
					</div> -->
				{% endfor %}

				<!-- <div class="col-md-2 pl-md-0">
					<div class="card card-pricing card-pricing-focus card-primary">
						<div class="card-body">
							<h5>SEKRETARIAT</h5>
							<ul class="specification-list">
								<li>
									<span class="name-specification">Subdirektorat Pengembangan Aplikasi, Basis Data, Infrastruktur, dan Operasional Teknologi Informasi</span>
								</li>
								<li>
									<span class="name-specification">Chat History</span>
								</li>
								<li>
									<span class="name-specification">Statistics</span>
								</li>
								<li>
									<span class="name-specification">Support</span>
								</li>
								<li>
									<span class="name-specification">Live Support</span>
								</li>
							</ul>
						</div>
					</div>
				</div>
				<div class="col-md-2 pl-md-0">
					<div class="card card-pricing card-pricing-focus card-primary">
						<div class="card-header">
							<h5>DIREKTORAT DANA TRANSFER UMUM</h5>
						</div>
						<div class="card-body">
							<ul class="specification-list">
								<li>
									<span class="name-specification">SUBDIREKTORAT PENGEMBANGAN APLIKASI, BASIS DATA, INFRASTRUKTUR, DAN OPERASIONAL TEKNOLOGI INFORMASI</span>
								</li>
								<li>
									<span class="name-specification">Chat History</span>
								</li>
								<li>
									<span class="name-specification">Statistics</span>
								</li>
								<li>
									<span class="name-specification">Support</span>
								</li>
								<li>
									<span class="name-specification">Live Support</span>
								</li>
							</ul>
						</div>
					</div>
				</div>
				<div class="col-md-2 pl-md-0">
					<div class="card card-pricing card-pricing-focus card-primary">
						<div class="card-header">
							<h5>DIREKTORAT DANA TRANSFER KHUSUS</h5>
						</div>
						<div class="card-body">
							<ul class="specification-list">
								<li>
									<span class="name-specification">SUBDIREKTORAT PENGEMBANGAN APLIKASI, BASIS DATA, INFRASTRUKTUR, DAN OPERASIONAL TEKNOLOGI INFORMASI</span>
								</li>
								<li>
									<span class="name-specification">Chat History</span>
								</li>
								<li>
									<span class="name-specification">Statistics</span>
								</li>
								<li>
									<span class="name-specification">Support</span>
								</li>
								<li>
									<span class="name-specification">Live Support</span>
								</li>
							</ul>
						</div>
					</div>
				</div>
				<div class="col-md-2 pl-md-0">
					<div class="card card-pricing card-pricing-focus card-primary">
						<div class="card-header">
							<h5>DIREKTORAT KAPASITAS DAN PELAKSANAAN TRANSFER</h5>
						</div>
						<div class="card-body">
							<ul class="specification-list">
								<li>
									<a href="test/"><span class="name-specification">Subdirektorat Pengembangan Aplikasi, Basis Data, Infrastruktur, dan Operasional Teknologi Informasi</span></a>
								</li>
								<li>
									<span class="name-specification">Chat History</span>
								</li>
								<li>
									<span class="name-specification">Statistics</span>
								</li>
								<li>
									<span class="name-specification">Support</span>
								</li>
								<li>
									<span class="name-specification">Live Support</span>
								</li>
							</ul>
						</div>
					</div>
				</div>
				<div class="col-md-2 pl-md-0">
					<div class="card card-pricing card-pricing-focus card-primary">
						<div class="card-header">
							<h5>DIREKTORAT EVALUASI DAN SISTEM INFORMASI</h5>
						</div>
						<div class="card-body">
							<ul class="specification-list">
								<li>
									<span class="name-specification">SUBDIREKTORAT PENGEMBANGAN APLIKASI, BASIS DATA, INFRASTRUKTUR, DAN OPERASIONAL TEKNOLOGI INFORMASI</span>
								</li>
								<li>
									<span class="name-specification">Chat History</span>
								</li>
								<li>
									<span class="name-specification">Statistics</span>
								</li>
								<li>
									<span class="name-specification">Support</span>
								</li>
								<li>
									<span class="name-specification">Live Support</span>
								</li>
							</ul>
						</div>
					</div>
				</div> -->
			</div>

			{% else %}
			<div class="row">
				<div class="col-md-12">
					<div class="card">
						<div class="card-header text-primary">
							<h2>{{info_unit.0.unit}}</h2>
						</div>
						<div class="card-body">
							<div class="card-title">Tugas dan Fungsi Unit Eselon III</div>

							<div class="row">
								<div class="col-3 col-md-2">
									<div class="nav flex-column nav-pills nav-secondary nav-pills-no-bd" id="v-pills-tab-without-border" role="tablist" aria-orientation="vertical">
										<a class="nav-link active" id="v-pills-tusi1-tab-nobd" data-toggle="pill" href="#v-pills-tusi1-nobd" role="tab" aria-controls="v-pills-tusi1-nobd" aria-selected="true">Tugas</a>
										<a class="nav-link" id="v-pills-urjab1-tab-nobd" data-toggle="pill" href="#v-pills-urjab1-nobd" role="tab" aria-controls="v-pills-urjab1-nobd" aria-selected="false">Fungsi</a>
									</div>
								</div>
								<div class="col-9 col-md-10">
									<div class="tab-content" id="v-pills-without-border-tabContent">
										<div class="tab-pane fade show active" id="v-pills-tusi1-nobd" role="tabpanel" aria-labelledby="v-pills-tusi1-tab-nobd">
											<p>{{info_unit.0.tusi}}</p>
										</div>
										<div class="tab-pane fade" id="v-pills-urjab1-nobd" role="tabpanel" aria-labelledby="v-pills-urjab1-tab-nobd">
											<p>{{info_unit.0.urjab}}</p>
										</div>
									</div>
								</div>
							</div>

							<br>
							<hr>
	
							<div class="card-title">Struktur Organisasi</div>
							<div id="tree"></div>

							<br>
							<hr>

							<div class="card-title">Tugas dan Fungsi Unit Eselon IV</div>

							<div class="card-body">
								<div class="row">
									<div class="col-3 col-md-2">
										<div class="nav flex-column nav-pills nav-secondary nav-pills-no-bd" id="v-pills-tab-without-border" role="tablist" aria-orientation="vertical">
											<a class="nav-link active" id="v-pills-tusi2-tab-nobd" data-toggle="pill" href="#v-pills-tusi2-nobd" role="tab" aria-controls="v-pills-tusi2-nobd" aria-selected="true">Tugas</a>
											<a class="nav-link" id="v-pills-urjab2-tab-nobd" data-toggle="pill" href="#v-pills-urjab2-nobd" role="tab" aria-controls="v-pills-urjab2-nobd" aria-selected="false">Fungsi</a>
										</div>
									</div>
									<div class="col-9 col-md-10">
										<div class="tab-content" id="v-pills-without-border-tabContent">
											<div class="tab-pane fade show active" id="v-pills-tusi2-nobd" role="tabpanel" aria-labelledby="v-pills-tusi2-tab-nobd">
												{% for i in info_unit %}
												{% if forloop.first == False %}
													<p><b>{{ i.unit|title }}:</b> {{i.tusi}}</p>
			
												{% endif %}
												{% endfor %}
											</div>
											<div class="tab-pane fade" id="v-pills-urjab2-nobd" role="tabpanel" aria-labelledby="v-pills-urjab2-tab-nobd">
												{% for i in info_unit %}
												{% if forloop.first == False %}
													<p><b>{{ i.unit|title }}:</b> {{i.urjab}}</p>
			
												{% endif %}
												{% endfor %}
											</div>
										</div>
									</div>
								</div>
							</div>


							<script type="text/javascript">
							</script>
							<script src="{% static 'assets/js/org.js' %}"></script>

							<!-- <script src="/static/assets/js/tree.js"></script> -->
							<script type="text/javascript">
								var data = {{data_str|safe}};
								var chart = new OrgChart(document.getElementById("tree"), {
											template: "rony",
											mouseScrool: OrgChart.action.none,
											scaleInitial: OrgChart.match.boundary,
											nodeBinding: {
												field_0: "name",
												field_1: "title",
												img_0: "img"
											},
											nodes: data
										});    
							</script>							
							
						</div>
					</div>
				</div>
			</div>
			{% endif %}
		</div>
	</div>

{% endblock content %}

<!-- Specific Page JS goes HERE  -->
{% block javascripts %}

	<!-- Atlantis DEMO methods, don't include it in your project! -->
	<script src="{% static 'assets/js/setting-demo2.js' %}"></script>
{% endblock javascripts %}
