Ghost/ghost/admin/app/templates/settings/design/index.hbs

58 lines
3.1 KiB
Handlebars
Raw Normal View History

<section class="gh-canvas gh-design" {{on-key "cmd+s" this.saveFromKeyboard}}>
<GhCanvasHeader class="gh-canvas-header">
2021-10-15 18:59:47 +03:00
<h2 class="gh-canvas-title">Site design</h2>
<section class="view-actions">
2021-10-14 19:01:12 +03:00
<div class="gh-select gh-design-page-preview-mode">
<OneWaySelect
@value={{this.themeManagement.previewType}}
@options={{this.themeManagement.availablePreviewTypes}}
@optionValuePath="name"
@optionLabelPath="label"
@optionTargetPath="name"
@update={{this.themeManagement.setPreviewType}}
/>
{{svg-jar "arrow-down-small"}}
</div>
<div class="gh-contentfilter gh-btn-group">
<button type="button" class="gh-btn gh-design-preview-mode {{if this.isDesktopPreview "gh-btn-group-selected"}}" {{on "click" (fn this.setPreviewSize "desktop")}} data-test-button="desktop-preview"><span>{{svg-jar "desktop"}}</span></button>
<button type="button" class="gh-btn gh-design-preview-mode {{if this.isMobilePreview "gh-btn-group-selected"}}" {{on "click" (fn this.setPreviewSize "mobile")}} data-test-button="mobile-preview"><span>{{svg-jar "mobile-phone"}}</span></button>
</div>
<GhTaskButton
@buttonText="Save changes"
@task={{this.saveTask}}
@successText="Saved"
@runningText="Saving"
@class="gh-btn gh-btn-primary gh-btn-icon"
data-test-button="save-settings"
/>
</section>
</GhCanvasHeader>
<div class="view-container">
{{!-- changes only classes between desktop/mobile to avoid re-rendering iframe contents --}}
<div class="{{if this.isMobilePreview "gh-pe-mobile-container flex justify-center" "gh-browserpreview-previewcontainer"}}">
{{#if this.isDesktopPreview}}
<div class="gh-browserpreview-browser">
<div class="tabs">
<ul><li></li><li></li><li></li></ul>
<div>
{{#if this.settings.icon}}
<span class="favicon"><img src={{this.settings.icon}} alt="icon"></span>
{{else}}
<span class="favicon default">{{svg-jar "default-favicon"}}</span>
{{/if}}
<span class="site-title">{{this.settings.title}}</span>
</div>
</div>
</div>
{{/if}}
<div class="{{if this.isMobilePreview "gh-pe-mobile-bezel" "gh-browserpreview-iframecontainer"}}">
<div class="{{if this.isMobilePreview "gh-pe-mobile-screen"}}">
<GhHtmlIframe class={{if this.isMobilePreview "gh-post-preview-iframe" "site-frame"}} @html={{this.themeManagement.previewHtml}} @pageId={{this.themeManagement.previewType}} />
</div>
</div>
</div>
</div>
</section>