2015-06-13 16:34:09 +02:00
<section class="gh-view">
<header class="view-header">
2015-08-12 09:17:01 +02:00
{{ # gh-view-title openMobileMenu = "openMobileMenu" }} <span>General</span> {{ / gh-view-title }}
2015-06-13 16:34:09 +02:00
<section class="view-actions">
2017-02-16 20:50:05 +01:00
{{ # gh-spin-button class = "gh-btn gh-btn-blue" action = "save" submitting = submitting }} <span>Save</span> {{ / gh-spin-button }}
2015-06-13 16:34:09 +02:00
</section>
</header>
2014-03-10 04:44:08 +01:00
2015-06-13 16:34:09 +02:00
<section class="view-content">
<form id="settings-general" novalidate="novalidate">
<fieldset>
2014-03-10 04:44:08 +01:00
2015-08-27 22:28:41 +02:00
{{ # gh-form-group errors = model .errors hasValidated = model .hasValidated property = "title" }}
2015-06-13 16:34:09 +02:00
<label for="blog-title">Blog Title</label>
2016-06-18 13:44:23 +02:00
{{ gh-input model .title id = "blog-title" name = "general[title]" type = "text" focusOut = ( action "validate" "title" target = model ) update = ( action ( mut model .title ) ) }}
2015-07-07 19:14:23 +02:00
{{ gh-error-message errors = model .errors property = "title" }}
2015-06-13 16:34:09 +02:00
<p>The name of your blog</p>
2015-07-07 19:14:23 +02:00
{{ / gh-form-group }}
2014-08-14 17:31:38 +02:00
2015-08-27 22:28:41 +02:00
{{ # gh-form-group errors = model .errors hasValidated = model .hasValidated property = "description" class = "description-container" }}
2015-06-13 16:34:09 +02:00
<label for="blog-description">Blog Description</label>
2016-06-18 13:44:23 +02:00
{{ gh-textarea model .description id = "blog-description" name = "general[description]" focusOut = ( action "validate" "description" target = model ) update = ( action ( mut model .description ) ) }}
2015-07-07 19:14:23 +02:00
{{ gh-error-message errors = model .errors property = "description" }}
2015-06-13 16:34:09 +02:00
<p>
Describe what your blog is about
{{ gh-count-characters model .description }}
</p>
2015-07-07 19:14:23 +02:00
{{ / gh-form-group }}
2015-06-13 16:34:09 +02:00
</fieldset>
2014-03-10 04:44:08 +01:00
<div class="form-group">
2015-06-13 16:34:09 +02:00
<label>Blog Logo</label>
{{ # if model .logo }}
2015-11-18 11:50:48 +01:00
<img class="blog-logo" src=" {{ model .logo }} " alt="logo" role="button" {{ action "toggleUploadLogoModal" }} >
2015-06-13 16:34:09 +02:00
{{ else }}
2017-02-16 20:50:05 +01:00
<button type="button" class="gh-btn gh-btn-green js-modal-logo" {{ action "toggleUploadLogoModal" }} ><span>Upload Image</span></button>
2015-06-13 16:34:09 +02:00
{{ / if }}
2016-03-03 09:52:27 +01:00
<p>Display a logo for your publication</p>
2015-11-18 11:50:48 +01:00
{{ # if showUploadLogoModal }}
{{ gh-fullscreen-modal "upload-image"
2017-01-26 12:17:34 +01:00
model=(hash model=model imageProperty="logo" allowUrlInput=true)
2016-08-17 17:01:46 +02:00
close=(action "toggleUploadLogoModal")
modifier="action wide"}}
2015-11-18 11:50:48 +01:00
{{ / if }}
2014-03-10 04:44:08 +01:00
</div>
2017-01-26 12:17:34 +01:00
{{ # if config .fileStorage }}
<div class="form-group">
<label>Blog Icon</label>
{{ # if model .icon }}
<img class="blog-icon" src=" {{ model .icon }} " alt="icon" role="button" {{ action "toggleUploadIconModal" }} >
{{ else }}
2017-02-16 20:50:05 +01:00
<button type="button" class="gh-btn gh-btn-green js-modal-logo" {{ action "toggleUploadIconModal" }} ><span>Upload Image</span></button>
2017-01-26 12:17:34 +01:00
{{ / if }}
<p>Upload a square blog icon ('.ico' or '.png', max. 100kb, 32px * 32px up to 1,000px * 1,000px) for your publication</p>
{{ # if showUploadIconModal }}
{{ gh-fullscreen-modal "upload-image"
model=(hash model=model imageProperty="icon" accept=iconMimeTypes extensions=iconExtensions allowUrlInput=false uploadUrl="/uploads/icon/")
close=(action "toggleUploadIconModal")
modifier="action wide"}}
{{ / if }}
</div>
{{ / if }}
2015-06-13 16:34:09 +02:00
<div class="form-group">
<label>Blog Cover</label>
{{ # if model .cover }}
2015-11-18 11:50:48 +01:00
<img class="blog-cover" src=" {{ model .cover }} " alt="cover photo" role="button" {{ action "toggleUploadCoverModal" }} >
2015-06-13 16:34:09 +02:00
{{ else }}
2017-02-16 20:50:05 +01:00
<button type="button" class="gh-btn gh-btn-green js-modal-cover" {{ action "toggleUploadCoverModal" }} ><span>Upload Image</span></button>
2015-06-13 16:34:09 +02:00
{{ / if }}
<p>Display a cover image on your site</p>
2015-11-18 11:50:48 +01:00
{{ # if showUploadCoverModal }}
{{ gh-fullscreen-modal "upload-image"
2017-01-26 12:17:34 +01:00
model=(hash model=model imageProperty="cover" allowUrlInput=true)
2016-08-17 17:01:46 +02:00
close=(action "toggleUploadCoverModal")
modifier="action wide"}}
2015-11-18 11:50:48 +01:00
{{ / if }}
2014-03-10 04:44:08 +01:00
</div>
2015-06-13 16:34:09 +02:00
<fieldset>
2015-05-11 17:35:55 +02:00
2015-06-13 16:34:09 +02:00
<div class="form-group">
2017-01-08 16:55:19 +01:00
{{ # gh-form-group errors = model .errors hasValidated = model .hasValidated property = "postsPerPage" }}
<label for="postsPerPage">Posts per page</label>
{{! `pattern` brings up numeric keypad allowing any number of digits}}
{{ gh-input model .postsPerPage id = "postsPerPage" name = "general[postsPerPage]" focusOut = ( action "validate" "postsPerPage" target = model ) min = "1" max = "1000" type = "number" pattern = "[0-9]*" update = ( action ( mut model .postsPerPage ) ) }}
{{ gh-error-message errors = model .errors property = "postsPerPage" }}
<p>How many posts should be displayed on each page</p>
{{ / gh-form-group }}
2015-06-13 16:34:09 +02:00
</div>
2015-05-11 17:35:55 +02:00
2015-06-13 16:34:09 +02:00
<div class="form-group for-checkbox">
<label for="permalinks">Dated Permalinks</label>
<label class="checkbox" for="permalinks">
2016-06-18 13:44:23 +02:00
{{ one-way-checkbox isDatedPermalinks id = "permalinks" class = "gh-input" name = "general[permalinks]" update = ( action ( mut isDatedPermalinks ) ) }}
2015-06-13 16:34:09 +02:00
<span class="input-toggle-component"></span>
<p>Include the date in your post URLs</p>
</label>
</div>
2016-03-03 09:52:27 +01:00
<div class="form-group">
{{ # gh-form-group errors = model .errors hasValidated = model .hasValidated property = "facebook" }}
<label for="facebook">Facebook Page</label>
<input value= {{ model .facebook }} oninput= {{ action ( mut _ scratchFacebook ) value = "target.value" }} {{ action "validateFacebookUrl" on = "focusOut" }} type="url" class="gh-input" id="facebook" name="general[facebook]" placeholder="https://www.facebook.com/ghost" autocorrect="off" />
{{ gh-error-message errors = model .errors property = "facebook" }}
<p>URL of your blog's Facebook Page</p>
{{ / gh-form-group }}
</div>
<div class="form-group">
{{ # gh-form-group errors = model .errors hasValidated = model .hasValidated property = "twitter" }}
<label for="twitter">Twitter Profile</label>
<input value= {{ model .twitter }} oninput= {{ action ( mut _ scratchTwitter ) value = "target.value" }} {{ action "validateTwitterUrl" on = "focusOut" }} type="url" class="gh-input" id="facebook" name="general[twitter]" placeholder="https://twitter.com/tryghost" autocorrect="off" />
{{ gh-error-message errors = model .errors property = "twitter" }}
<p>URL of your blog's Twitter profile</p>
{{ / gh-form-group }}
</div>
2016-07-26 12:24:37 +02:00
{{ gh-timezone-select
activeTimezone=model.activeTimezone
availableTimezones=availableTimezones
update=(action "setTimezone")}}
Timezones: Always use the timezone of blog setting
closes TryGhost/Ghost#6406
follow-up PR of #2
- adds a `timeZone` Service to provide the offset (=timezone reg. moment-timezone) of the users blog settings
- `gh-datetime-input` will read the offset of the timezone now and adjust the `publishedAt` date with it. This is the date which will be shown in the PSM 'Publish Date' field. When the user writes a new date/time, the offset is considered and will be deducted again before saving it to the model. This way, we always work with a UTC publish date except for this input field.
- gets `availableTimezones` from `configuration/timezones` API endpoint
- adds a `moment-utc` transform on all date attr (`createdAt`, `updatedAt`, `publishedAt`, `unsubscribedAt` and `lastLogin`) to only work with UTC times on serverside
- when switching the timezone in the select box, the user will be shown the local time of the selected timezone
- `createdAt`-property in `gh-user-invited` returns now `moment(createdAt).fromNow()` as `createdAt` is a moment date already
- added clock service to show actual time ticking below select box
- default timezone is '(GMT) Greenwich Mean Time : Dublin, Edinburgh, London'
- if no timezone is saved in the settings yet, the default value will be used
- shows the local time in 'Publish Date' in PSM by default, until user overwrites it
- adds dependency `moment-timezone 0.5.4` to `bower.json`
---------
**Tests:**
- sets except for clock service in test env
- adds fixtures to mirage
- adds `service.ajax` and `service:ghostPaths` to navigation-test.js
- adds unit test for `gh-format-timeago` helper
- updates acceptance test `general-setting`
- adds acceptance test for `editor`
- adds integration tests for `services/config` and `services/time-zone`
---------
**Todos:**
- [ ] Integration tests: ~~`services/config`~~, ~~`services/time-zone`~~, `components/gh-datetime-input`
- [x] Acceptance test: `editor`
- [ ] Unit tests: `utils/date-formatting`
- [ ] write issue for renaming date properties (e. g. `createdAt` to `createdAtUTC`) and translate those for server side with serializers
2016-02-02 08:04:40 +01:00
2015-06-13 16:34:09 +02:00
<div class="form-group for-checkbox">
<label for="isPrivate">Make this blog private</label>
<label class="checkbox" for="isPrivate">
2016-06-18 13:44:23 +02:00
{{ one-way-checkbox model .isPrivate id = "isPrivate" name = "general[isPrivate]" type = "checkbox" update = ( action ( mut model .isPrivate ) ) }}
2015-06-13 16:34:09 +02:00
<span class="input-toggle-component"></span>
<p>Enable password protection</p>
</label>
</div>
{{ # if model .isPrivate }}
2015-11-18 11:50:48 +01:00
{{ # gh-form-group errors = model .errors hasValidated = model .hasValidated property = "password" }}
2016-06-18 13:44:23 +02:00
{{ gh-input model .password name = "general[password]" type = "text" focusOut = ( action "validate" "password" target = model ) update = ( action ( mut model .password ) ) }}
2015-11-18 11:50:48 +01:00
{{ gh-error-message errors = model .errors property = "password" }}
<p>This password will be needed to access your blog. All search engine optimization and social features are now disabled. This password is stored in plaintext.</p>
{{ / gh-form-group }}
2015-06-13 16:34:09 +02:00
{{ / if }}
</fieldset>
2016-03-03 09:52:27 +01:00
2016-08-17 17:01:46 +02:00
<div class="settings-themes">
2016-08-25 11:22:43 +02:00
<h3 id="themes">Themes</h3>
2016-08-17 17:01:46 +02:00
{{ gh-theme-table
availableThemes=model.availableThemes
activateTheme=(action "setTheme")
downloadTheme=(action "downloadTheme")
deleteTheme=(action "deleteTheme")}}
<div class="form-group">
2017-02-16 20:50:05 +01:00
{{ # link-to "settings.general.uploadtheme" class = "gh-btn gh-btn-green" }}
<span>Upload a theme</span>
2016-08-17 17:01:46 +02:00
{{ / link-to }}
</div>
{{ # if showDeleteThemeModal }}
{{ gh-fullscreen-modal "delete-theme"
model=(hash
theme=themeToDelete
download=(action "downloadTheme" themeToDelete)
)
close=(action "hideDeleteThemeModal")
confirm=(action "deleteTheme")
modifier="action wide"}}
{{ / if }}
</div>
2015-06-13 16:34:09 +02:00
</form>
</section>
2014-12-30 03:11:24 +01:00
</section>
2016-08-17 17:01:46 +02:00
{{ outlet }}