Ghost/ghost/admin/app/templates/settings/general.hbs
Kevin Ansfield ad98a9a072 🎨 refactor settings screens to use ember-concurrency & gh-task-button
refs https://github.com/TryGhost/Ghost/issues/7865
- updates all settings screens to use EC tasks and `gh-task-button` to get save-state save buttons
- removes now-unused `settings-save` mixin
- moves the order of button color CSS so that grey buttons can change to green/red after completing
- removes the heading from `apps-loading` template so that there's no odd flash when loading slack/amp screens directly
2017-03-08 10:00:03 -07:00

176 lines
10 KiB
Handlebars

<section class="gh-canvas">
<header class="gh-canvas-header">
<h2 class="gh-canvas-title">General</h2>
<section class="view-actions">
{{gh-task-button "Save settings" task=save class="gh-btn gh-btn-blue" data-test-save-button=true}}
</section>
</header>
<section class="view-container">
<div class="gh-setting-header">Publication info</div>
<div class="gh-setting">
<div class="gh-setting-content">
<div class="gh-setting-title">Title &amp; description</div>
<div class="gh-setting-desc">The details used to identify your publication around the web</div>
{{#liquid-if pubInfoOpen}}
<div class="gh-setting-content-extended">
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="title"}}
{{gh-input model.title type="text" focusOut=(action "validate" "title" target=model) update=(action (mut model.title)) data-test-title-input=true}}
{{gh-error-message errors=model.errors property="title"}}
<p>The name of your site</p>
{{/gh-form-group}}
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="description" class="description-container"}}
{{gh-input model.description type="text" focusOut=(action "validate" "description" target=model) update=(action (mut model.description)) data-test-description-input=true}}
{{gh-error-message errors=model.errors property="description"}}
<p>Used in your theme, meta data and search results</p>
{{/gh-form-group}}
</div>
{{/liquid-if}}
</div>
<div class="gh-setting-action">
<button type="button" class="gh-btn gh-btn-hover-blue" {{action (toggle "pubInfoOpen" this)}} data-test-toggle-pub-info><span>{{if pubInfoOpen "Close" "Expand"}}</span></button>
</div>
</div>
<div class="gh-setting">
<div class="gh-setting-content">
<div class="gh-setting-title">Site timezone</div>
<div class="gh-setting-desc">Set the time and date of your publication, used for all published posts</div>
{{#liquid-if timezoneOpen}}
<div class="gh-setting-content-extended">
{{gh-timezone-select
activeTimezone=model.activeTimezone
availableTimezones=availableTimezones
update=(action "setTimezone")}}
</div>
{{/liquid-if}}
</div>
<div class="gh-setting-action">
<button type="button" class="gh-btn gh-btn-hover-blue" {{action (toggle "timezoneOpen" this)}} data-test-toggle-timezone><span>{{if timezoneOpen "Close" "Expand"}}</span></button>
</div>
</div>
<div class="gh-setting-header">Publication identity</div>
<div class="gh-setting">
<div class="gh-setting-content">
<div class="gh-setting-title">Publication icon</div>
<div class="gh-setting-desc">A square, social icon used in the UI of your publication, at least 60x60px</div>
</div>
<div class="gh-setting-action gh-setting-action-smallimg">
{{#if model.icon}}
<img class="blog-icon" src="{{model.icon}}" alt="icon" role="button" {{action "toggleUploadIconModal"}}>
{{else}}
<button type="button" class="gh-btn" {{action "toggleUploadIconModal"}}><span>Upload Image</span></button>
{{/if}}
{{#if showUploadIconModal}}
{{gh-fullscreen-modal "upload-image"
model=(hash model=model imageProperty="icon" accept=iconMimeTypes extensions=iconExtensions uploadUrl="/uploads/icon/")
close=(action "toggleUploadIconModal")
modifier="action wide"}}
{{/if}}
</div>
</div>
<div class="gh-setting">
<div class="gh-setting-content">
<div class="gh-setting-title">Publication logo</div>
<div class="gh-setting-desc">The primary logo for your brand displayed across your theme, should be transparent and at least 600px x 72px</div>
</div>
<div class="gh-setting-action gh-setting-action-smallimg">
{{#if model.logo}}
<img class="blog-logo" src="{{model.logo}}" alt="logo" role="button" {{action "toggleUploadLogoModal"}}>
{{else}}
<button type="button" class="gh-btn" {{action "toggleUploadLogoModal"}}><span>Upload Image</span></button>
{{/if}}
{{#if showUploadLogoModal}}
{{gh-fullscreen-modal "upload-image"
model=(hash model=model imageProperty="logo")
close=(action "toggleUploadLogoModal")
modifier="action wide"}}
{{/if}}
</div>
</div>
<div class="gh-setting">
<div class="gh-setting-content">
<div class="gh-setting-title">Publication cover</div>
<div class="gh-setting-desc">An optional large background image for your site</div>
</div>
<div class="gh-setting-action gh-setting-action-largeimg">
{{#if model.cover}}
<img class="blog-cover" src="{{model.cover}}" alt="cover photo" role="button" {{action "toggleUploadCoverModal"}}>
{{else}}
<button type="button" class="gh-btn" {{action "toggleUploadCoverModal"}}><span>Upload Image</span></button>
{{/if}}
{{#if showUploadCoverModal}}
{{gh-fullscreen-modal "upload-image"
model=(hash model=model imageProperty="cover")
close=(action "toggleUploadCoverModal")
modifier="action wide"}}
{{/if}}
</div>
</div>
<div class="gh-setting-header">Social accounts</div>
<div class="gh-setting">
<div class="gh-setting-content">
<div class="gh-setting-title">Social accounts</div>
<div class="gh-setting-desc">Link your social accounts for full structured data and rich card support</div>
{{#liquid-if socialOpen}}
<div class="gh-setting-content-extended">
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="facebook"}}
<input value={{model.facebook}} oninput={{action (mut _scratchFacebook) value="target.value"}} {{action "validateFacebookUrl" on="focusOut"}} type="url" class="gh-input" placeholder="https://www.facebook.com/ghost" autocorrect="off" data-test-facebook-input />
{{gh-error-message errors=model.errors property="facebook" data-test-facebook-error=true}}
<p>URL of your publication's Facebook Page</p>
{{/gh-form-group}}
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="twitter"}}
<input value={{model.twitter}} oninput={{action (mut _scratchTwitter) value="target.value"}} {{action "validateTwitterUrl" on="focusOut"}} type="url" class="gh-input" placeholder="https://twitter.com/tryghost" autocorrect="off" data-test-twitter-input />
{{gh-error-message errors=model.errors property="twitter" data-test-twitter-error=true}}
<p>URL of your publication's Twitter profile</p>
{{/gh-form-group}}
</div>
{{/liquid-if}}
</div>
<div class="gh-setting-action">
<button type="button" class="gh-btn gh-btn-hover-blue" {{action (toggle "socialOpen" this)}} data-test-toggle-social><span>{{if socialOpen "Close" "Expand"}}</span></button>
</div>
</div>
<div class="gh-setting-header">Advanced settings</div>
<div class="gh-setting">
<div class="gh-setting-content">
<div class="gh-setting-title">Use dated permalinks</div>
<div class="gh-setting-desc">Include the date in your post URLs, eg. <strong>blogurl.com/2017/01/post-title/</strong></div>
</div>
<div class="gh-setting-action">
{{one-way-checkbox isDatedPermalinks type="checkbox" update=(action (mut isDatedPermalinks)) data-test-dated-permalinks-checkbox=true}}
<span class="input-toggle-component"></span>
</div>
</div>
<div class="gh-setting">
<div class="gh-setting-content">
<div class="gh-setting-title">Make this site private</div>
<div class="gh-setting-desc">Enable protection with simple shared password, All search engine optimization and social features will be disabled.</div>
{{#if model.isPrivate}}
<div class="gh-setting-content-extended">
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="password"}}
{{gh-input model.password name="general[password]" type="text" focusOut=(action "validate" "password" target=model) update=(action (mut model.password)) data-test-password-input=true}}
{{gh-error-message errors=model.errors property="password" data-test-password-error=true}}
<p>Set the password for this site</p>
{{/gh-form-group}}
</div>
{{/if}}
</div>
<div class="gh-setting-action">
{{one-way-checkbox model.isPrivate type="checkbox" update=(action (mut model.isPrivate)) data-test-private-checkbox=true}}
<span class="input-toggle-component"></span>
</div>
</div>
</section>
</section>
{{outlet}}