From b30ba944be65b9d24f6c882f11a24fe2ccd843d0 Mon Sep 17 00:00:00 2001 From: xavizalote Date: Thu, 7 Apr 2016 14:17:35 +0200 Subject: [PATCH 1/2] get HeadTags out of the post-list-header div -> dont mess with flexbox --- .../lib/posts/list/PostListHeader.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/nova-base-components/lib/posts/list/PostListHeader.jsx b/packages/nova-base-components/lib/posts/list/PostListHeader.jsx index 45a933911..b48d4609a 100644 --- a/packages/nova-base-components/lib/posts/list/PostListHeader.jsx +++ b/packages/nova-base-components/lib/posts/list/PostListHeader.jsx @@ -8,13 +8,15 @@ const PostListHeader = () => { ({PostViews, SearchForm, CategoriesList, HeadTags} = Telescope.components) return ( -
+
-
- +
+
+ +
+ +
- -
) } From 1f9a92ec17fe42754bdc2d143dd78c350d1c99e2 Mon Sep 17 00:00:00 2001 From: xavizalote Date: Thu, 7 Apr 2016 14:34:13 +0200 Subject: [PATCH 2/2] helpers for logo & thumbnail urls --- .../lib/posts/list/PostThumbnail.jsx | 2 +- packages/nova-lib/lib/utils.js | 11 ++++++++++- packages/nova-posts/lib/helpers.js | 12 +++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/nova-base-components/lib/posts/list/PostThumbnail.jsx b/packages/nova-base-components/lib/posts/list/PostThumbnail.jsx index b5958dd12..619d73192 100644 --- a/packages/nova-base-components/lib/posts/list/PostThumbnail.jsx +++ b/packages/nova-base-components/lib/posts/list/PostThumbnail.jsx @@ -3,7 +3,7 @@ import React from 'react'; const PostThumbnail = ({post}) => { return ( - + ) } diff --git a/packages/nova-lib/lib/utils.js b/packages/nova-lib/lib/utils.js index 0c9a6b9ce..6c34ef33b 100644 --- a/packages/nova-lib/lib/utils.js +++ b/packages/nova-lib/lib/utils.js @@ -317,4 +317,13 @@ Telescope.utils.getFieldLabel = (fieldName, collection) => { const label = collection.simpleSchema()._schema[fieldName].label; const nameWithSpaces = Telescope.utils.camelToSpaces(fieldName.replace("telescope.", "")); return label || nameWithSpaces; -} \ No newline at end of file +} + +Telescope.utils.getLogoUrl = () => { + const logoUrl = Telescope.settings.get("logoUrl"); + if (!!logoUrl) { + const prefix = Telescope.utils.getSiteUrl().slice(0,-1); + // the logo may be hosted on another website + return logoUrl.indexOf('://') > -1 ? logoUrl : prefix + logoUrl; + } +}; \ No newline at end of file diff --git a/packages/nova-posts/lib/helpers.js b/packages/nova-posts/lib/helpers.js index 0065df87c..59e9f5afa 100644 --- a/packages/nova-posts/lib/helpers.js +++ b/packages/nova-posts/lib/helpers.js @@ -142,4 +142,14 @@ Posts.getNotificationProperties = function (post) { properties.htmlBody = post.htmlBody; return properties; -}; \ No newline at end of file +}; + +Posts.getThumbnailUrl = (post) => { + const thumbnailUrl = post.thumbnailUrl; + if (!!thumbnailUrl) { + const prefix = Telescope.utils.getSiteUrl().slice(0,-1); + // the thumbnail may be hosted on another website + return thumbnailUrl.indexOf('://') > -1 ? thumbnailUrl : prefix + thumbnailUrl; + } +}; +Posts.helpers({ getThumbnailUrl() { return Posts.getThumbnailUrl(this); } }); \ No newline at end of file