forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/TryGhost/Ghost into main
- Loading branch information
Showing
36 changed files
with
1,707 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule casper
updated
5 files
+1 −1 | assets/built/screen.css | |
+1 −1 | assets/built/screen.css.map | |
+4 −4 | assets/css/screen.css | |
+1 −1 | package.json | |
+11 −2 | partials/post-card.hbs |
Submodule admin
updated
50 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* @param {import('bookshelf')} Bookshelf | ||
*/ | ||
module.exports = function (Bookshelf) { | ||
Bookshelf.Model = Bookshelf.Model.extend({ | ||
/** | ||
* Return a relation, and load it if it hasn't been loaded already (or force a refresh with the forceRefresh option). | ||
* refs https://github.com/TryGhost/Team/issues/1626 | ||
* @param {string} name Name of the relation to load | ||
* @param {Object} [options] Options to pass to the fetch when not yet loaded (or when force refreshing) | ||
* @param {boolean} [options.forceRefresh] If true, the relation will be fetched again even if it has already been loaded. | ||
* @returns {Promise<import('bookshelf').Model|import('bookshelf').Collection|null>} | ||
*/ | ||
getLazyRelation: async function (name, options = {}) { | ||
if (this.relations[name] && !options.forceRefresh) { | ||
// Relation was already loaded | ||
return this.relations[name]; | ||
} | ||
|
||
if (!this[name]) { | ||
return undefined; | ||
} | ||
// Not yet loaded, or force refresh | ||
// Note that we don't use .refresh on the relation on options.forceRefresh | ||
// Because the relation can also be a collection, which doesn't have a refresh method | ||
this.relations[name] = this[name](); | ||
return this.relations[name].fetch(options); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.