Ghost/core/server/helpers
Katharina Irrgang 40d0a745df Multiple authors (#9426)
no issue

This PR adds the server side logic for multiple authors. This adds the ability to add multiple authors per post. We keep and support single authors (maybe till the next major - this is still in discussion)

### key notes

- `authors` are not fetched by default, only if we need them
- the migration script iterates over all posts and figures out if an author_id is valid and exists (in master we can add invalid author_id's) and then adds the relation (falls back to owner if invalid)
- ~~i had to push a fork of bookshelf to npm because we currently can't bump bookshelf + the two bugs i discovered are anyway not yet merged (https://github.com/kirrg001/bookshelf/commits/master)~~ replaced by new bookshelf release
- the implementation of single & multiple authors lives in a single place (introduction of a new concept: model relation)
- if you destroy an author, we keep the behaviour for now -> remove all posts where the primary author id matches. furthermore, remove all relations in posts_authors (e.g. secondary author)
- we make re-use of the `excludeAttrs` concept which was invented in the contributors PR (to protect editing authors as author/contributor role) -> i've added a clear todo that we need a logic to make a diff of the target relation -> both for tags and authors
- `authors` helper available (same as `tags` helper)
- `primary_author` computed field available
- `primary_author` functionality available (same as `primary_tag` e.g. permalinks, prev/next helper etc)
2018-03-27 15:16:15 +01:00
..
tpl Removed html usage in error messages (#9444) 2018-02-07 09:35:48 +01:00
asset.js Asset amends (#8294) 2017-04-10 11:30:21 +02:00
author.js Multiple authors (#9426) 2018-03-27 15:16:15 +01:00
authors.js Multiple authors (#9426) 2018-03-27 15:16:15 +01:00
body_class.js Switch to Eslint (#9197) 2017-11-01 13:44:54 +00:00
content.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
date.js Theme translations and blog localisation (#8437) 2018-01-09 14:50:57 +01:00
encode.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
excerpt.js 🐛 Fixed custom post excerpt length (#8826) 2017-08-02 15:09:12 +04:00
facebook_url.js Fixed comment in facebook_url helper (#9430) 2018-01-28 18:25:06 +01:00
foreach.js Moved visibility utility to static model fn (#9327) 2017-12-13 13:19:51 +01:00
get.js 🐛Fixed {{get}} helper's date comparison (#9454) 2018-02-14 18:33:07 +01:00
ghost_foot.js Switch to Eslint (#9197) 2017-11-01 13:44:54 +00:00
ghost_head.js Import lib/common only 2017-12-12 10:28:13 +01:00
has.js Multiple authors (#9426) 2018-03-27 15:16:15 +01:00
img_url.js Import lib/common only 2017-12-12 10:28:13 +01:00
index.js Multiple authors (#9426) 2018-03-27 15:16:15 +01:00
is.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
lang.js Theme translations and blog localisation (#8437) 2018-01-09 14:50:57 +01:00
meta_description.js Switch to Eslint (#9197) 2017-11-01 13:44:54 +00:00
meta_title.js 🐛Fixed i18n for the {{meta_title}} helper (#9468) 2018-03-19 09:48:07 +01:00
navigation.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
page_url.js Switch to Eslint (#9197) 2017-11-01 13:44:54 +00:00
pagination.js 🎨 Improved pagination misusage error 2017-11-28 13:44:14 +00:00
plural.js Theme translations and blog localisation (#8437) 2018-01-09 14:50:57 +01:00
post_class.js Switch to Eslint (#9197) 2017-11-01 13:44:54 +00:00
prev_next.js Multiple authors (#9426) 2018-03-27 15:16:15 +01:00
proxy.js Moved social utility to lib/social 2017-12-14 22:34:05 +01:00
reading_time.js 🐛 Fixed escaping < in reading time helper (#9508) 2018-03-19 09:47:58 +07:00
register.js Moved labs, auth, permissions, settings, mail, themes to services (#9339) 2017-12-14 03:01:23 +01:00
t.js Theme translations and blog localisation (#8437) 2018-01-09 14:50:57 +01:00
tags.js Moved visibility utility to static model fn (#9327) 2017-12-13 13:19:51 +01:00
template.js Moved labs, auth, permissions, settings, mail, themes to services (#9339) 2017-12-14 03:01:23 +01:00
title.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
twitter_url.js Moved social utility to lib/social 2017-12-14 22:34:05 +01:00
url.js Helper Proxy & single express-hbs instance (#8225) 2017-04-04 18:07:35 +02:00
utils.js 🐛Added more language support to {{reading_time}} helper (#9509) 2018-03-22 10:27:02 +07:00