Commit Graph

32 Commits

Author SHA1 Message Date
Sebastian Gierlinger
35a32279d9 Clean up config (drop 'env')
closes #628
- removed .env from config.js
- ghost.config() returns correct config for NODE_ENV
- removed .env[process.env.NODE_ENV]
- updated tests
- deleted users.hbs, plugins.hbs, appearance.hbs (forgot to delete in PR #649)
2013-09-14 13:14:00 +01:00
William Dibbern
9064914829 Added redirect to get rid of /page/1/
Fixes #592

- Added *permanent* redirect to ensure `/page/1/` isn't used and that
`/` is used instead.
- Added pageUrl helper (and unit tests) to generate client side url
fragment for blog pages conforming to the above standard.
- Updated pagination helper to use new `pageUrl` theme helper.
- Added functional tests for redirects and added scaffolding for
functional frontend tests in general.
2013-09-09 18:32:44 +01:00
Sebastian Gierlinger
1da0a15be2 Remove {{nav}} helper
closes #626
- removed nav from config.js
- removed navHelper
- removed navHelper tests
- removed core/server/filters
2013-09-09 13:00:56 +02:00
Sebastian Gierlinger
d9fb23496c Clean up config (non-env based settings)
closes #625
- removed defaultLang, forceI18n and activePlugins from config
- added values to default-settings.json
- updated to use values from settings
2013-09-06 18:46:50 +01:00
Hannah Wolfe
630c03d4d4 Fixing issues with {{url}}
closes #639

Updated url helper to work
Updated tests
Changed helper.js in tests/unit to be called testUtil to avoid confusion
2013-09-06 18:23:22 +01:00
Hannah Wolfe
d1db0db073 Merge pull request #614 from ErisDS/theme-globals
Theme globals
2013-09-02 15:07:08 -07:00
Hannah Wolfe
552a25018f Absolute option for {{url}} helper
- pass absolute to {{url}} to get an absolute url rather than a relative one
2013-09-02 22:06:16 +01:00
Hannah Wolfe
599d233be9 RSS Feed Autodetection
closes #599

- {{ghost_head}} now outputs feed link tag
2013-09-02 21:57:26 +01:00
Hannah Wolfe
53063366e0 Fallbacks and defaults for {{date}} helper
closes #608

If no context is specified, falls back to using published_at
If published_at is not available, will output today's date
2013-09-02 20:58:49 +01:00
cobbspur
e43029e894 Modified body_class helper
closes #591

- body_class helper returns archive-template class on archive pages
- added to unit tests
2013-09-02 20:13:48 +01:00
Adam Howard
d90df55b75 Add post tagging functionality
closes #367
closes #368

- Adds Tag model with a many-to-many relationship with Post
- Adds Tag API to retrieve all previously used Tags (needed for suggestions)
- Allows setting and retrieval of Tags for a post through the Post's existing API endpoints.
- Hooks up the editor's tag suggestion box to the Ghost install's previously used tags
- Tidies the client code for adding tags, and encapsulates the functionality into a Backbone view
2013-08-30 16:20:22 +01:00
John O'Nolan
ce3909d6d9 Updated pagination helper with cleaner markup. 2013-08-29 16:43:47 +01:00
cobbspur
5c12c78d00 added url handlebars helper
closes #528

- adds method (isPost)to models index.js that returns true if content, content_raw, title and slug are valid properties
- adds url helper which checks context is post using  isPost method
- adds unit test to check a url is prefixed with  /
-adds unit test which checks for empty string if either of the 4 properties above are not present.
2013-08-26 23:58:35 +01:00
John O'Nolan
12d53dead6 Move pagination to class rather than ID
Pagination could conceivably be used in more than one place on a page (eg. both top and bottom). For that reason it should probably have a class rather than an ID.
2013-08-26 02:29:44 +02:00
Hannah Wolfe
da0ab62989 Merge pull request #525 from cobbspur/helpers
renamed helpers to body_class and post_class
2013-08-25 08:29:20 -07:00
cobbspur
fbe44a041c fixes missing helper
closes #521

- changes handlebars default missing helper function to log error instead of throwing error
2013-08-25 15:45:44 +01:00
cobbspur
ce0f1aae46 renamed helpers to body_class and post_class
closes #508

- changed bodyclass helper to body_class and updated unit test
- changed postclass helper to post_class and updated unit test
2013-08-25 14:49:57 +01:00
Hannah Wolfe
c63012a678 Merge pull request #524 from cobbspur/helpers
added ghost_head and ghost_foot helpers
2013-08-25 06:41:34 -07:00
cobbspur
00d36e976d added ghost_head and ghost_foot helpers
closes #382, closes #383

 - added helper called ghost_head to insert meta data with current version of ghost
 - added helper called ghost_foot to insert script tag for jquery
 - added unit test for both helpers
 - removed trailing slash from ghost.js for 'shared' path and removed from outside of loop as it is shared on front and backend
2013-08-25 14:34:35 +01:00
John O'Nolan
8ac173aa19 Rename classes applied to {{bodyclass}} to be less generic 2013-08-25 12:06:52 +02:00
Hannah Wolfe
60c7643a58 Merge pull request #438 from cgiffard/hbs-helper-author
Template Helpers: Added author hbs helper
2013-08-24 07:45:36 -07:00
Christopher Giffard
4397bcf86e Template Helpers: Added author hbs helper
Fixes #358

 - Altered post model to enable eager loading of author and
   user relationships
 - Fixed broken base model toJSON method, which prevented
   eager resolution of relationships (thanks @tgriesser)
 - Passes author information to template.
 - Added unit tests for author helper.
 - Added unit tests for findOne and findAll additions to Post Model
   which take into account the eager relationships

 Usage:
 `{{author}}` -- returns the full name of the post author
 `{{author.attribute}}` -- returns property of the current post author
 as described by the user model
2013-08-23 19:13:32 +10:00
Hannah Wolfe
98e4923077 Added bodyclass and postclass helper
closes #472

- filterable as array, output as string
- with unit tests
2013-08-22 21:01:20 +01:00
Hannah Wolfe
2d3e2f36b1 Merge pull request #493 from ErisDS/helpers
Added excerpt helper
2013-08-22 12:56:01 -07:00
cobbspur
3ac82f14a0 rename helpers paginate -> pagination, dateFormat -> date
closes #381

- renamed entries for dateFormat in helpers to date
- renamed entries for paginate in helpers  and unit tests to pagination
2013-08-22 20:42:54 +01:00
Hannah Wolfe
2afa81bc1e Added excerpt helper
closes #471

- strips HTML aggressively
- with unit tests
2013-08-22 15:51:30 +01:00
Gabor Javorszky
4e1aa2119c Removed flash, renamed file, unbroken logout / login request notifications
Closes #354
* Reintroduced the redirect functionality (not logged in, tries to go to `/settings/user/`, is sent to `/login/` with info notification, after login user is taken to `/settings/user/)
* Reintroduced the "Successfully logged out" message
* Added middleware to scrub passive notifications from `ghost.notifications` after one use basically mimicing client side passive notifications
* Removed flash from everywhere. Even from package.json.
* Renamed flashed.hbs to notifications.hbs, modified default.hbs accordingly
* Added function to parse GET variables on client side
2013-08-20 08:15:06 +01:00
Christopher Giffard
e484d9224e Themes: Added truncation to hbs content helper
Fixes #256

- Developed and linked new module, downsize, for tag-safe truncation
- Altered existing content handler to accept options for truncation
- Added tests for handler

Using truncation:

{{content words=10}}
{{content characters=256}}
2013-08-07 19:45:37 +10:00
Gabor Javorszky
b77a8fd0d9 Notifications on front end
Should close #37. There are persistent and passive notifications.

Persistent ones:
* are stored on `ghost.notifications`.
* have an api made to add / remove them with client side ajax logic (probably not the most elegant, but works)
* uses a modified `flashes.hbs` template
* will only disappear if user closes the bar
* stack

Passive
* added with backbone view / collection combo
* stack
* disappears on navigation and when user closes it
2013-07-22 14:41:27 +01:00
ErisDS
4fd9556904 Fixing up validation and tests for pagination helper where prev and next are undefined by default, rather than null. 2013-07-17 14:37:52 +01:00
cobbspur
115996b88d improves unit testing for pagination and fixes pagination partial template (removed extra </nav>)
removes console logs for error handling in testing and travis environments
2013-07-16 19:57:19 +01:00
Hannah Wolfe
30b4eb07f7 App restructure - closes #245
- This is a first pass at getting a more logical structure. The focus is on moving from admin/frontend to client/server.
- The location of the databases is highly important, this isn't expected to change again
In the future
- client/assets should probably become public/
- more stuff should be shared (helpers etc)
- cleanup some confusion around tpl and views
2013-07-11 20:23:34 +01:00