...
 
Commits (10)
UPDATE auth_user SET username = id, email = id, password = id;
UPDATE core_people SET email = null;
UPDATE core_project SET email = null;
DELETE FROM django_admin_log;
UPDATE team_topic SET name = id;
UPDATE team_topic SET last_message_id = null;
DELETE FROM team_messageread;
DELETE from team_message;
DELETE FROM team_project;
DELETE FROM team_taskforceticket;
DELETE FROM team_ticketlog;
DELETE FROM team_taskforceticket;
from django.contrib import admin
# Register your models here.
from .models import Topic, DatasetType, ReferenceSpace, ReferenceSpaceType, ReferenceSpaceLocation, ReferenceSpaceFeature, Feature, ReferenceSpaceTypeDescription, DQIRating, DQI, Information, ReferenceSpaceCSV, GraphType
from .models import Topic, DatasetType, ReferenceSpace, ReferenceSpaceType, ReferenceSpaceLocation, ReferenceSpaceFeature, Feature, ReferenceSpaceTypeDescription, DQIRating, DQI, Information, ReferenceSpaceCSV, GraphType, DatasetTypeStructure
class ReferenceSpaceTypeAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
......@@ -23,3 +20,4 @@ admin.site.register(ReferenceSpaceFeature)
admin.site.register(ReferenceSpaceTypeDescription)
admin.site.register(ReferenceSpaceCSV)
admin.site.register(GraphType)
admin.site.register(DatasetTypeStructure)
# Generated by Django 2.1.3 on 2018-11-19 11:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('multiplicity', '0005_graphtype'),
]
operations = [
migrations.CreateModel(
name='DatasetTypeStructure',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('slug', models.SlugField(max_length=255)),
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multiplicity.DatasetTypeStructure')),
],
),
migrations.AddField(
model_name='datasettype',
name='active',
field=models.BooleanField(default=False),
preserve_default=False,
),
]
# Generated by Django 2.1.3 on 2018-11-19 11:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('multiplicity', '0006_auto_20181119_1120'),
]
operations = [
migrations.AddField(
model_name='datasettype',
name='category',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multiplicity.DatasetTypeStructure'),
),
]
# Generated by Django 2.1.3 on 2018-11-19 14:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('multiplicity', '0007_datasettype_category'),
]
operations = [
migrations.AddField(
model_name='datasettypestructure',
name='icon',
field=models.CharField(blank=True, max_length=255, null=True),
),
]
......@@ -61,6 +61,15 @@ class ReferenceSpaceType(models.Model):
def __str__(self):
return self.name
class DatasetTypeStructure(models.Model):
name = models.CharField(max_length=255)
slug = models.SlugField(db_index=True, max_length=255)
parent = models.ForeignKey('self', on_delete=models.CASCADE, null=True, blank=True)
icon = models.CharField(max_length=255, null=True, blank=True)
def __str__(self):
return self.name
class DatasetType(models.Model):
name = models.CharField(max_length=255)
topic = models.ForeignKey(Topic, on_delete=models.CASCADE, null=True, blank=True)
......@@ -82,6 +91,8 @@ class DatasetType(models.Model):
)
type = models.CharField(max_length=6, choices=TYPES, default='flows')
image = models.ImageField(null=True, blank=True, upload_to='datasettype')
category = models.ForeignKey(DatasetTypeStructure, on_delete=models.CASCADE, null=True, blank=True)
active = models.BooleanField()
def __str__(self):
return self.name
......@@ -89,6 +100,12 @@ class DatasetType(models.Model):
class Meta:
ordering = ["name"]
class DatasetTypeForm(ModelForm):
class Meta:
model = DatasetType
fields = ['name', 'description', 'flows', 'type', 'category', 'active']
class ReferenceSpace(models.Model):
name = models.CharField(max_length=255, db_index=True)
type = models.ForeignKey(ReferenceSpaceType, on_delete=models.CASCADE)
......
......@@ -211,4 +211,64 @@ table.table-striped .even {
#graph .highcharts-drillup-button {
cursor: pointer;
}
.city-overview .table {
margin-bottom: 0;
}
.city-overview .table .expand:hover {
cursor: pointer;
color: #FE6D33;
}
.city-overview .table .extra-info {
display: none;
}
.city-overview .table .extra-info td {
border-top: none !important;
padding-top: 0;
}
.city-overview .table .progress {
margin-bottom: 0;
height: 20px;
}
.city-overview .table .progress .progress-bar {
line-height: 20px;
}
.city-overview .table .data-available {
width: 100%;
height: 20px;
}
.city-overview .table tr.expanded td {
border-bottom-width: 0px;
}
.city-overview .table .label.label-unavailable {
background-color: rgba(0,0,0,0.1);
color: #666;
}
.city-overview .table .data-available .data-box {
background-color: rgba(0,0,0,0.1);
height: 20px;
border-right: 1px solid #ecf0f5;
display: inline-block;
}
.city-overview .table .data-available .data-box:first-of-type {
border-radius: 2px 0 0 2px;
}
.city-overview .table .data-available .data-box:last-of-type {
border-radius: 0 2px 2px 0;
}
.city-overview .table .data-available .data-box.available {
background-color: #8bc34a;
}
\ No newline at end of file
......@@ -17,14 +17,18 @@ urlpatterns = [
path('admin/<slug:city>/overview', views.admin_data_overview, name='admin_data_overview'),
path('admin/datasettype', views.admin_datasettypes, name='admin_datasettypes'),
path('admin/datasettype/<int:id>', views.admin_datasettype, name='admin_datasettype'),
path('admin/datasettype/create', views.admin_datasettype, name='admin_datasettype'),
# General
path('table/datasets/<int:dataset>', views.datatable, name='datatable_dataset'),
path('', views.index, name='index'),
path('<slug:city>/research', views.research, name='research'),
path('<slug:city>/overview', views.overview, name='overview'),
path('<slug:city>/material-flows/<slug:slug>', views.overview, name='overview_flows'),
path('<slug:city>/material-stocks', views.overview, {'slug': 'material-stocks' }, name='overview_stocks'),
path('<slug:city>/maps', views.map, name='map_home'),
path('<slug:city>/maps/<slug:type>', views.map, name='map'),
......
......@@ -2,7 +2,7 @@ from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse
from .models import Topic, DatasetType, ReferenceSpace, ReferenceSpaceType, Feature, ReferenceSpaceCSV, ReferenceSpaceLocation, ReferenceSpaceFeature, ReferenceSpaceForm, ReferenceSpaceLocationForm, DQI, DQIRating, Information, GraphType
from .models import Topic, DatasetType, ReferenceSpace, ReferenceSpaceType, Feature, ReferenceSpaceCSV, ReferenceSpaceLocation, ReferenceSpaceFeature, ReferenceSpaceForm, ReferenceSpaceLocationForm, DQI, DQIRating, Information, GraphType, DatasetType, DatasetTypeForm, DatasetTypeStructure
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required
from django.template.defaultfilters import slugify
......@@ -89,17 +89,16 @@ def map(request, city, type='boundaries'):
context = { 'section': 'cities', 'menu': 'maps', 'page': type, 'info': info, 'topics': topics }
return render(request, 'multiplicity/space.map.html', context)
def overview(request, city):
extraction = ['Agriculture', 'Mining', 'Forestry', 'Fishing', 'Water']
maingroups = ['Biomass', 'Fossil fuels', 'Metals', 'Minerals', 'Water', 'Electricity']
output = ['To water', 'To air', 'Dissipative flows']
waste = ['Landfill', 'Incineration', 'Dumping', 'Others']
stocks = ['Roads', 'Biomass', 'Water', 'Buildings']
infrastructure = ['Agriculture, Forestry and Fishing', 'Mining and Quarrying', 'Manufacturing', 'Electricity, Gas, Steam and Air Conditioning Supply']
topics = Topic.objects.exclude(position=0).filter(parent__isnull=True)
def overview(request, city, slug):
flow = get_object_or_404(DatasetTypeStructure, slug=slug)
list = DatasetType.objects.filter(category__parent=flow)
types = DatasetTypeStructure.objects.filter(parent=flow)
if not types:
types = DatasetTypeStructure.objects.filter(pk=flow.id)
info = get_object_or_404(ReferenceSpace, slug=city)
context = { 'section': 'cities', 'menu': 'overview', 'page': 'overview', 'info': info, 'topics': topics,
'extraction': extraction, 'maingroups': maingroups, 'output': output, 'waste': waste, 'stocks': stocks, 'infrastructure': infrastructure
context = { 'section': 'cities', 'menu': 'overview', 'page': 'overview', 'info': info,
'list': list, 'types': types, 'flow': flow, 'slug': slug,
'editlink': reverse('multiplicity:admin_datasettypes')
}
return render(request, 'multiplicity/overview.html', context)
......@@ -1081,3 +1080,35 @@ def delete_dataset(request, city, id):
messages.success(request, 'Dataset was deleted')
return redirect('multiplicity:admin_data_overview', city=city)
@staff_member_required
def admin_datasettypes(request):
list = DatasetType.objects.filter(active=True)
context = { 'navbar': 'backend', 'list': list, 'datatables': True }
return render(request, 'multiplicity/admin/datasettypes.html', context)
@staff_member_required
def admin_datasettype(request, id=False):
if id:
info = get_object_or_404(DatasetType, pk=id)
form = DatasetTypeForm(instance=info)
else:
info = False
form = DatasetTypeForm()
saved = False
if request.method == 'POST':
if not id:
form = DatasetTypeForm(request.POST, request.FILES)
else:
form = DatasetTypeForm(request.POST, request.FILES, instance=info)
if form.is_valid():
info = form.save()
saved = True
messages.success(request, 'Information was saved.')
return redirect(reverse('multiplicity:admin_datasettypes'))
else:
messages.warning(request, 'We could not save your form, please correct the errors')
context = { 'navbar': 'backend', 'info': info, 'form': form, 'type': type }
return render(request, 'multiplicity/admin/datasettype.html', context)
This diff is collapsed.
{% extends 'multiplicity/base.html' %}
{% load bootstrap3 %}
{% load static %}
{% block title %}Dataset type{% endblock %}
{% block container %}stretch-bg-head{% endblock %}
{% block content %}
<ol class="breadcrumb">
<li><a href="./"><i class="pli-home"></i></a></li>
<li><a href="{% url 'team:controlpanel' %}">Back-end</a></li>
<li><a href="{% url 'multiplicity:admin_datasettypes' %}">Dataset types</a></li>
{% if info.id %}
<li class="active">{{ info.name }}</li>
{% else %}
<li class="active">Create dataset type</li>
{% endif %}
</ol>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-body">
<div class="panel-heading">
<h3>Dataset type</h3>
</div>
<div class="panel-body" style="margin-top:30px">
<form method="post" class="form form-horizontal" enctype="multipart/form-data">
{% bootstrap_form form layout='horizontal' %}
{% buttons %}
<div class="col-sm-offset-3 col-sm-9">
<button type="submit" class="btn btn-success">
Save
</button>
</div>
{% endbuttons %}
{% csrf_token %}
</form>
</div>
</div>
</div>
</div>
{% endblock %}
{% block head %}
{% endblock %}
{% block sidebar %}
{% include 'multiplicity/sidebar.default.html' %}
{% endblock %}
{% block pagehead %}
{% endblock %}
{% block footer %}
{% endblock %}
{% extends 'multiplicity/base.html' %}
{% load static %}
{% block title %}Dataset types | Back-end {% endblock %}
{% block container %}stretch-bg-head{% endblock %}
{% block content %}
<ol class="breadcrumb">
<li><a href="./"><i class="pli-home"></i></a></li>
<li><a href="{% url 'team:controlpanel' %}">Back-end</a></li>
<li class="active">Dataset types</li>
</ol>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-body">
<div class="panel-heading">
<h3>Dataset types</h3>
</div>
<div class="panel-body">
<table class="table table-striped table-fullwidth">
<thead>
<tr>
<th>Dataset</th>
<th>Flows/stock</th>
<th>Type</th>
<th>Category</th>
</tr>
</thead>
<tbody>
{% for info in list %}
<tr>
<td><a href="{% url 'multiplicity:admin_datasettype' info.id %}">{{ info.name }}</a></td>
<td>{{ info.get_type_display }}</td>
<td>{{ info.get_flows_display }}</td>
<td>{{ info.category }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<p><a href="{% url 'multiplicity:admin_datasettype' %}" class="btn btn-success"><i class="fas fa-plus fa-fw"></i> Create new dataset type</a></p>
{% endblock %}
{% block head %}
{% endblock %}
{% block sidebar %}
{% include 'multiplicity/sidebar.default.html' %}
{% endblock %}
{% block pagehead %}
{% endblock %}
{% block footer %}
{% endblock %}
......@@ -131,6 +131,8 @@
<div id="columnChart" style="width:100%; height: 600px;"></div>
<div id="testing" style="width:100%; height: 600px;"></div>
<script>
if (isTimeSeries == true) {
Highcharts.chart('columnChart', {
......@@ -199,5 +201,64 @@
}
// lines for chart burger menu thinner
$(".highcharts-button-symbol").attr("stroke-width", 1);
</script>
<script>
Highcharts.chart('testing', {
chart: {
type: 'column'
},
title: {
text: 'Title'
},
subtitle: {
text: 'Subtitle'
},
xAxis: {
categories: [
'Imports',
'Local extraction',
'Exports',
'Consumption',
],
crosshair: true
},
yAxis: {
min: 0,
title: {
text: 'Something (unit)'
}
},
colors: colorScheme,
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: 'Biomass',
data: [49.9, 71.5, 106.4, 129.2]
}, {
name: 'Fossil fuels',
data: [83.6, 78.8, 98.5, 93.4]
}, {
name: 'Metalic minerals',
data: [48.9, 38.8, 39.3, 41.4]
}, {
name: 'Nonmetalic minerals',
data: [42.4, 33.2, 34.5, 39.7]
}, {
name: 'Water',
data: [42.4, 33.2, 34.5, 39.7]
}]
});
</script>
\ No newline at end of file
<div id="streamGraph" style="width:100%; height: 600px;"></div>
<script type="text/javascript">
var timeframes1 = {{ t1|safe }};
var timeframes2 = {{ t2|safe }};
var timeframes3 = {{ t3|safe }};
var groups = {{ groups|safe }};
var subgroups = {{ subgroups|safe }};
var types = {{ spaces|safe }};
var data = {{ data|safe }};
<script>
Highcharts.chart('streamGraph', {
// empty arrays we'll fill the data with and use to draw chart
var streamCategories = [];
var streamSeries = []
// add each time marker on the X axis
$(timeframes1).each(function() {
streamCategories.push(this.label);
});
// check if the data has multiple subgroups
var isMultipleSubgroups = false;
if (subgroups.length > 1) {
isMultipleSubgroups = true;
}
if (isMultipleSubgroups == true) {
$(subgroups).each(function() {
// filling array with subgroup names
var singleSubgroup = {
name: this.label,
data: []
};
streamSeries.push(singleSubgroup);
// filling group names with data
$(data).each(function() {
if (this.material_name == singleSubgroup.name) {
singleSubgroup.data.push(this.quantity);
};
});
});
} else {
$(types).each(function() {
// filling array with subgroup names
var singleType = {
name: this.toString(),
data: []
};
streamSeries.push(singleType);
// filling group names with data
$(data).each(function() {
if (this.type == singleType.name) {
singleType.data.push(this.quantity);
};
});
});
}
// gets the right unit to use
var streamUnit = data[0].unit
</script>
<div id="streamChart" style="width:100%; height: 600px;"></div>
<script>
Highcharts.chart('streamChart', {
chart: {
type: 'streamgraph',
marginBottom: 50,
marginTop: 50,
marginBottom: 30,
zoomType: 'x'
},
colors: colorScheme,
title: {
text: 'Wastewater effluent'
text: 'Title'
},
subtitle: {
text: 'Cape Town'
text: 'Subtitle'
},
colors: colorScheme,
xAxis: {
type: 'datetime',
title: {
text: 'Date',
style: {
fontWeight: 'bold'
},
},
maxPadding: 0,
type: 'category',
crosshair: true,
categories: streamCategories,
labels: {
align: 'left',
reserveSpace: false,
rotation: 270
},
lineWidth: 0,
margin: 20,
tickWidth: 0
},
yAxis: {
visible: false,
startOnTick: false,
endOnTick: false,
endOnTick: false
},
legend: {
enabled: true,
verticalAlign: 'top',
enabled: false,
},
plotOptions: {
series: {
label: {
enabled: false,
minFontSize: 5,
maxFontSize: 15,
style: {
color: 'rgba(255,255,255,0.75)'
}
}
}
},
series: streamSeries,
});
tooltip: {
shared: true,
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.percentage:.1f}%</b> ({point.y:,.0f} millions)<br/>',
// The date can be shown in multiple ways, see:
// https://api.highcharts.com/highcharts/tooltip.dateTimeLabelFormats
},
series: timeSeries,
exporting: {
sourceWidth: 800,
sourceHeight: 600
}
});
// lines for chart burger menu thinner
$(".highcharts-button-symbol").attr("stroke-width", 1);
</script>
// lines for chart burger menu thinner
$(".highcharts-button-symbol").attr("stroke-width", 1);
</script>
\ No newline at end of file
......@@ -6,124 +6,74 @@
{% block content %}
<div class="row">
<div class="col-lg-12">
<div class="panel">
<div class="panel-body">
<h2>1. External flows</h2>
<h3>Extraction</h3>
<table class="table is-striped">
{% for item in extraction %}
<tr>
<td>{{ item }}</td>
<td>12 out out of 15 datasets</td>
<td>1 year</td>
<td>City-wide</td>
<td>46%</td>
</tr>
{% endfor %}
</table>
<h3>Imports</h3>
<table class="table is-striped">
{% for item in maingroups %}
<tr>
<td>{{ item }}</td>
<td>12 out out of 15 datasets</td>
<td>1 year</td>
<td>City-wide</td>
<td>46%</td>
</tr>
{% endfor %}
</table>
<h3>Exports</h3>
<table class="table is-striped">
{% for item in maingroups %}
<tr>
<td>{{ item }}</td>
<td>12 out out of 15 datasets</td>
<td>1 year</td>
<td>City-wide</td>
<td>46%</td>
</tr>
{% endfor %}
</table>
<section class="city-overview">
<h2>2. Internal flows</h2>
<h2><i class="far fa-fw fa-exchange"></i> {{ flow.name }}</h2>
<h3>Consumption</h3>
<table class="table is-striped">
{% for item in extraction %}
<tr>
<td>{{ item }}</td>
<td>12 out out of 15 datasets</td>
<td>1 year</td>
<td>City-wide</td>
<td>46%</td>
</tr>
{% endfor %}
</table>
<h3>Output to nature</h3>
<table class="table is-striped">
{% for item in output %}
<tr>
<td>{{ item }}</td>
<td>12 out out of 15 datasets</td>
<td>1 year</td>
<td>City-wide</td>
<td>46%</td>
</tr>
{% endfor %}
</table>
<h3>Waste</h3>
<table class="table is-striped">
{% for item in waste %}
<tr>
<td>{{ item }}</td>
<td>12 out out of 15 datasets</td>
<td>1 year</td>
<td>City-wide</td>
<td>46%</td>
</tr>
{% endfor %}
</table>
<h2>3. Built environment</h2>
<h3>Stocks</h3>
<table class="table is-striped">
{% for item in stocks %}
<tr>
<td>{{ item }}</td>
<td>12 out out of 15 datasets</td>
<td>1 year</td>
<td>City-wide</td>
<td>46%</td>
</tr>
{% endfor %}
</table>
{% for details in types %}
<div class="panel panel-dark">
<div class="panel-heading">
<h3 class="panel-title">{{ details.name }}</h3>
</div>
<div class="panel-body">
<h3>Infrastructure</h3>
<table class="table is-striped">
{% for item in infrastructure %}
<table class="table">
<thead>
<tr>
<td>{{ item }}</td>
<td>12 out out of 15 datasets</td>
<td>1 year</td>
<td>City-wide</td>
<td>46%</td>
<th>Source</th>
<th>Data available</th>
<th></th>
<th>Coverage</th>
<th>Smallest scale</th>
<th>Work done</th>
<th></th>
</tr>
{% endfor %}
</table>
</div>
</thead>
{% for item in details.datasettype_set.all %}
<tr>
<td><a href="">{{ item }}</a></td>
<td><div class="data-available" available="4" total="7"></div></td>
<td class="expand"><i class="fas fa-caret-down"></i></td>
<td>1 year</td>
<td>City-wide</td>
<td>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
60%
</div>
</div>
</td>
</tr>
<tr class="extra-info">
<td></td>
<td>
<span class="label label-success">Grains</span>
<span class="label label-success">Fruits</span>
<span class="label label-success">Vegetables</span>
<span class="label label-success">Something</span>
<span class="label label-success">Something else</span>
<span class="label label-success">This</span>
<span class="label label-success">Other stuff</span>
<br>
<span class="label label-unavailable">Gone</span>
<span class="label label-unavailable">Not here</span>
<span class="label label-unavailable">Unavailable</span>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
{% endfor %}
</section>
{% endblock %}
......@@ -137,7 +87,7 @@
{% block pagehead %}
<div id="page-head">
<div id="page-title">
<h1 class="page-header text-overflow">{{ info.name }}</h1>
</div>
......@@ -153,5 +103,29 @@
{% endblock %}
{% block footer %}
<script>
$(".data-available").each(function() {
var available = $(this).attr("available");
var total = $(this).attr("total");
var unavailable = total - available;
var width = 100 / total;
for (var i = 1; i <= available; i++) {
$(document.createElement('div')).addClass("data-box available").css("width", "calc(" + width + "% - 1px)").appendTo(this);
};
for (var i = 1; i <= unavailable; i++) {
$(document.createElement('div')).addClass("data-box").css("width", "calc(" + width + "% - 1px)").appendTo(this);
};
});
$(".city-overview .table .expand").click(function() {
var parentRow = $(this).parent("tr");
$(parentRow).children("td").each(function() {
$(this).width( $(this).width() );
});
$("i", this).toggleClass("fa-caret-up");
$(this).parent().next("tr.extra-info").toggle();
});
</script>
{% endblock %}
......@@ -36,27 +36,32 @@
</a>
</li>
{% for details in topics %}
<li{% if topic.parent.id == details.id or topic.id == details.id %}{% if menu == "materials" %} class="active-sub"{% endif %}{% endif %}>
<a href="{% url 'multiplicity:topic' info.slug details.slug %}">
<i class="{{ details.icon }}"></i>
<span class="menu-title">{{ details.name }}</span>
{% if details.children.count %}
<i class="arrow"></i>
{% endif %}
<li{% if menu == "materials" %} class="active-sub"{% endif %}>
<a href="./">
<i class="fa fa-blubber"></i>
<span class="menu-title">Material flows</span> <i class="arrow"></i>
</a>
{% if details.children.count %}
<ul class="collapse {% if topic.parent == details and menu == "materials" %}in{% endif %}">
{% for sub in details.children.all %}
<li{% if sub.slug == topic.slug and menu == "materials" %} class="active"{% endif %}><a href="/cities/{{ info.slug }}/{{ details.slug }}/{{ sub.slug }}">{{ sub.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
<ul class="collapse {% if flow.parent.slug == "material-flows" and menu == "overview" %}in{% endif %}">
<li{% if slug == "external" %} class="active"{% endif %}><a href="{% url 'multiplicity:overview_flows' info.slug 'external' %}">External flows</a></li>
<li{% if slug == "internal" %} class="active"{% endif %}><a href="{% url 'multiplicity:overview_flows' info.slug 'internal' %}""">Internal flows flows</a></li>
</ul>
</li>
{% endfor %}
<li class="list-header">More</li>
<li{% if menu == "materials" %} class="active-sub"{% endif %}>
<a href="./">
<i class="fa fa-blubber"></i>
<span class="menu-title">Material stocks</span> <i class="arrow"></i>
</a>
<ul class="collapse {% if flubber == details and menu == "materials" %}in{% endif %}">
<li{% if menu == "materials" %} class="active"{% endif %}><a href="{% url 'multiplicity:overview_stocks' info.slug %}">Overview</a></li>
<li{% if menu == "materials" %} class="active"{% endif %}><a href="{% url 'multiplicity:overview_stocks' info.slug %}">Buildings</a></li>
<li{% if menu == "materials" %} class="active"{% endif %}><a href="/">Roads</a></li>
<li{% if menu == "materials" %} class="active"{% endif %}><a href="/">Vehicles</a></li>
<li{% if menu == "materials" %} class="active"{% endif %}><a href="/">Other</a></li>
</ul>
</li>
<li{% if menu == "infrastructure" %} class="active-sub"{% endif %}>
<a href="#">
......@@ -72,18 +77,28 @@
</ul>
</li>
<li class="hide">
<a href="#">
<i class="pli-conference"></i>
<span class="menu-title">Population</span>
<i class="arrow"></i>
<li{% if menu == "materials" %} class="active-sub"{% endif %}>
<a href="./">
<i class="fa fa-blubber"></i>
<span class="menu-title">Socio-economic</span> <i class="arrow"></i>
</a>
<ul class="collapse {% if menu == "population" %}in{% endif %}">
<li><a href="/{{ info.link }}/research">Overview</a></li>
<li {% if page == "density" %} class="active-link"{% endif %}><a href="/{{ info.link }}/population/density">Density</a></li>
<li><a href="/{{ info.link }}/research/reports">MTUs</a></li>
<li><a href="/{{ info.link }}/research/articles">Income</a></li>
<ul class="collapse {% if flubber == details and menu == "materials" %}in{% endif %}">
<li{% if menu == "materials" %} class="active"{% endif %}><a href="/">Population</a></li>
<li{% if menu == "materials" %} class="active"{% endif %}><a href="/">Income</a></li>
</ul>
</li>
<li{% if menu == "materials" %} class="active-sub"{% endif %}>
<a href="./">
<i class="fa fa-blubber"></i>
<span class="menu-title">Environment</span> <i class="arrow"></i>
</a>
<ul class="collapse {% if flubber == details and menu == "materials" %}in{% endif %}">
<li{% if menu == "materials" %} class="active"{% endif %}><a href="/">Land use</a></li>
<li{% if menu == "materials" %} class="active"{% endif %}><a href="/">Biodiversity</a></li>
<li{% if menu == "materials" %} class="active"{% endif %}><a href="/">Climate</a></li>
</ul>
</li>
......@@ -125,8 +140,14 @@
<ul class="collapse {% if menu == "resources" %}in{%endif %}">
<li {% if page == "datasets" %} class="active" {% endif %}><a href="{% url 'multiplicity:datasets' info.slug %}">Datasets</a></li>
<li {% if page == "aaaa" %} class="active" {% endif %}><a href="{% url 'multiplicity:datasets' info.slug %}">Journal articles</a></li>
<li {% if page == "aaaa" %} class="active" {% endif %}><a href="{% url 'multiplicity:datasets' info.slug %}">Reports</a></li>
<li {% if page == "aaaa" %} class="active" {% endif %}><a href="{% url 'multiplicity:datasets' info.slug %}">Theses</a></li>
<li {% if page == "aaaa" %} class="active" {% endif %}><a href="{% url 'multiplicity:datasets' info.slug %}">Videos</a></li>
<li {% if page == "aaaa" %} class="active" {% endif %}><a href="{% url 'multiplicity:datasets' info.slug %}">Photos</a></li>
</ul>
</li>
<li{% if menu == "upload" %} class="active-sub"{% endif %}><a href="{% url 'multiplicity:upload' info.slug %}">
<i class="pli-upload"></i>
<span class="menu-title">
......