from django.utils.translation import ugettext_lazy as _
from mezzanine.core.admin import *
+from mezzanine.pages.admin import PageAdmin
from organization.projects.models import *
from organization.pages.models import *
admin.site.register(ProjectProgram, ProjectProgramAdmin)
admin.site.register(ProjectProgramType, ProjectProgramTypeAdmin)
admin.site.register(ProjectTopic, ProjectTopicAdmin)
+admin.site.register(ProjectTopicPage, PageAdmin)
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-09-22 14:11
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('pages', '0004_auto_20160804_1547'),
+ ('organization-projects', '0011_auto_20160922_1438'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='ProjectTopicPage',
+ fields=[
+ ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='pages.Page')),
+ ('sub_title', models.TextField(blank=True, max_length=1024, verbose_name='sub title')),
+ ('project_topic', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pages', to='organization-projects.ProjectTopic', verbose_name='project topic')),
+ ],
+ options={
+ 'ordering': ('_order',),
+ 'verbose_name': 'team page',
+ },
+ bases=('pages.page', models.Model),
+ ),
+ ]
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-09-22 14:33
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organization-projects', '0012_projecttopicpage'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='projecttopicpage',
+ name='sub_title_en',
+ field=models.TextField(blank=True, max_length=1024, null=True, verbose_name='sub title'),
+ ),
+ migrations.AddField(
+ model_name='projecttopicpage',
+ name='sub_title_fr',
+ field=models.TextField(blank=True, max_length=1024, null=True, verbose_name='sub title'),
+ ),
+ ]
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-09-22 14:42
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organization-projects', '0013_auto_20160922_1633'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='projecttopicpage',
+ options={'ordering': ('_order',), 'verbose_name': 'project topic page'},
+ ),
+ ]
class ProjectBlock(Block):
project = models.ForeignKey(Project, verbose_name=_('project'), related_name='blocks', blank=True, null=True, on_delete=models.SET_NULL)
+
+
+class ProjectTopicPage(Page, SubTitled):
+
+ project_topic = models.ForeignKey('ProjectTopic', verbose_name=_('project topic'), related_name="pages", blank=True, null=True, on_delete=models.SET_NULL)
+
+ class Meta:
+ verbose_name = _('project topic page')
class ProjectTopicTranslationOptions(TranslationOptions):
fields = ('name', 'description')
+
+
+@register(ProjectTopicPage)
+class ProjectTopicPageTranslationOptions(TranslationOptions):
+
+ fields = ('sub_title',)
+++ /dev/null
-{% for project in projects %}
- <h5><a href="{{ project.get_absolute_url }}" title="">{{ project.title }}</a></h5>
- <p>{{ project.description|slice:":500" }}</p>
-{% endfor %}