Commit 20aa3080 authored by gijs's avatar gijs
Browse files

Started on templates for projects.

parent ba4ab672
......@@ -166,34 +166,52 @@ class ProjectBaseBlock (blocks.StructBlock):
on_list = blocks.BooleanBlock(required=False, help_text="Defines whether this block be displayed on the project listing page.")
on_detail = blocks.BooleanBlock(required=False, help_text="Defines whether this block will be displayed on the project detail page.")
class ProjectImageBlock (ProjectBaseBlock):
image = ImageChooserBlock()
caption = blocks.RichTextBlock(required=False, features=RICHTEXTFIELD_INLINE_FEATURE_SET)
class Meta:
template = 'projects/blocks/project-image.html'
icon = 'image'
classname= 'collapsible'
form_classname= 'collapsible'
class ProjectQuoteBlock (ProjectBaseBlock):
quote = blocks.CharBlock()
# Todo change quote to RichTextBlock.
quote = blocks.RichTextBlock(features=RICHTEXTFIELD_INLINE_FEATURE_SET)
attribution = blocks.RichTextBlock(required=False, features=RICHTEXTFIELD_INLINE_FEATURE_SET)
class Meta:
icon = 'openquote'
template = 'projects/blocks/project-quote.html'
classname= 'collapsible'
form_classname= 'collapsible'
class ProjectStreamImageBlock(blocks.StructBlock):
image = ImageChooserBlock()
caption = blocks.RichTextBlock(required=False, features=RICHTEXTFIELD_INLINE_FEATURE_SET)
class Meta:
icon = 'image'
class ProjectStreamPlanBlock(ProjectStreamImageBlock):
image = ImageChooserBlock()
pass
class ProjectStreamGalleryBlock(blocks.StructBlock):
title = blocks.CharBlock(required=False)
images = blocks.StreamBlock([('image', ProjectStreamImageBlock()), ('plan', ProjectStreamPlanBlock())])
caption = blocks.RichTextBlock(required=False, features=RICHTEXTFIELD_INLINE_FEATURE_SET)
class Meta:
icon = 'folder'
class ProjectStreamDataBlock(blocks.StreamBlock):
dataheader = blocks.CharBlock()
datarow = DataBlock()
class Meta:
templates = 'projects/block/databloc.html'
icon='table'
templates = 'projects/block/databloc.html'
class ProjectStreamBlock (ProjectBaseBlock):
body = blocks.StreamBlock([
......@@ -206,9 +224,15 @@ class ProjectStreamBlock (ProjectBaseBlock):
('datablock', ProjectStreamDataBlock()),
])
panels = [ StreamFieldPanel('body') ]
class Meta:
icon = 'doc-full '
template = 'projects/blocks/project-stream.html'
label = 'Project Stream Block'
classname= 'collapsible'
form_classname= 'collapsible'
class ProjectPage(Page):
# location = models.CharField(max_length=250, blank=True)
......
{% load wagtailcore_tags wagtailimages_tags %}
<figure class="block-project block-project--image">
{% image value.image %}
{% if value.caption %}
<figcaption>
{{ value.caption|richtext }}
</figcaption>
{% endif %}
</figure>
\ No newline at end of file
{% load wagtailcore_tags %}
<blockquote class="block-project block-project--quote">
{{ value.quote|richtext }}
<section class="attribution">
{{ value.attribution|richtext }}
</section>
</blockquote>
\ No newline at end of file
{% load wagtailcore_tags wagtailimages_tags %}
<!-- <section class="project-block--stream"> -->
{% for block in value.body %}
{% include_block block %}
{% endfor %}
<!-- </section> -->
\ No newline at end of file
......@@ -6,16 +6,14 @@
{% block content %}
<h1>{{ page.title }}</h1>
{% if page.short_description %}
{{ page.short_description|richtext }}
{% endif %}
<p class="meta">{{ page.date }}</p>
<section class="intro">{{ page.intro }}</section>
{{ page.body }}
<!-- Loop through all blocks -->
{% for block in page.body %}
<!-- Test whether the block should be displayed on this page -->
{% if block.value.on_detail %}
<!-- Get contents of the block -->
{% include_block block %}
{% endif %}
{% endfor %}
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment