Commit Graph

157 Commits

Author SHA1 Message Date
Hannah Wolfe
5856cdd67e Merge pull request #3861 from cobbspur/metas
Added correct contextual Meta Titles and Descriptions
2014-08-24 18:58:23 +01:00
Jason Williams
07ad400ee0 Replace the when promise library with bluebird.
Closes #968
2014-08-23 17:15:40 +00:00
cobbspur
8604601027 Added correct contextual Meta Titles and Descriptions
closes #2462

- adds conditionals for pagination for index, tags and author pages
- outputs correct meta title and description according to context
- adds further unit testing
2014-08-23 17:42:05 +01:00
Hannah Wolfe
3a1839dfa3 Merge pull request #3817 from felixrieseberg/iss685
Prev & Next Links for Ghost_Head
2014-08-20 20:59:55 +01:00
Felix Rieseberg
15e4dd1e9f Pre & Next Links for Ghost_Head
closes #685
- Now that we have a ‘pagination’ meta object, we can implement
SEO-friendly `next` and `prev` ref links in `<head>`.
- This implementation works uniformly for anything that supports
pagination in the current schema (posts, tags, authors)
- Regex should make the implementation future-proof for additional
pagination
2014-08-20 12:28:21 -07:00
Hannah Wolfe
b91dee35c4 Removing prototypal i18n code
refs #16, #17, #18, #19, #20, #21, #3801

- This code was a prototype system built when Ghost was still a prototype.
  It was never fully implemented and hasn't actually worked for ages.
- Now that the admin is in Ember, it's likely we'll need a very different
  system.
2014-08-16 17:29:54 +01:00
Hannah Wolfe
c500b41536 Filestorage helper returns string true if config is object
no issue

- else admin client gets [object Object] which is weird Please enter the commit message for your changes. Lines starting
2014-08-11 11:50:44 +01:00
Hannah Wolfe
32d72d5daa Expose blog URL to client app
fixes #3724

 - provide config.url to the ember client app via a data attribute
 - create server and client side helpers to output the URL
 - wire up the client side helper
 - add a class for testing, and add tests for both the server and client side
2014-08-10 18:49:37 +01:00
Hannah Wolfe
9419f9bbe4 Adding missing body class for author pages
closes #3606
2014-08-05 23:38:57 +01:00
Hannah Wolfe
157cf5c3b9 Fix the author context block
fixes #3599

- If the author helper is called as a block (i.e. fn is present) then
  treat it as a with call
2014-08-05 17:03:13 +01:00
Hannah Wolfe
f9ff78475b Complete frontend multi-user features
closes #3076

- author RSS pages
- fixes page_url / pagination helper
- add 'author' option to has helper
- tests for author pages, author rss pages and helpers
2014-07-31 15:33:52 +01:00
Hannah Wolfe
4e85ac1c94 Adding new {{title}} helper
closes #3389
2014-07-29 21:45:56 +01:00
Paul Adam Davis
503f359aab Add plural handlebars helper
Closes #3414

- Adds a helper which shows a select string deopending on the number of items provided

```
{{plural pagination.total empty='No posts' singular='% post' plural='% posts'}}
```
If `pagination.total` == 0, output 'No Posts'
If `pagination.total` == 1, outputs `1 Post`
If `pagination.total` ==  2 or more, outputs `2 Posts`

Credit to @sebgie for making this work.
2014-07-29 11:40:31 +01:00
Fabian Becker
1cd2fa59bd Correct meta_title for author pages.
closes #3407
- Output correct meta_title for author pages
- Add test for meta_title for tag and author pages
2014-07-25 19:48:49 +00:00
Hannah Wolfe
63efa541bd Merge pull request #3367 from jaswilli/issue-3161
Get Ember Admin ready for production
2014-07-23 04:47:19 +01:00
Harry Wolff
be37070fb6 This aims to speed up both the ghost application and tests by
migration from usage of config() to just an object of config.

no relevant issue

- Change 'loadConfig' task to 'ensureConfig' to more accurately reflect
what it is actually doing.  Its sole purpose is to make sure a `config.js`
 file exists, and as such the name now reflects that purpose.

- Update config/index.js to export the ghostConfig object directly
so that it can be accessed from other modules

- Update all references of config(). to config.
This was a blind global find all and replace, treat it as such.

- Fixes to tests to support new config access method

- Allow each test to still work when invoked invidually
2014-07-22 22:37:44 -04:00
Jason Williams
7ae48f1dd3 Get Ember Admin ready for production
Closes #3161
- Add a config.js file for the client which is used to configure
  Ember.Application during runtime. The correct version of config.js
  is copied into place by grunt via the copy:(dev|prod) task from
  either config-dev.js or config-prod.js.
- Serve minified and production versions of libraries where applicable
  including handlebars-runtime and ember-prod.
- Bundle third party libraries into vendor.min.js.
- Bundle Ghost's Ember app and templates into ghost.min.js
- Remove all fixture data and code from the client.
2014-07-22 22:33:49 +00:00
Hannah Wolfe
c0732292ac Merge pull request #3331 from ErisDS/issue-3076
Author pages
2014-07-21 20:57:06 +01:00
Sebastian Gierlinger
05b3606fd3 Remove inline script from default.hbs
no issue
- added config values as data attributes
- removed inline script
- removed current-user.js
2014-07-21 20:00:54 +02:00
Hannah Wolfe
b7aa09f439 Author helpers
closes #3077

- expend urlFor to handle /author/ urls
- update author helper to output a link
2014-07-20 17:57:59 +01:00
Jason Williams
1bf975af90 Turn on update notifications for Ember admin
Issue #3160
- Use notifications API to display available update notification.
- Remove update_notification handlebars helper as now both the
  check for an available update and the notification handling
  is run from the server's admin controller index method.
- Bind the notification's location property to a css class
  for styling.
- Refactor Ember notifications to better handle notification
  objects.  Move responsibility for css class generation onto
  the notification component.
- Refactor gh-notifications component to take a location argument
  that's used to assign a css class and filter notifications.
2014-07-11 15:02:26 +00:00
Hannah Wolfe
f70f99b5cf Replace the old admin with the ember admin
closes #3056

- Remove clientold
- Remove clientold tests
- Cleanup old admin helpers
- Remove old routes from admin and controllers from admin controller
- Comment out / remove old and broken tests
- Cleanup Gruntfile.js, bower.js, package.json etc

Still TODO:

- cleanup / add removed tests
- do we still need countable?
2014-07-01 08:33:17 +01:00
Hannah Wolfe
a42894bc9a Ember admin works with subdirectory
fixes #3047
2014-06-24 03:14:28 +01:00
Connor Tumbleson
5933ee3afe escapes meta title/description
closes #2663
adds unit-test
2014-05-31 11:08:09 -05:00
Hannah Wolfe
83f7cfe08b Merge pull request #2788 from jaswilli/issue-1842-tests
Add tests for handlebars core helper functions
2014-05-23 16:15:16 +03:00
Martijn Swaagman
f7d2b6bd82 [fix] always add quotes 2014-05-23 14:37:03 +02:00
Martijn Swaagman
83742837c2 [docs] absolute=true will add options.hash
Ran into this will calling the helper from a theme, tried to get the absolute url, but just providing {{url absolute}} wasn't enough. After explicitly adding `=true` it worked.
2014-05-22 21:06:26 +02:00
Jason Williams
9d16e72bb0 Add tests for handlebars core helper functions
Closes #1842
-add unit tests for core helper functions
-fix up coreHelpers.e
-clean up coreHelpers.pagination
2014-05-22 03:57:52 +00:00
Hannah Wolfe
c02ebb0dcf Refactor API arguments
closes #2610, refs #2697

- cleanup API index.js, and add docs
- all API methods take consistent arguments: object & options
- browse, read, destroy take options, edit and add take object and options
- the context is passed as part of options, meaning no more .call
  everywhere
- destroy expects an object, rather than an id all the way down to the model layer
- route params such as :id, :slug, and :key are passed as an option & used
  to perform reads, updates and deletes where possible - settings / themes
  may need work here still
- HTTP posts api can find a post by slug
- Add API utils for checkData
2014-05-15 10:41:05 +01:00
Sebastian Gierlinger
fd0f5a5028 Add distinct error classes
closes #2690
- added new error classes
- moved errorhandling.js to /errors/index.js
- changed API errors to use new classes
- updated tests
2014-05-09 12:11:29 +02:00
Hannah Wolfe
d1f57a2569 Merge branch 'ember'
Conflicts:
	Gruntfile.js
	core/client/models/post.js
	core/client/models/settings.js
	core/client/models/user.js
	core/client/router.js
	package.json
2014-05-07 22:28:29 +01:00
Jacob Gable
298077582b ACL and strict rules for Settings API
Ref #2061

- Add canThis permission checks to settings api calls
- Add strict rules about accessing core settings without internal: true
- Omit core settings in browse() call unless internal: true
- Update unit tests to call api.settings with contexts
- Add a couple unit tests for new scenarios
- Update all api.settings calls in the app to call with internal context
- Re-arrange permissions.init in server startup so config.theme.update
can access settings without permissions error
2014-05-07 10:56:03 -05:00
Jacob Gable
7e9880ce8d Settings API Primary Document refactor
Closes #2606

- Refactor settings api responses to { settings: [ ] } format
- Update all code using api.settings to handle new response format
- Update test stubs to return new format
- Update client site settings model to parse new format into one object of key/value pairs
- Refactor to include all setting values
- Remove unused settingsCollection method
- Update settingsCache to store all attributes
- Update settingsResult to send all attributes
- Remove unnecessary when() wraps
- Reject if editing a setting that doesn't exist
- Reject earlier if setting key is empty
- Update tests with new error messages
- Use setting.add instead of edit that was incorrectly adding
- Update importer to properly import activePlugins and installedPlugins
- Update expected setting result fields
- Fix a weird situation where hasOwnProperty didn't exist 🤷
2014-04-30 23:15:27 -05:00
Hannah Wolfe
3eb284e4b5 Update & grunt-groc and fix docs errors
issue #2622

- Updated grunt-groc to 0.4.5
- Fixed the few places which made the docs fail to generate
- There is still a mix of styles
2014-04-21 19:04:20 +01:00
Hannah Wolfe
16c8080636 Merge branch 'master' into ember
Conflicts:
	core/client/models/post.js
2014-04-21 18:35:38 +01:00
Sebastian Gierlinger
32ea948675 Post response move pagination -> meta
closes #2604
- moved ‚pagination‘ to ‚meta‘ property
- added response test for pagination property
- changed ‚next‘ and ‚prev‘ to be set to null and exist on every
response
- removed unnecessary call to API for RSS author
2014-04-19 17:03:20 +02:00
Hannah Wolfe
c746a88b2e Merge branch 'master' into ember
Conflicts:
	Gruntfile.js
	core/client/assets/lib/showdown/extensions/ghostdown.js
	core/client/views/editor.js
	core/clientold/assets/lib/showdown/extensions/ghostdown.js
	core/shared/lib/showdown/extensions/ghostimagepreview.js
	core/test/unit/showdown_client_integrated_spec.js
	core/test/unit/showdown_ghostimagepreview_spec.js
2014-04-07 22:26:53 +01:00
Joel Fischer
758f844b8b Ghost footer outputs minified jquery in production
Closes #2524

- Added minifying jquery in grunt prod task

- Add test coverage for altered jquery
2014-04-06 08:42:25 -04:00
Hannah Wolfe
ba1c1bd25d Update some server side errors/warnings
issue #2482

- add help messages to all package.json errors/warnings
- change the pageUrl warning to have the correct version numbers
2014-03-24 13:39:44 +00:00
Fabian Becker
5abaabd100 Tag archive body_class
closes #2473
- Show tag-template class on tag pages
- Show tag-{{name}} class on tag pages
- Show archive-template only on second page of tag pages
2014-03-22 13:43:13 +00:00
Manuel Mitasch
ca9a23f2d6 Ember.js: Add assets img + css (ember-hacks.css) to ember admin
Closes #2276

- Adds the images to `core/client/assets/img`
- Adds css with ember hacks to `core/client/assets/css`
- Configures middleware to provide assets as static files at url `/ghost/ember`
- Adds ember option to assets helper
- Modifies default-ember.hbs to use ember option on asset helper
- Remove inline style definition in editor.hbs
- Modifies .gitignore to include ember-hacks.css (in ignored `core/client/assets/css` folder)
2014-03-15 00:08:15 +01:00
Hannah Wolfe
8d3a54527b jsHint fixes
issue #2294

- bad merge order = broken tests
2014-03-04 20:32:04 +00:00
Hannah Wolfe
585ea121a4 Merge pull request #2294 from shashankmehta/apps-config
Shifts app UI behind config option
2014-03-04 20:21:13 +00:00
Fabian Becker
cd74b0e232 Switch to bower for client assets.
fixes #2272
- Remove libraries from shared/vendor
- Remove libraries from client/assets/vendor
- Add bower to package.json and postinstall
- Add bower.json with dependencies
- Add scripts from bower_components to concat/uglify
- Fix tests
- Serve jquery from /ghost/built/theme/
2014-03-04 20:09:26 +00:00
Fabian Becker
1a9e91f120 Replace JSLint with JSHint.
closes #2277
- Added ES6 linting to core/client/
- Fix typeof array comparison
2014-03-04 15:47:39 +00:00
Johan Stenehall
825ba4fb82 Use tag as title on tag pages
closes #2328
- added check for tag in coreHelpers.meta_title and use if set
- added test for correct title on tag pages

Rewritting to tag - blogtitle based on comments from PR
2014-03-04 11:52:27 +01:00
Shashank Mehta
a92c8085c5 Shifts app UI behind config option
Closes #2287
- adds helper for checking whether to show apps UI or not
- hides app UI from settings page
2014-03-03 02:52:30 +05:30
Hannah Wolfe
ea7385abbc Merge pull request #2243 from hswolff/custom-page-templates
Custom Page Templates
2014-02-28 19:58:35 +00:00
Fabian Becker
12f8f99088 Implements the #has Block helper
closes #2115
- Added new #has block helper
- Added several tests for #has helper
2014-02-27 11:16:21 +00:00
Harry Wolff
2cb02b55e1 Custom Page Templates
fixes #1969

- creates new ./server/helpers/tempalte.js method
 which returns the correct view to use when rendering

- updates fronted controller to check if a custom page template
 exists and if so then uses that to render the static page

- adds additional class name to body_class helper when
 a custom page template is being rendered

- adds tests to address all new features
2014-02-22 21:17:02 -05:00