2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Merge pull request #4560 from cobbspur/labs

Move ugly debug to Settings  Labs
This commit is contained in:
Hannah Wolfe 2014-12-02 10:34:17 +00:00
commit 89905a8e3c
10 changed files with 83 additions and 89 deletions

View file

@ -1,4 +1,4 @@
var DebugController = Ember.Controller.extend(Ember.Evented, {
var LabsController = Ember.Controller.extend(Ember.Evented, {
uploadButtonText: 'Import',
importErrors: '',
@ -63,4 +63,4 @@ var DebugController = Ember.Controller.extend(Ember.Evented, {
}
});
export default DebugController;
export default LabsController;

View file

@ -39,8 +39,10 @@ Router.map(function () {
this.route('about');
this.route('tags');
this.route('labs');
});
// Redirect debug to settings labs
this.route('debug');
// Redirect legacy content to posts

View file

@ -1,29 +1,7 @@
import AuthenticatedRoute from 'ghost/routes/authenticated';
import styleBody from 'ghost/mixins/style-body';
import loadingIndicator from 'ghost/mixins/loading-indicator';
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');
});
var DebugRoute = Ember.Route.extend({
beforeModel: function () {
this.transitionTo('settings.labs');
}
});
export default DebugRoute;

View 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;

View file

@ -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>

View file

@ -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.labs" title="Labs" classNames="settings-nav-labs icon-atom"}}
{{/unless}}
{{gh-activating-list-item route="settings.about" title="About" classNames="settings-nav-about icon-pacman"}}

View 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>

View file

@ -0,0 +1,5 @@
import BaseView from 'ghost/views/settings/content-base';
var SettingsLabsView = BaseView.extend();
export default SettingsLabsView;

View file

@ -130,7 +130,6 @@ ConfigManager.prototype.set = function (config) {
helperTemplates: path.join(corePath, '/server/helpers/tpl/'),
exportPath: path.join(corePath, '/server/data/export/'),
lang: path.join(corePath, '/shared/lang/'),
debugPath: subdir + '/ghost/debug/',
availableThemes: this._config.paths.availableThemes || {},
availableApps: this._config.paths.availableApps || {},

View file

@ -83,7 +83,6 @@ describe('Config', function () {
'helperTemplates',
'exportPath',
'lang',
'debugPath',
'availableThemes',
'availableApps',
'builtScriptPath'