mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Move ugly debug to Settings Labs
closes #4534 - Adds new Labs route - Wires route in settings page - Move and rename debug templates and logic to labs - Redirect /debug to settings/labs
This commit is contained in:
parent
bb1ee6f7d0
commit
920e36f8e0
@ -1,4 +1,4 @@
|
|||||||
var DebugController = Ember.Controller.extend(Ember.Evented, {
|
var LabsController = Ember.Controller.extend(Ember.Evented, {
|
||||||
uploadButtonText: 'Import',
|
uploadButtonText: 'Import',
|
||||||
importErrors: '',
|
importErrors: '',
|
||||||
|
|
||||||
@ -63,4 +63,4 @@ var DebugController = Ember.Controller.extend(Ember.Evented, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default DebugController;
|
export default LabsController;
|
@ -39,8 +39,10 @@ Router.map(function () {
|
|||||||
|
|
||||||
this.route('about');
|
this.route('about');
|
||||||
this.route('tags');
|
this.route('tags');
|
||||||
|
this.route('labs');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Redirect debug to settings labs
|
||||||
this.route('debug');
|
this.route('debug');
|
||||||
|
|
||||||
// Redirect legacy content to posts
|
// Redirect legacy content to posts
|
||||||
|
@ -1,29 +1,7 @@
|
|||||||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
var DebugRoute = Ember.Route.extend({
|
||||||
import styleBody from 'ghost/mixins/style-body';
|
beforeModel: function () {
|
||||||
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
this.transitionTo('settings.labs');
|
||||||
|
|
||||||
var DebugRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
|
||||||
titleToken: 'Debug',
|
|
||||||
|
|
||||||
classNames: ['settings'],
|
|
||||||
|
|
||||||
beforeModel: function (transition) {
|
|
||||||
this._super(transition);
|
|
||||||
|
|
||||||
var self = this;
|
|
||||||
this.store.find('user', 'me').then(function (user) {
|
|
||||||
if (user.get('isAuthor') || user.get('isEditor')) {
|
|
||||||
self.transitionTo('posts');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
model: function () {
|
|
||||||
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
|
||||||
return records.get('firstObject');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default DebugRoute;
|
export default DebugRoute;
|
||||||
|
23
ghost/admin/routes/settings/labs.js
Normal file
23
ghost/admin/routes/settings/labs.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||||
|
import styleBody from 'ghost/mixins/style-body';
|
||||||
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
||||||
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
||||||
|
|
||||||
|
var LabsRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, {
|
||||||
|
titleToken: 'Labs',
|
||||||
|
|
||||||
|
classNames: ['settings'],
|
||||||
|
beforeModel: function () {
|
||||||
|
return this.currentUser()
|
||||||
|
.then(this.transitionAuthor())
|
||||||
|
.then(this.transitionEditor());
|
||||||
|
},
|
||||||
|
|
||||||
|
model: function () {
|
||||||
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
||||||
|
return records.get('firstObject');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default LabsRoute;
|
@ -1,60 +0,0 @@
|
|||||||
<header class="page-header">
|
|
||||||
<button class="menu-button js-menu-button" {{action "toggleGlobalMobileNav"}}><span class="sr-only">Menu</span></button>
|
|
||||||
<h2 class="page-title">Settings</h2>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="page-content">
|
|
||||||
|
|
||||||
<div class="settings-content">
|
|
||||||
|
|
||||||
<header class="settings-view-header">
|
|
||||||
<h2 class="page-title">Ugly Debug Tools</h2>
|
|
||||||
<div class="js-settings-header-inner settings-header-inner">
|
|
||||||
{{#link-to 'settings' class='btn btn-default btn-back'}}Back{{/link-to}}
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<section class="content settings-debug">
|
|
||||||
|
|
||||||
<form id="settings-export">
|
|
||||||
<fieldset>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Export</label>
|
|
||||||
<a class="btn btn-blue" {{action "exportData"}}>Export</a>
|
|
||||||
<p>Export the blog settings and data.</p>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
{{#gh-form id="settings-import" enctype="multipart/form-data"}}
|
|
||||||
<fieldset>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Import</label>
|
|
||||||
{{partial "import-errors"}}
|
|
||||||
{{gh-file-upload id="importfile" uploadButtonText=uploadButtonText}}
|
|
||||||
<p>Import from another Ghost installation. If you import a user, this will replace the current user & log you out.</p>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
{{/gh-form}}
|
|
||||||
<form id="settings-resetdb">
|
|
||||||
<fieldset>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Delete all Content</label>
|
|
||||||
<a href="javascript:void(0);" class="btn btn-red js-delete" {{action "openModal" "deleteAll"}}>Delete</a>
|
|
||||||
<p>Delete all posts and tags from the database.</p>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
<form id="settings-testmail">
|
|
||||||
<fieldset>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Send a test email</label>
|
|
||||||
<button type="submit" id="sendtestmail" class="btn btn-blue" {{action "sendTestEmail"}}>Send</button>
|
|
||||||
<p>Sends a test email to your address.</p>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
{{gh-activating-list-item route="settings.users" title="Users" classNames="settings-nav-users icon-users"}}
|
{{gh-activating-list-item route="settings.users" title="Users" classNames="settings-nav-users icon-users"}}
|
||||||
|
|
||||||
|
{{gh-activating-list-item route="settings.labs" title="Labs" classNames="settings-nav-labs icon-atom"}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
{{gh-activating-list-item route="settings.about" title="About" classNames="settings-nav-about icon-pacman"}}
|
{{gh-activating-list-item route="settings.about" title="About" classNames="settings-nav-about icon-pacman"}}
|
||||||
|
47
ghost/admin/templates/settings/labs.hbs
Normal file
47
ghost/admin/templates/settings/labs.hbs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<header class="settings-view-header">
|
||||||
|
<h2 class="page-title">Labs</h2>
|
||||||
|
<div class="js-settings-header-inner settings-header-inner">
|
||||||
|
{{#link-to 'settings' class='btn btn-default btn-back'}}Back{{/link-to}}
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
|
||||||
|
<section class="content settings-debug">
|
||||||
|
<form id="settings-export">
|
||||||
|
<fieldset>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Export</label>
|
||||||
|
<a class="btn btn-blue" {{action "exportData"}}>Export</a>
|
||||||
|
<p>Export the blog settings and data.</p>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
{{#gh-form id="settings-import" enctype="multipart/form-data"}}
|
||||||
|
<fieldset>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Import</label>
|
||||||
|
{{partial "import-errors"}}
|
||||||
|
{{gh-file-upload id="importfile" uploadButtonText=uploadButtonText}}
|
||||||
|
<p>Import from another Ghost installation. If you import a user, this will replace the current user & log you out.</p>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
{{/gh-form}}
|
||||||
|
<form id="settings-resetdb">
|
||||||
|
<fieldset>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Delete all Content</label>
|
||||||
|
<a href="javascript:void(0);" class="btn btn-red js-delete" {{action "openModal" "deleteAll"}}>Delete</a>
|
||||||
|
<p>Delete all posts and tags from the database.</p>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
<form id="settings-testmail">
|
||||||
|
<fieldset>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Send a test email</label>
|
||||||
|
<button type="submit" id="sendtestmail" class="btn btn-blue" {{action "sendTestEmail"}}>Send</button>
|
||||||
|
<p>Sends a test email to your address.</p>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</section>
|
5
ghost/admin/views/settings/labs.js
Normal file
5
ghost/admin/views/settings/labs.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import BaseView from 'ghost/views/settings/content-base';
|
||||||
|
|
||||||
|
var SettingsLabsView = BaseView.extend();
|
||||||
|
|
||||||
|
export default SettingsLabsView;
|
Loading…
Reference in New Issue
Block a user