Updated marketplace themes (#1852)

refs https://github.com/TryGhost/Team/issues/480

- switched marketplace themes to a selection of Ghost's own free themes
- added install and preview buttons for all
- show theme screenshot in the install modal if it's a known theme
This commit is contained in:
Kevin Ansfield 2021-02-24 15:42:03 +00:00 committed by GitHub
parent 0503ce5f35
commit f0824225fd
20 changed files with 74 additions and 49 deletions

View File

@ -4,7 +4,7 @@
<a class="close" href="" role="button" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}<span class="hidden">Close</span></a> <a class="close" href="" role="button" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}<span class="hidden">Close</span></a>
<div class="modal-body"> <div class="modal-body">
<p>You're about to delete "<strong>{{this.theme.label}}</strong>". This is permanent! We warned you, k? Maybe <a href="#" {{action this.download}}>Download your theme before continuing</a></p> <p>You're about to delete "<strong>{{this.theme.label}}</strong>". This is permanent! We warned you, k? Maybe <a href="#" {{action this.download}}>download your theme before continuing</a></p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View File

@ -19,8 +19,7 @@
<div class="modal-body"> <div class="modal-body">
{{#if this.isReady}} {{#if this.isReady}}
<p> <p>
Are you sure you want to install <strong>{{this.themeName}}</strong> from You're about to install <strong>{{this.themeName}}</strong> from the theme directory.
<a href="https://github.com/{{this.model.ref}}" target="_blank" rel="noopener noreferrer">https://github.com/{{this.model.ref}}</a>?
</p> </p>
{{#if this.willOverwriteExisting}} {{#if this.willOverwriteExisting}}
<p> <p>
@ -28,6 +27,12 @@
Any custom changes will be lost. Any custom changes will be lost.
</p> </p>
{{/if}} {{/if}}
{{#if this.marketplaceTheme.shortImage}}
<div class="theme-validation-screenshot relative">
<img style="object-fit:contain;" src={{this.marketplaceTheme.shortImage}} alt="Edition Theme" />
</div>
{{/if}}
{{/if}} {{/if}}
{{#if this.willOverwriteDefault}} {{#if this.willOverwriteDefault}}

View File

@ -6,6 +6,8 @@ import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency-decorators'; import {task} from 'ember-concurrency-decorators';
import {tracked} from '@glimmer/tracking'; import {tracked} from '@glimmer/tracking';
import {MARKETPLACE_THEMES} from 'ghost-admin/controllers/settings/theme';
// TODO: update modals to work fully with Glimmer components // TODO: update modals to work fully with Glimmer components
@classic @classic
export default class ModalInstallThemeComponent extends ModalBase { export default class ModalInstallThemeComponent extends ModalBase {
@ -24,6 +26,10 @@ export default class ModalInstallThemeComponent extends ModalBase {
return this.model.ref.split('/')[1]; return this.model.ref.split('/')[1];
} }
get marketplaceTheme() {
return MARKETPLACE_THEMES.find(theme => theme.name.toLowerCase() === this.themeName.toLowerCase());
}
get currentThemeNames() { get currentThemeNames() {
return this.model.themes.mapBy('name'); return this.model.themes.mapBy('name');
} }

View File

@ -7,6 +7,40 @@ import {isThemeValidationError} from 'ghost-admin/services/ajax';
import {notEmpty} from '@ember/object/computed'; import {notEmpty} from '@ember/object/computed';
import {inject as service} from '@ember/service'; import {inject as service} from '@ember/service';
export const MARKETPLACE_THEMES = [{
name: 'Edition',
category: 'Newsletter',
url: 'https://github.com/TryGhost/Edition',
previewUrl: 'https://edition.ghost.io',
ref: 'TryGhost/Edition',
image: 'assets/img/themes/Edition.jpg',
shortImage: 'assets/img/themes/Edition-cut.jpg'
}, {
name: 'Alto',
category: 'Blog',
url: 'https://github.com/TryGhost/Alto',
previewUrl: 'https://alto.ghost.io',
ref: 'TryGhost/Alto',
image: 'assets/img/themes/Alto.jpg',
shortImage: 'assets/img/themes/Alto-cut.jpg'
}, {
name: 'London',
category: 'Photography',
url: 'https://github.com/TryGhost/London',
previewUrl: 'https://london.ghost.io',
ref: 'TryGhost/London',
image: 'assets/img/themes/London.jpg',
shortImage: 'assets/img/themes/London-cut.jpg'
}, {
name: 'Ease',
category: 'Documentation',
url: 'https://github.com/TryGhost/Ease',
previewUrl: 'https://edition.ghost.io',
ref: 'TryGhost/Ease',
image: 'assets/img/themes/Ease.jpg',
shortImage: 'assets/img/themes/Ease-cut.jpg'
}];
export default Controller.extend({ export default Controller.extend({
config: service(), config: service(),
ghostPaths: service(), ghostPaths: service(),
@ -22,6 +56,7 @@ export default Controller.extend({
init() { init() {
this._super(...arguments); this._super(...arguments);
this.marketplaceThemes = MARKETPLACE_THEMES;
}, },
showDeleteThemeModal: notEmpty('themeToDelete'), showDeleteThemeModal: notEmpty('themeToDelete'),

View File

@ -390,7 +390,7 @@
} }
.td-item img { .td-item img {
box-shadow: 0 0 1px rgba(0,0,0,.02), 0 9px 25px -12px rgba(0,0,0,0.5); box-shadow: 0 0 1px rgba(0,0,0,.02), 0 9px 25px -10px rgba(0,0,0,0.2);
transition: all .8s ease; transition: all .8s ease;
border-radius: 3px; border-radius: 3px;
} }
@ -405,7 +405,7 @@
} }
.td-item:hover img { .td-item:hover img {
box-shadow: 0 0 1px rgba(0,0,0,.02), 0 19px 35px -18px rgba(0,0,0,.4); box-shadow: 0 0 1px rgba(0,0,0,.02), 0 19px 35px -14px rgba(0,0,0,.2);
transition: all .3s ease; transition: all .3s ease;
} }
@ -420,9 +420,10 @@
.td-item-desc span { .td-item-desc span {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
margin-left: 4px;
text-transform: none; text-transform: none;
font-weight: 400; font-weight: 400;
font-size: 0.9em; font-size: 1em;
color: color-mod(var(--midgrey) l(-5%)); color: color-mod(var(--midgrey) l(-5%));
} }
@ -1066,6 +1067,12 @@ p.theme-validation-details {
font-size: 1.3rem; font-size: 1.3rem;
} }
.theme-validation-screenshot img {
margin-bottom: 2rem;
border: 1px solid var(--main-color-area-divider);
border-radius: 3px;
}
/* Publication identity /* Publication identity
/* ---------------------------------------------------------- */ /* ---------------------------------------------------------- */

View File

@ -15,44 +15,24 @@
{{/if}} {{/if}}
<section class="view-container"> <section class="view-container">
<div class="gh-setting-header gh-first-header">Ghost theme directory</div>
<div class="gh-theme-directory-container"> <div class="gh-theme-directory-container">
<div class="theme-directory"> <div class="theme-directory">
<a class="td-item" href="https://github.com/TryGhost/Massively" target="_blank" rel="noopener noreferrer"> {{#each this.marketplaceThemes as |theme|}}
<a class="td-item" href={{theme.url}} target="_blank" rel="noopener noreferrer">
<div class="td-item-screenshot relative"> <div class="td-item-screenshot relative">
<img style="object-fit:contain;" src="assets/img/themes/massively.jpg" alt="Massively Theme" /> <img style="object-fit:contain;" src={{theme.image}} alt="{{theme.name}} Theme" />
<div class="td-item-overlay"> <div class="td-item-overlay">
<LinkTo class="td-item-action gh-btn gh-btn-black mb4" @route="settings.theme.install" @query={{hash source="github" ref="TryGhost/Massively"}}><span>Install</span></LinkTo> <LinkTo class="td-item-action gh-btn gh-btn-black mb4" @route="settings.theme.install" @query={{hash source="github" ref=theme.ref}}><span>Install</span></LinkTo>
<a href="https://massively.ghost.io" class="td-item-action gh-btn" target="_blank" rel="noopener"><span>Preview</span></a> <a href={{theme.previewUrl}} class="td-item-action gh-btn" target="_blank" rel="noopener"><span>Preview</span></a>
</div> </div>
</div> </div>
<div class="td-item-desc"> <div class="td-item-desc">
<div>Massively <span>— Free</span></div> <div>{{theme.name}}</div>
</div> <span>• {{theme.category}}</span>
</a>
<a class="td-item" href="https://themeforest.net/item/nurui-multipurpose-ghost-blog-theme/22243886" target="_blank" rel="noopener noreferrer">
<div class="td-item-screenshot">
<img style="object-fit:contain;" src="assets/img/themes/nurui.jpg" alt="Nurui Theme" />
</div>
<div class="td-item-desc">
<div>Nurui <span>— Premium</span></div>
</div>
</a>
<a class="td-item" href="https://themeforest.net/item/pacific-big-bold-photographydriven-theme/19774541" target="_blank" rel="noopener noreferrer">
<div class="td-item-screenshot">
<img style="object-fit:contain;" src="assets/img/themes/pacific.jpg" alt="Pacific Theme" />
</div>
<div class="td-item-desc">
<div>Pacific <span>— Premium</span></div>
</div>
</a>
<a class="td-item" href="https://www.hauntedthemes.com/" target="_blank" rel="noopener noreferrer">
<div class="td-item-screenshot">
<img style="object-fit:contain;" src="assets/img/themes/farafra.jpg" alt="Farafra Theme" />
</div>
<div class="td-item-desc">
<div>Farafra <span>— Premium</span></div>
</div> </div>
</a> </a>
{{/each}}
<a class="td-item" href="https://ghost.org/marketplace/" target="_blank" rel="noopener noreferrer"> <a class="td-item" href="https://ghost.org/marketplace/" target="_blank" rel="noopener noreferrer">
<div class="td-item-empty"> <div class="td-item-empty">
{{svg-jar "circle-ellipsis" class="w5"}} {{svg-jar "circle-ellipsis" class="w5"}}
@ -60,14 +40,6 @@
<div class="midgrey f7">Explore more free and premium themes on our Marketplace</div> <div class="midgrey f7">Explore more free and premium themes on our Marketplace</div>
</div> </div>
</a> </a>
<a class="td-item" href="https://themeforest.net/item/sente-magazine-ghost-blog-theme/21019644" target="_blank" rel="noopener noreferrer">
<div class="td-item-screenshot">
<img style="object-fit:contain;" src="assets/img/themes/sente.jpg" alt="Sente Theme" />
</div>
<div class="td-item-desc">
<div>Sente <span>— Premium</span></div>
</div>
</a>
</div> </div>
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB