...
 
Commits (103)
......@@ -21,3 +21,4 @@ SELECT setval('multiplicity_datasettype_id_seq', (SELECT MAX(id) FROM multiplici
INSERT INTO "core_useraction" ("id", "name") VALUES ('5', 'Data imported');
UPDATE staf_material SET code = CONCAT('HS',code) WHERE catalog_id = 1 AND parent_id != 970753;
......@@ -5,18 +5,38 @@ from .models import *
class ArticleAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("title",)}
list_display = ('title', 'site', 'parent')
search_fields = ('title',)
list_display = ['title', 'site', 'parent']
search_fields = ['title',]
class PeopleAdmin(admin.ModelAdmin):
list_display = ('firstname', 'lastname', 'city', 'email')
list_display = ['firstname', 'lastname', 'city', 'email']
search_fields = ['firstname', 'lastname']
class ReferenceAdmin(admin.ModelAdmin):
search_fields = ['title']
class OrganizationAdmin(admin.ModelAdmin):
autocomplete_fields = ['processes', 'reference_spaces']
class DataVizAdmin(admin.ModelAdmin):
autocomplete_fields = ['space', 'reference']
class ProjectOrgAdmin(admin.ModelAdmin):
autocomplete_fields = ['project']
list_display = ['project', 'organization', 'type']
search_fields = ['organization__name', 'project__name', 'type']
class ReferenceOrgAdmin(admin.ModelAdmin):
autocomplete_fields = ['reference']
list_display = ['reference', 'organization', 'type']
search_fields = ['organization__name', 'reference__title', 'type']
class ProjectAdmin(admin.ModelAdmin):
search_fields = ['name']
admin.site.register(Journal)
admin.site.register(Publisher)
admin.site.register(Organization)
admin.site.register(Organization, OrganizationAdmin)
admin.site.register(Video)
admin.site.register(Article, ArticleAdmin)
admin.site.register(Color)
......@@ -25,6 +45,9 @@ admin.site.register(UserAction)
admin.site.register(UserLog)
admin.site.register(People, PeopleAdmin)
admin.site.register(Timeline)
admin.site.register(Project)
admin.site.register(Project, ProjectAdmin)
admin.site.register(ProjectOrganization, ProjectOrgAdmin)
admin.site.register(ReferenceType)
admin.site.register(DataViz, DataVizAdmin)
admin.site.register(ReferenceOrganization, ReferenceOrgAdmin)
admin.site.register(Reference, ReferenceAdmin)
# Generated by Django 2.2.2 on 2019-06-18 12:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0060_auto_20190425_0804'),
]
operations = [
migrations.AddField(
model_name='reference',
name='isbn',
field=models.CharField(blank=True, max_length=255, null=True),
),
]
# Generated by Django 2.2.2 on 2019-06-18 12:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0061_reference_isbn'),
]
operations = [
migrations.AddField(
model_name='reference',
name='comments',
field=models.TextField(blank=True, null=True),
),
]
# Generated by Django 2.2.2 on 2019-07-01 06:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0062_reference_comments'),
]
operations = [
migrations.AlterField(
model_name='reference',
name='journal',
field=models.ForeignKey(blank=True, help_text='If the journal does not appear in the list, please leave empty and add the name in the comments', null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Journal'),
),
]
# Generated by Django 2.2.2 on 2019-07-31 09:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0063_auto_20190701_0634'),
]
operations = [
migrations.AddField(
model_name='organization',
name='linkedin',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='organization',
name='logo',
field=models.ImageField(blank=True, null=True, upload_to='journals'),
),
migrations.AddField(
model_name='organization',
name='researchgate',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='organization',
name='twitter',
field=models.CharField(blank=True, max_length=255, null=True),
),
]
# Generated by Django 2.2.2 on 2019-07-31 09:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0064_auto_20190731_0950'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='logo',
field=models.ImageField(blank=True, null=True, upload_to='organizations'),
),
]
# Generated by Django 2.2.2 on 2019-07-31 09:57
from django.db import migrations
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('core', '0065_auto_20190731_0950'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='description',
field=tinymce.models.HTMLField(blank=True, null=True, verbose_name='Content'),
),
]
# Generated by Django 2.2.2 on 2019-07-31 09:57
from django.db import migrations
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('core', '0066_auto_20190731_0957'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='description',
field=tinymce.models.HTMLField(blank=True, null=True),
),
]
# Generated by Django 2.2.2 on 2019-08-02 13:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0067_auto_20190731_0957'),
]
operations = [
migrations.AlterField(
model_name='article',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='people',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='video',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='videocollection',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
# Generated by Django 2.2.2 on 2019-08-02 13:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0068_auto_20190802_1315'),
]
operations = [
migrations.CreateModel(
name='ProjectOrganization',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.CharField(choices=[('funder', 'Funder'), ('commissioner', 'Commissioner'), ('organization', 'Organization')], max_length=20)),
('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Organization')),
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Project')),
],
),
migrations.AddField(
model_name='project',
name='organizations',
field=models.ManyToManyField(through='core.ProjectOrganization', to='core.Organization'),
),
]
# Generated by Django 2.2.2 on 2019-08-02 13:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0069_auto_20190802_1323'),
]
operations = [
migrations.AlterField(
model_name='peopleaffiliation',
name='start',
field=models.PositiveSmallIntegerField(blank=True, null=True),
),
]
# Generated by Django 2.2.2 on 2019-08-02 14:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0070_auto_20190802_1331'),
]
operations = [
migrations.AddField(
model_name='people',
name='organizations',
field=models.ManyToManyField(blank=True, to='core.Organization'),
),
migrations.DeleteModel(
name='PeopleAffiliation',
),
]
# Generated by Django 2.2.2 on 2019-08-02 14:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('multiplicity', '0050_auto_20190701_0635'),
('core', '0071_auto_20190802_1405'),
]
operations = [
migrations.CreateModel(
name='DataViz',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('date', models.DateTimeField(auto_now_add=True)),
('description', models.TextField(blank=True, null=True)),
('url', models.CharField(blank=True, max_length=255, null=True)),
('source', models.CharField(blank=True, max_length=255, null=True)),
('process_group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multiplicity.ProcessGroup')),
('reference', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Reference')),
('space', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multiplicity.ReferenceSpace')),
('uploaded_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-date'],
},
),
]
# Generated by Django 2.2.2 on 2019-08-02 14:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0072_dataviz'),
]
operations = [
migrations.AddField(
model_name='dataviz',
name='image',
field=models.ImageField(blank=True, null=True, upload_to='dataviz'),
),
]
# Generated by Django 2.2.2 on 2019-08-02 14:17
from django.db import migrations, models
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('core', '0073_dataviz_image'),
]
operations = [
migrations.AddField(
model_name='dataviz',
name='year',
field=models.PositiveSmallIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='dataviz',
name='description',
field=tinymce.models.HTMLField(blank=True, null=True),
),
]
# Generated by Django 2.2.2 on 2019-08-02 14:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0074_auto_20190802_1417'),
]
operations = [
migrations.AlterField(
model_name='dataviz',
name='image',
field=models.ImageField(default='test', upload_to='dataviz'),
preserve_default=False,
),
migrations.AlterField(
model_name='dataviz',
name='source',
field=models.CharField(blank=True, help_text='Name of the source website/article -- ONLY enter if this is not linked to a publication', max_length=255, null=True),
),
migrations.AlterField(
model_name='dataviz',
name='url',
field=models.CharField(blank=True, help_text='URL of the source website/article -- ONLY enter if this is not linked to a publication', max_length=255, null=True),
),
migrations.AlterField(
model_name='dataviz',
name='year',
field=models.PositiveSmallIntegerField(blank=True, help_text='Year of the data being visualized -- ONLY enter if this is not linked to a publication', null=True),
),
]
# Generated by Django 2.2.2 on 2019-08-02 15:12
from django.db import migrations
import stdimage.models
class Migration(migrations.Migration):
dependencies = [
('core', '0075_auto_20190802_1420'),
]
operations = [
migrations.AlterField(
model_name='dataviz',
name='image',
field=stdimage.models.StdImageField(upload_to='dataviz'),
),
]
# Generated by Django 2.2.2 on 2019-08-06 13:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0076_auto_20190802_1512'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='type',
field=models.CharField(choices=[('academic', 'Research Institution'), ('universities', 'Universities'), ('city_government', 'City Government'), ('regional_government', 'Regional Government'), ('national_government', 'National Government'), ('statistical_agency', 'Statistical Agency'), ('private_sector', 'Private Sector'), ('publisher', 'Publishers'), ('ngo', 'NGO'), ('other', 'Other')], max_length=20),
),
migrations.AlterField(
model_name='project',
name='organizations',
field=models.ManyToManyField(blank=True, through='core.ProjectOrganization', to='core.Organization'),
),
]
# Generated by Django 2.2.2 on 2019-08-07 05:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0077_auto_20190806_1324'),
]
operations = [
migrations.AlterField(
model_name='people',
name='image',
field=models.ImageField(blank=True, help_text='Square photos are best - please resize to 350x350 pixels', null=True, upload_to='people'),
),
]
# Generated by Django 2.2.2 on 2019-08-07 16:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0078_auto_20190807_0534'),
]
operations = [
migrations.AlterField(
model_name='article',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='dataviz',
name='source',
field=models.TextField(blank=True, help_text='Name of the source website/article -- ONLY enter if this is not linked to a publication', null=True),
),
migrations.AlterField(
model_name='dataviz',
name='uploaded_by',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.People'),
),
migrations.AlterField(
model_name='people',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='video',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='videocollection',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
# Generated by Django 2.2.2 on 2019-08-13 15:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0079_auto_20190807_1602'),
]
operations = [
migrations.AlterField(
model_name='article',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='people',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='video',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='videocollection',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
# Generated by Django 2.2.2 on 2019-08-13 15:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('multiplicity', '0050_auto_20190701_0635'),
('core', '0080_auto_20190813_1525'),
]
operations = [
migrations.CreateModel(
name='NewsletterSubscriber',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('datasets', models.BooleanField()),
('news', models.BooleanField()),
('events', models.BooleanField()),
('publications', models.BooleanField()),
('dataviz', models.BooleanField()),
('multimedia', models.BooleanField()),
('projects', models.BooleanField()),
('theses', models.BooleanField()),
('people', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.People')),
('reference_spaces', models.ManyToManyField(blank=True, to='multiplicity.ReferenceSpace')),
],
),
]
# Generated by Django 2.2.2 on 2019-08-14 08:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sites', '0002_alter_domain_unique'),
('core', '0081_newslettersubscriber'),
]
operations = [
migrations.AddField(
model_name='newslettersubscriber',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
# Generated by Django 2.2.2 on 2019-08-16 09:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0082_newslettersubscriber_site'),
]
operations = [
migrations.AlterField(
model_name='article',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='newslettersubscriber',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='people',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='video',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='videocollection',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
# Generated by Django 2.2.2 on 2019-08-21 15:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0083_auto_20190816_0917'),
]
operations = [
migrations.AddField(
model_name='referencetype',
name='group',
field=models.CharField(blank=True, choices=[('academic', 'Academic'), ('theses', 'Theses'), ('reports', 'Reports'), ('multimedia', 'Multimedia')], max_length=20, null=True),
),
migrations.AlterField(
model_name='article',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='newslettersubscriber',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='people',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='video',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='videocollection',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
# Generated by Django 2.2.2 on 2019-08-23 14:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0084_auto_20190821_1518'),
]
operations = [
migrations.AlterField(
model_name='article',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='newslettersubscriber',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='people',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='video',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='videocollection',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
# Generated by Django 2.2.2 on 2019-08-28 05:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0085_auto_20190823_1434'),
]
operations = [
migrations.AlterModelOptions(
name='dataviz',
options={'ordering': ['date']},
),
]
# Generated by Django 2.2.2 on 2019-09-17 06:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0086_auto_20190828_0548'),
]
operations = [
migrations.AlterField(
model_name='reference',
name='file',
field=models.FileField(blank=True, help_text='Only upload the file if you are the creator or you have permission to do so', null=True, upload_to='references'),
),
]
# Generated by Django 2.2.2 on 2019-09-30 15:20
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('core', '0087_auto_20190917_0625'),
]
operations = [
migrations.AlterField(
model_name='article',
name='content',
field=tinymce.models.HTMLField(help_text='The content field is a required field - be sure to fill this out', verbose_name='Content'),
),
migrations.AlterField(
model_name='article',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='newslettersubscriber',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='people',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='video',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='videocollection',
name='site',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
# Generated by Django 2.2.2 on 2019-10-03 18:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0088_auto_20190930_1520'),
]
operations = [
migrations.AlterField(
model_name='article',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='newslettersubscriber',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='people',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='video',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
migrations.AlterField(
model_name='videocollection',
name='site',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='sites.Site'),
),
]
This diff is collapsed.
......@@ -36,6 +36,9 @@ urlpatterns = [
path('research/add', RedirectView.as_view(url=site_url+'/community/research/create', permanent=True)),
path('people', RedirectView.as_view(url=site_url+'/community/people', permanent=True)),
path('news/<int:year>/<int:month>', RedirectView.as_view(url=site_url+'/community/news', permanent=True)),
path('vancouver/', RedirectView.as_view(url=site_url+'/community/news/214', permanent=False)),
path('vancouver', RedirectView.as_view(url=site_url+'/community/news/214', permanent=False)),
path('cities/page/datasets', RedirectView.as_view(url=site_url+'/cities/datasets/', permanent=True)),
path('videos', RedirectView.as_view(url=site_url+'/resources/videos', permanent=True)),
path('mooc', RedirectView.as_view(url=site_url+'/resources/mooc', permanent=True)),
......@@ -68,8 +71,9 @@ urlpatterns = [
path('data/subareas/<slug:slug>', RedirectView.as_view(url=archive_url+'/data/subareas/%(slug)s', permanent=False)),
path('stakeholders', RedirectView.as_view(url=archive_url+'/stakeholders', permanent=False)),
path('stakeholders/<slug:slug>', RedirectView.as_view(url=archive_url+'/stakeholders/%(slug)s', permanent=False)),
path('datavisualization', RedirectView.as_view(url=archive_url+'/datavisualization', permanent=False)),
path('datavisualization/<slug:slug>', RedirectView.as_view(url=archive_url+'/datavisualization/%(slug)s', permanent=False)),
path('datavisualization', RedirectView.as_view(url=site_url+'/resources/datavisualisations/', permanent=True)),
path('datavisualization/examples', RedirectView.as_view(url=site_url+'/resources/datavisualisations/', permanent=True)),
path('datavisualizations/<int:id>-<slug:slug>', RedirectView.as_view(url=site_url+'/resources/datavisualisations/%(id)s', permanent=True)),
# Fixing URLs
path('resources/starters-kit', RedirectView.as_view(url=site_url+'/resources/starter-kit', permanent=True)),
......@@ -88,6 +92,9 @@ urlpatterns = [
path('resources/videos/<int:id>', views.video, name='video'),
path('resources/videos/all', views.videos, { 'all': True }, name='videos_all'),
path('resources/datavisualisations/', views.datavisualizations, name='datavisualizations'),
path('resources/datavisualisations/<int:id>/', views.datavisualization, name='datavisualization'),
path('community/news', views.articles, {'parent': 'news'}, name='news'),
path('community/news/<int:id>', views.article, name='news'),
path('community/blog', views.articles, {'parent': 'blog'}, name='blog'),
......@@ -105,6 +112,7 @@ urlpatterns = [
path('cities', views.sectionpage, { 'id': 33}, name='citieshomepage'),
path('cities/page/<slug:slug>', views.sectionpage, name='sectionpage'),
path('about/team', views.team, name='team'),
path('about/moi-team', views.team, name='moi-team'),
path('about/task-forces', views.taskforces, name='taskforces'),
path('about/task-forces/<slug:slug>', views.taskforce, name='taskforce'),
path('about/task-forces/<slug:taskforce>/join', views.register, name='jointaskforce'),
......@@ -148,7 +156,9 @@ urlpatterns = [
path('services/stakeholders-engagement/<slug:slug>', views.page, name='engagement'),
path('services/support/<slug:slug>', views.page, name='support'),
path('contact', views.page, { 'slug': 'contact'}, name='contact'),
path('subscribe', views.page, { 'slug': 'subscribe'}, name='subscribe'),
path('contact/form', views.contact),
path('about/subscribe/form/', views.subscribe),
path('literature', views.literature, name='literature'),
path('publishers', views.publishers, name='publishers'),
path('publishers/<int:id>', views.publisher, name='publisher'),
......@@ -165,6 +175,7 @@ urlpatterns = [
path('resources/publications/<int:id>/edit/multiplicity', views.referenceform_multiplicity, name='editreference_multiplicity'),
path('resources/publications/add', views.referenceform, name='newreference'),
path('resources/publications/create/<int:dataset>', views.referenceform, name='newflowreference'),
path('resources/publications/tags/all', views.references, {"all": True }, name='tag_all'),
path('resources/publications/tags/<int:tag>', views.references, name='tag_search'),
path('resources/publications/<slug:slug>', views.page, name='publications'),
path('resources/<slug:slug>', views.page, name='resources'),
......
This diff is collapsed.
......@@ -11,16 +11,29 @@ class ReferenceSpaceAdmin(admin.ModelAdmin):
list_display = ('name', 'type')
search_fields = ['name']
admin.site.register(DatasetType)
class ReferenceSpaceFeatureAdmin(admin.ModelAdmin):
list_display = ('space', 'feature', 'value')
search_fields = ['space__name', 'feature__name']
class FeatureAdmin(admin.ModelAdmin):
list_display = ('name', 'type', 'unit')
search_fields = ['name']
class DatasetTypeAdmin(admin.ModelAdmin):
list_display = ['name', 'category', 'origin_process', 'destination_process', 'type', 'active']
list_filter = ['active', 'category', 'type']
list_editable = ['active', 'origin_process', 'destination_process']
admin.site.register(DatasetType, DatasetTypeAdmin)
admin.site.register(Topic, TopicAdmin)
admin.site.register(DQIRating)
admin.site.register(DQI)
admin.site.register(ReferenceSpace, ReferenceSpaceAdmin)
admin.site.register(ReferenceSpaceLocation)
admin.site.register(ReferenceSpaceType, ReferenceSpaceTypeAdmin)
admin.site.register(Feature)
admin.site.register(Feature, FeatureAdmin)
admin.site.register(Information)
admin.site.register(ReferenceSpaceFeature)
admin.site.register(ReferenceSpaceFeature, ReferenceSpaceFeatureAdmin)
admin.site.register(ReferenceSpaceTypeDescription)
admin.site.register(ReferenceSpaceCSV)
admin.site.register(GraphType)
......
......@@ -17,7 +17,7 @@ def site(request):
news = 142
system = "island"
systems = "islands"
multiplicity_name = "Data"
multiplicity_name = "Islands"
latest_news = Article.objects.filter(parent=news, active=True).order_by('-date')[0]
processgroups = ProcessGroup.objects.order_by('name').exclude(pk__in=[13,14,12])
......
# Generated by Django 2.2.2 on 2019-07-01 06:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('staf', '0014_auto_20190422_1638'),
('multiplicity', '0049_referencespace_parent'),
]
operations = [
migrations.AddField(
model_name='referencespacetype',
name='processes',
field=models.ManyToManyField(blank=True, limit_choices_to={'slug__isnull': False}, related_name='referencespaces', to='staf.Process'),
),
migrations.AlterField(
model_name='referencespacetype',
name='process',
field=models.ForeignKey(blank=True, limit_choices_to={'slug__isnull': False}, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dropsoon', to='staf.Process'),
),
]
......@@ -14,6 +14,9 @@ from django.urls import reverse
User = get_user_model()
from django.db.models import Q
from django.utils.crypto import get_random_string
class TimestampedModel(models.Model):
# A timestamp representing when this object was created.
created_at = models.DateTimeField(auto_now_add=True)
......@@ -49,7 +52,8 @@ class ReferenceSpaceType(models.Model):
name = models.CharField(max_length=255)
slug = models.SlugField(db_index=True, max_length=255, unique=True)
topic = models.ForeignKey(Topic, on_delete=models.CASCADE, null=True, blank=True)
process = models.ForeignKey('staf.Process', on_delete=models.CASCADE, null=True, blank=True, limit_choices_to={'slug__isnull': False})
process = models.ForeignKey('staf.Process', on_delete=models.CASCADE, null=True, blank=True, limit_choices_to={'slug__isnull': False}, related_name="dropsoon")
processes = models.ManyToManyField('staf.Process', blank=True, limit_choices_to={'slug__isnull': False}, related_name="referencespaces")
SPACE_TYPE = (
('SOC', 'Socio-economic System'),
('NAT', 'Natural Environment'),
......@@ -145,8 +149,21 @@ class ReferenceSpace(models.Model):
def save(self, *args, **kwargs):
if not self.id:
# Newly created object, so set slug
self.slug = slugify(self.name)
slug = slugify(self.name)
check = ReferenceSpace.objects.filter(slug=slug)
if check:
# We must try another slug, this one already exists
if self.city:
slug = slugify(self.name) + "-" + self.city.slug
elif self.country:
slug = slugify(self.name) + "-" + self.country.slug
else:
slug = slugify(self.name) + "-" + self.type.slug
check = ReferenceSpace.objects.filter(slug=slug)
if check:
# If even that one already exists, we simply add the ID onto the slug
slug = slugify(self.name + "-" + get_random_string(5))
self.slug = slug
super(ReferenceSpace, self).save(*args, **kwargs)
def system_photo(self):
......@@ -261,6 +278,10 @@ class ProcessGroup(models.Model):
def __str__(self):
return self.name
def spaces(self):
return ReferenceSpaceType.objects.filter(processes__in=self.processes.all())
def datasets(self):
return DatasetType.objects.filter(Q(origin_process__in=self.processes.all()) | Q(destination_process__in=self.processes.all()))
class ReferenceSpaceSector(models.Model):
space = models.ForeignKey(ReferenceSpace, on_delete=models.CASCADE, related_name='sectors')
......
#footerwarning {
z-index: 100000;
margin-bottom: 0;
text-align: center;
position: fixed;
width: auto;
right: 10px;
bottom: 10px;
}
h2 {
font-size: 24px;
}
.text-2x {
font-size: 24px;
}
header#navbar {
position: fixed;
background-color: #fff;
}
.social-media-bar {
position: absolute;
bottom: 0;
width: 100%;
background-color: #000;
color: #fff;
padding: 5px 0;
text-align: center;
}
@-webkit-keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}
to {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}
to {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
.fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
@media (max-width: 991px) {
img:not(.logo) {
width: 100%;
display: block;
max-width: 400px;
border-radius: 4px;
border: 2px solid #fff;
margin: 0 auto;
margin-top: 20px;
}
img.logo {
max-width: 200px;
display: block;
margin: 0 auto;
border-radius: 0;
border: none;
}
article.home {
margin-top: 60px;
}
.container {
padding: 0;
}
section.section {
padding: 30px 15px !important;
}
section.section:nth-of-type(1) {
background-color: #df7247;
}
section.section:nth-of-type(2) {
background-color: #7b858e;
}
section.section:nth-of-type(2) .white.text {
color: #fff;
}
section.section:nth-of-type(3) {
background-color: #7ca1bb;
}
section.section:nth-of-type(4) {
background-color: #cedfe6;
padding-bottom: 0 !important;
}
.social-media-bar {
position: relative;
width: calc(100% + 30px);
margin-left: -15px;
margin-top: 30px;
}
.text-center {
text-align: unset;
}
.split-text {
margin-bottom: 30px;
}
.standard.split-text {
margin-bottom: 60px;
}
}
@media (min-width: 992px) {
img.logo {
position: absolute;
top: 10%;
left: 10%;
width: 100px !important;
z-index: 1000;
}
.downArrow {
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
}
.downArrow:hover {
cursor: pointer;
}
.downArrow i {
color: #fff;
}
.bounce {
-moz-animation: bounce 3s infinite;
-webkit-animation: bounce 3s infinite;
animation: bounce 3s infinite;
}
@-moz-keyframes bounce {
0%, 20%, 50%, 80%, 100% {
-moz-transform: translateY(0);
transform: translateY(0);
}
40% {
-moz-transform: translateY(-30px);
transform: translateY(-30px);
}
60% {
-moz-transform: translateY(-15px);
transform: translateY(-15px);
}
}
@-webkit-keyframes bounce {
0%, 20%, 50%, 80%, 100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
40% {
-webkit-transform: translateY(-30px);
transform: translateY(-30px);
}
60% {
-webkit-transform: translateY(-15px);
transform: translateY(-15px);
}
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-webkit-transform: translateY(0);
transform: translateY(0);
}
40% {
-moz-transform: translateY(-30px);
-ms-transform: translateY(-30px);
-webkit-transform: translateY(-30px);
transform: translateY(-30px);
}
60% {
-moz-transform: translateY(-15px);
-ms-transform: translateY(-15px);
-webkit-transform: translateY(-15px);
transform: translateY(-15px);
}
}
.onepage-pagination li a