diff --git a/project/projects/models.py b/project/projects/models.py index f4afaf0..78045c9 100644 --- a/project/projects/models.py +++ b/project/projects/models.py @@ -44,6 +44,9 @@ class ProjectPage(Entity): related_name='+' ) + def get_download_url(self): + return self.download_url or self.asset.url + search_fields = Page.search_fields + [ index.SearchField('intro'), index.SearchField('body'), diff --git a/templates/projects/project_page.html b/templates/projects/project_page.html index 4aff665..00674f0 100644 --- a/templates/projects/project_page.html +++ b/templates/projects/project_page.html @@ -5,14 +5,24 @@ {% block body_class %}template-projectpage{% endblock %} {% block content %} -

{{ page.title }}

-

{{ page.date }}

+ {% include 'common/header.html' with page=page %} +
+
+

+ Updated: {{ page.date|datetime }} +

+ {{ page.body|richtext }} +
+
+
+
+ {% if page.get_download_link %} + Download {{ page.title }} + {% endif %} - {% if page.main_image %} - {% image page.main_image width-400 %} - {% endif %} - -
{{ page.intro }}
- - {{ page.body|richtext }} + {% if page.url %} + View on Github + {% endif %} +
+
{% endblock %}