Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' of https://github.com/ic-labs/django-icekit in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
Greg Turner committed Dec 6, 2016
2 parents 7d97793 + bfaff0d commit 5d010a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 17 additions & 0 deletions icekit/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,23 @@ def get_boosted_search_terms(self):
def get_oneliner(self):
return getattr(self, 'oneliner', "")

def get_og_title(self):
"""
return meta_title if exists otherwise fall back to title
"""
if hasattr(self, 'meta_title') and self.meta_title:
return self.meta_title
return self.get_title()

def get_og_image(self):
return self.get_list_image()

def get_og_desciption(self):
if hasattr(self, 'meta_description') and self.meta_description:
return self.meta_description
return self.get_oneliner()



class HeroMixin(models.Model):
"""
Expand Down
5 changes: 3 additions & 2 deletions icekit/publishing/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
from fluent_pages.adminui.pageadmin import _select_template_name
from fluent_pages.adminui.urlnodeparentadmin import UrlNodeParentAdmin

from icekit.admin_mixins import FluentLayoutsMixin

from .models import PublishingModel


Expand Down Expand Up @@ -723,6 +721,9 @@ class ICEKitFluentPagesParentAdminMixin(
list_filter = (PublishingStatusFilter, PublishingPublishedFilter)


# this import must go here to avoid import errors
from icekit.admin_mixins import FluentLayoutsMixin

class PublishableFluentContentsAdmin(PublishingAdmin, FluentLayoutsMixin):
"""
Add publishing admin features for models with Fluent Contents features
Expand Down

0 comments on commit 5d010a9

Please sign in to comment.