From ee065181e2a720281f90fb5fa5e98518cc96c86e Mon Sep 17 00:00:00 2001 From: Matt Enlow Date: Sat, 2 Aug 2014 09:21:38 -0600 Subject: [PATCH] Implement About Ghost page Closes #3568 - Deleted html placeholders in client - Added new grunt task, buildAboutPage, which 1)creates -contributors.hbs partial and 2) downloads contributor avatars - buildAboutPage is called by anything that does an emberTemplates task - Removed unused code from ghostpaths --- router.js | 1 + routes/settings/about.js | 25 ++++++++++++++++ templates/settings.hbs | 2 ++ templates/settings/about.hbs | 55 ++++++++++++++++++++++++++++++++++++ utils/ghost-paths.js | 2 +- views/settings/about.js | 5 ++++ 6 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 routes/settings/about.js create mode 100644 templates/settings/about.hbs create mode 100644 views/settings/about.js diff --git a/router.js b/router.js index f4ad652c0..741a26384 100644 --- a/router.js +++ b/router.js @@ -33,6 +33,7 @@ Router.map(function () { this.resource('settings.users', { path: '/users' }, function () { this.route('user', { path: '/:slug' }); }); + this.route('about'); }); this.route('debug'); //Redirect legacy content to posts diff --git a/routes/settings/about.js b/routes/settings/about.js new file mode 100644 index 000000000..64222d0bb --- /dev/null +++ b/routes/settings/about.js @@ -0,0 +1,25 @@ +import loadingIndicator from 'ghost/mixins/loading-indicator'; + +var SettingsAboutRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, loadingIndicator, { + cachedConfig: false, + model: function () { + var cachedConfig = this.get('cachedConfig'), + self = this; + if (cachedConfig) { + return cachedConfig; + } + + return ic.ajax.request(this.get('ghostPaths.url').api('configuration')) + .then(function (configurationResponse) { + var configKeyValues = configurationResponse.configuration; + cachedConfig = {}; + configKeyValues.forEach(function (configKeyValue) { + cachedConfig[configKeyValue.key] = configKeyValue.value; + }); + self.set('cachedConfig', cachedConfig); + return cachedConfig; + }); + } +}); + +export default SettingsAboutRoute; diff --git a/templates/settings.hbs b/templates/settings.hbs index 238a7095c..562d692ca 100644 --- a/templates/settings.hbs +++ b/templates/settings.hbs @@ -14,6 +14,8 @@ {{gh-activating-list-item route="settings.users" title="Users" classNames="settings-menu-users"}} {{/unless}} + + {{gh-activating-list-item route="settings.about" title="About" classNames="settings-menu-about"}} diff --git a/templates/settings/about.hbs b/templates/settings/about.hbs new file mode 100644 index 000000000..50578f6f2 --- /dev/null +++ b/templates/settings/about.hbs @@ -0,0 +1,55 @@ +
+

About

+
+ {{#link-to 'settings' class='btn btn-default btn-back'}}Back{{/link-to}} +
+
+ +
+
+

+ + v{{version}} +

+

A free, open, simple publishing platform

+ +
+
+
+
Version:
+
{{version}}
+
Environment:
+
{{environment}}
+
Database:
+
{{database}}
+
Mail:
+
{{#if mail}}{{mail}}{{else}}Native{{/if}}
+
+
+ +
+
+ +
+

The People Who Made it Possible

+ +
    + {{partial "contributors"}} +
+ +

Ghost is built by an incredible group of contributors from all over the world. Here are just a few of the people who helped create the version you’re using right now.

+ + Find out how you can get involved + + +
+
diff --git a/utils/ghost-paths.js b/utils/ghost-paths.js index 0271dfb0a..2d03c1bf6 100644 --- a/utils/ghost-paths.js +++ b/utils/ghost-paths.js @@ -25,7 +25,7 @@ function ghostPaths() { blogRoot: subdir + '/', adminRoot: adminRoot, apiRoot: apiRoot, - userImage: assetUrl('/assets/img/user-image.png'), + contributorsDir: assetUrl('/ghost/img/contributors'), errorImageSrc: assetUrl('/ghost/img/404-ghost@2x.png'), errorImageSrcSet: assetUrl('/ghost/img/404-ghost.png') + ' 1x, ' + assetUrl('/ghost/img/404-ghost@2x.png') + ' 2x', diff --git a/views/settings/about.js b/views/settings/about.js new file mode 100644 index 000000000..032be3076 --- /dev/null +++ b/views/settings/about.js @@ -0,0 +1,5 @@ +import BaseView from 'ghost/views/settings/content-base'; + +var SettingsAboutView = BaseView.extend(); + +export default SettingsAboutView;