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

1325 commits

Author SHA1 Message Date
Hannah Wolfe
eaee9369e8 Don't pass external urls through createUrl
refs #4852, refs #4862, refs #4541

- fixes urlFor for the combination of an external url and a blog using a subdirectory
2015-02-12 23:09:12 +00:00
Paul Adam Davis
68eb6b67b0 Drag & Drop Navigation Reordering
Closes #4540

- Implements drag & drop to reorder navigation items
- Adds a `sort` property to navigation items
- Adds a tiny library to enable touch events for drag & drop. It hooks onto jQuery UI.
- Sort nav items before being saved
- Adds `settings-view-navigation` to route for body class
2015-02-12 17:02:46 +00:00
Felix Rieseberg
762a47b6bf Add Post Image to RSS Feed
Closes #4888

- If a post cover image exists, it is added to the `description` tag
(at the very front). This allows RSS readers to pic up the picture.
2015-02-10 14:04:59 -08:00
Hannah Wolfe
a110b3741f Merge pull request #4862 from nsfmc/urlmod
Update `urlFor` to handle 'nav' contexts
2015-02-07 21:15:48 +00:00
rmfx
19ea1824a1 Remove duplicate 'an'
Remove the second 'an' on line 264.
2015-02-06 20:30:35 +00:00
Jason Williams
921f7dab5b Fix error in generating absolute URLs for RSS
Closes #4886
2015-02-03 21:10:06 +00:00
Marcos Ojeda
6f457768a2 Update urlFor to handle 'nav' contexts
needed for #4852
Before this, calling `{{url}}` with a nav context from #4541 would
output `/`. This adds a check in `urlFor` that looks for keys in a
nav context object, namely `slug`, `current`, `label`, & `url`.

This change allows for a url to pass through if used in a nav context.

* adds `schema.isNav()`
* adds tests to `url_spec.js`
* handles absolute urls correctly even if `absolute=true`
2015-01-31 09:29:53 -08:00
Hannah Wolfe
4eee52d142 Add cache invalidation header when updating tags
no issue
2015-01-27 23:44:31 +00:00
Hannah Wolfe
54c7d23b26 Merge pull request #4841 from jaswilli/frontend-match
Use path-match to match routes instead of Router
2015-01-26 21:28:35 +00:00
Andrew Chilton
7f9d10a62d Assign a higher priority to featured posts in the sitemap
Closes #4792
- Made priority be 0.8 (as it currently is) for standard posts
- Made featured posts have a priority of 0.9
- Split the current test into two to check both above scenarios
2015-01-24 21:19:14 +13:00
Hannah Wolfe
3c86f67fca Merge pull request #4831 from jaswilli/edit-user
Fix up users API so admin role can edit owner
2015-01-23 22:55:08 +01:00
Jason Williams
b06d2a619d Use path-match to match routes instead of Router
No Issue
- Use path-match instead of hacking up the Express.Router internals.
2015-01-22 19:21:47 +00:00
Jason Williams
786ec6be28 Format database-related error responses
Closes #4735
- Shows error message on client instead of "[object Object]".
- Server log shows error message instead of uknown error.
2015-01-21 18:09:09 +00:00
Jason Williams
0fc152b2ad Fix up users API so admin role can edit owner
No Issue.
- Make sure that a user with the Admin role can edit the Owner.
- Add test for behavior.
2015-01-20 21:34:24 +00:00
Jason Williams
7578d674ae Fixup finding user by role name
No Issue.
- Build up query object to lookup a user by the name of a role.  Return
  user with "roles" objects included.
- Add test for findOne by role.
2015-01-20 18:31:17 +00:00
Jason Williams
d5d7919d26 Assume datetime in import filename is UTC
No issue.
- Add missing catch handlers to async tests.
2015-01-18 21:20:51 +00:00
Mark Stosberg
770317b834 Refactor: Make checkSSL unit-testable and add unit tests for it.
- Code was moved to core/server/middleware/middleware.js, which is the
  home for unit-testable middleware.

- Functional code coverage for this code also exists at:
  test/functional/routes/admin_test.js
2015-01-18 13:44:50 -05:00
Josh Vanderwillik
094d6dfc38 Make HTTPS compatible with a Ghost module
closes #4434
- Change an incorrect redirect
2015-01-17 21:23:31 -05:00
Jason Williams
1c07273f5a Update grunt-jscs dependency
No Issue
- grunt-jscs@1.2.0
- Clean up some instances of multiple spaces.
- Remove jscs:disable for regexes now that jscs better supports them.
2015-01-16 18:06:20 +00:00
Jason Williams
aee472eb65 Check all users when generating slug
No Issue
- Set 'status: all` when calling generateSlug from the user model
  so that all user slugs are checked for duplicates instead of
  only active users.
2015-01-16 06:56:53 +00:00
Matt Enlow
3982e0f871 Merge pull request #4804 from jaswilli/issue-4539
Connect Navigation page to live data
2015-01-14 15:45:04 -07:00
Jason Williams
a007ae1442 Connect Navigation page to live data
Closes #4539
2015-01-14 21:24:08 +00:00
Sebastian Gierlinger
023a37b074 Merge pull request #4772 from ekulabuhov/4262_NextPrevPostWIP
[API] Retrieve next and previous post
2015-01-14 10:32:07 +01:00
Eugene Kulabuhov
0e2709c42f [API] Retrieve next and previous post
closes #4262
- implementation based on #1545
- added integration test. Modified mocked posts because code requires published_at timestamps to be different.
- fixed 2 broken tests that depended on mocked posts to have "new Date()" as their timestamps
- added checks to only query db if next/previous post requested
2015-01-13 12:49:16 +00:00
Hannah Wolfe
0cb3483bc0 Merge pull request #4694 from PaulAdamDavis/navigation-ember
Navigation UI Ember Integration
2015-01-13 09:31:32 +00:00
Paul Adam Davis
6cc5a58b68 Navigation UI Ember Integration
Closes #4537

- Adds Navigation to the Settings menu
- Adds a `navigationUI` config flag (redirects if not an editor or author)
2015-01-11 20:04:01 +00:00
Jason Williams
be462d8d94 Merge pull request #4781 from ErisDS/has-tag-fix
Fix has helper tag matching
2015-01-11 13:01:55 -06:00
Hannah Wolfe
3f34162fd9 Fix has helper tag matching
fixes #4780
2015-01-09 21:52:23 +00:00
Hannah Wolfe
283deb2461 Fix email sending fail when blog title has a comma
no issue

- We send emails from Blog Title <ghost@blog-url.com>, but it should be from "Blog Title" <ghost@blog-url.com>
- It worked fine without quotes unless you have a comma in your Blog Title in which case different mail systems get confused in different ways
2015-01-09 21:34:24 +00:00
Jason Williams
7501b4478d Merge pull request #4692 from ErisDS/markdown-importer
Add markdown file handler to importer
2015-01-09 14:44:46 -06:00
Hannah Wolfe
fbdabce086 Add markdown file handler to importer
closes #4691

- adds a file handler for markdown file (.md and .markdown)
- handles titles and featured images
- gets status, date, and slug from the filename
- has a test suite
2015-01-09 20:04:56 +00:00
Jeremiah Hoyet
bbe3ceb025 Fixed issue where Gravatars with rating higher than G would cause a 404 error.
closes #4770
- Check for Gravatar now allows the highest rating for images
- Defaults to silhouette in the event a user deletes their Gravatar
- Allows highest rating for Gravatars (x), since Ghost should have no opinion on image ratings.
2015-01-08 19:34:28 -05:00
Hannah Wolfe
1f22d8c28c Move tag management from behind config/labs flags
issue #4248

- tag management is ready for release, this takes the training wheels off :)
- remove config flag
- remove labs checkbox and related code
2015-01-06 18:56:42 +00:00
Jason Williams
7f753acff1 Merge pull request #4752 from ErisDS/importer-updates
Image Importer Improvements
2015-01-05 10:39:35 -06:00
Jason Williams
05877124ae Remove unneeded promises and fix tests 2015-01-04 21:05:31 +00:00
Jason Williams
7c7dbb911c Merge pull request #4750 from ErisDS/labs-thing
Labs page checkboxes
2015-01-04 13:44:47 -06:00
Hannah Wolfe
3310dba9ea Merge pull request #4738 from jaswilli/socket-perms
Allow socket permissions to be set from config
2015-01-03 19:41:27 +00:00
Hannah Wolfe
add4c6b078 Image Importer Improvements
ref #4608, #4609, #4690

- fix errors with cleaning up files
- improve handling of base directories, and introduce a simple valid format for zips (must contain importable files or folders, and may contain up to one base directory)
- vastly improve test coverage
2015-01-02 22:54:40 +00:00
Paul Adam Davis
cc6f698053 Start of labs
issue #4409
2015-01-02 15:58:36 +00:00
Jason Friedrich
bc74c89e76 Update excerpt helper to properly filter HTML footnotes
closes #4741
- updated regexp to properly filter out footnotes without removing too much text
- happened only when a link was used before a footnote
- old regexp was too 'greedy' and removed regular link together with the footnote
- new regexp uses a more specific <a> tag
2015-01-01 06:45:06 +01:00
Jason Williams
6c1287c3a2 Allow socket permissions to be set from config
Closes #4478
2014-12-31 15:28:04 +00:00
Jason Williams
0dc0d37888 Change url and image into synchronous helpers
Closes #3961
2014-12-29 18:44:15 +00:00
Jason Williams
f6736049c3 Fix up HTTP API handler
No Issue
- Add Location header for tags.
- Ensure Location header has trailing slash.
- Remove unnecessary promises/async.
2014-12-28 05:27:29 +00:00
Jason Williams
d59f873aec Update dependencies
No Issue
- bluebird@2.4.2
- body-parser@1.10.0
- busboy@0.2.9
- connect-slashes@1.3.0 (remove base path option which is no
  longer needed)
- fs-extra@0.13.0
- glob@0.4.2
- passport@0.2.1
- passport-oauth2-client-password@0.1.2
- grunt-jscs@1.1.0
2014-12-25 00:22:45 +00:00
Jason Williams
2c66430dba Merge pull request #4690 from ErisDS/image-importer
Add support for importing images
2014-12-24 17:08:13 -06:00
Hannah Wolfe
a54b5c4af1 Merge pull request #4698 from jaswilli/tag-dup-slugs
Run tag add operations in sequence
2014-12-22 10:00:05 +00:00
Hannah Wolfe
7f4539e67e Merge pull request #4693 from cobbspur/metatags
Updated meta helpers to use tag meta data if present
2014-12-22 09:56:11 +00:00
Jason Williams
633cf1385a Run tag add operations in sequence
Closes #4697
- Run tag add operations in sequence instead of in parallel
  since generateSlug will hand out duplicate slugs until one of
  them is committed to the database.
- Add test.
- Misc cleanup of method parameter names and jshint hints.
2014-12-22 00:41:10 +00:00
cobbspur
32059812a9 Updated meta helpers to use tag meta data if present
No issue

- Tag Meta title and description override default response
- Tag Meta title present on all pages
- Tag Meta description available only on first page
 - Updates tests
2014-12-21 11:39:49 +00:00
Hannah Wolfe
ba3d4b3689 Add support for importing images
closes #4608, #4609

- image handler loads in any image files & figures out where they'll get stored
- image importer has a preprocessor which replaces image paths in
  pertinent spots of post, tag and user models
- image importer stores images, keeping the path where it makes sense
- basic test for the preprocessor
2014-12-21 01:58:35 +00:00
Jason Williams
591fa349aa Finish up post count support in tags API
Refs #4521
- Handle 'include' query param in tags API.
- Add post_count support when fetching a tag with findOne.
- Remove post_count from options.include after processing.
- Extra database query no longer used to fetch post_count.
2014-12-19 21:46:34 +00:00
Hannah Wolfe
6af0b83b7c Merge pull request #4670 from jaswilli/model-opt
Optimize model class methods
2014-12-19 21:19:01 +00:00
Hannah Wolfe
e6227e7a24 Merge pull request #4674 from delgermurun/post-sort
Add 'id' to post sort fields. So there is no longer equally sorted posts.
2014-12-19 21:05:45 +00:00
Jason Williams
5c6d45f258 Optimize model class methods
No Issue
- Reorder promise chains to defer database queries until they
  are needed.
- Execute database queries that are not dependent on each other in
  parallel instead of sequentially.
- Reduce the number of variables used to hold state across multiple
  promise blocks.
- Do not go async unless necessary.
2014-12-19 00:54:22 +00:00
Hannah Wolfe
8ceb896e96 Merge pull request #4654 from ekulabuhov/4521_TagPostCount
[API] Return post count for each tag
2014-12-19 00:17:36 +00:00
Eugene Kulabuhov
539accf69f [API] Return post count for each tag
closes #4521
- if '?include=post_count' present, query db for tag/post_count information
  and append it to returned JSON
- fixed linter errors
- added integration test
- parsing to int as knex (or PostGres driver) is returning bigint as strings
- iterating through a smaller collection to avoid exception
2014-12-18 23:54:18 +00:00
Hannah Wolfe
3c9273ed37 Data importer improvements and fixes
refs #4605, #4479

- Removes versioning from the importer
- Fixes an issue with SQLITE errors not being thrown properly for posts
- Ensures that posts have a created_at date
- Makes sure that the API wrapper is properly handled
2014-12-18 19:50:53 +00:00
Jason Williams
68df133d65 Merge pull request #4646 from ErisDS/importer-refactor
Refactor importer with tests
2014-12-18 13:24:11 -06:00
Hannah Wolfe
1b37ba5753 Merge pull request #4676 from jaswilli/pg-update
Update pg package and convert data to correct type
2014-12-18 16:50:01 +00:00
Jason Williams
3ad68526cb Update pg package and convert data to correct type
No Issue
- Switch 'pg.js' package for 'pg' as the native bindings are
  now an optional add-on to pg and pg.js has been deprecated.
- pg@4.1.1
- Set the driver's parser to automatically convert integer data
  returned from postgres into a javascript integer.
2014-12-18 14:58:20 +00:00
Delgermurun
afdb3a948d Add 'id' to post sort fields. So there is no longer equally sorted posts.
closes #4648
- Add id to order by fields on posts API
- Order by id on posts controller
2014-12-18 11:34:26 +08:00
Hannah Wolfe
20710b9eba Refactor importer with tests
refs #4605

- Move as much code as possible out of the DB API
- Split the importer into 2 concepts, code which handles different
  filetypes and code which takes the content of files and imports it into
  Ghost in some way
- Split the import process into 4 steps, load the file into a useful
  format, preprocess the data, do the import, generate a report
- Reporting is currently a no-op
- Adds a basic level of testing
2014-12-17 18:22:39 +00:00
cobbspur
cbcda2faf8 Provide absolute blog url in sitemap
No issue

- Adds {{blog-url}} to sitemap.xsl
- Replaces all occurences of {{blog-url}} with absolute bkog url
2014-12-17 14:55:27 +00:00
cobbspur
7d79016af5 stop middleware converting favicon to string
closes #4658

- adds conditional to prevent favicon being processed as a string
2014-12-16 20:22:31 +00:00
Hannah Wolfe
a0db21d3ec Merge pull request #4629 from cobbspur/postpreview
Add view post link on published and updated posts
2014-12-15 13:28:47 +00:00
cobbspur
53d12a9659 Add view post link on published and updated posts
closes #1756

- adds a post url link to 'post updated' and 'post published' in editor
- adds join function in ghost paths
- adds a '/' detection to makeRoute method
- adds test for join function
2014-12-15 12:18:47 +00:00
Hannah Wolfe
9bb3be49d5 Merge pull request #4636 from cobbspur/sitemap
Fixes sitemap image errors
2014-12-14 23:27:04 +00:00
cobbspur
4ca87f6336 Fixes sitemap image errors
closes #4591

- switches to using author cover image
- adds a protocol of http if using a protocol relative url
2014-12-14 23:03:40 +00:00
cobbspur
9a0dc0be58 Adds complete url for Sitemap in robots.txt
closes #4589

- Adds {{blog-url}} to robots.txt
- Replaces {{blog-url}} with blog.url from config
2014-12-13 18:01:28 +00:00
Hannah Wolfe
35ee121761 Merge pull request #4628 from sebgie/issue#4624
Password change MU
2014-12-12 10:07:34 +00:00
Sebastian Gierlinger
40c78493a3 Password change MU
closes #4624
- added user_id to password reset request
- hide old password field
- updated changePassword method to check permissions
- updated changePassword method to work without oldPassword
- fixed bug for errors shown as [Object object]
2014-12-11 21:23:07 +01:00
Sebastian Gierlinger
f531ef19f8 Merge pull request #4626 from ErisDS/issue-4607
Add support for zip import
2014-12-11 20:52:04 +01:00
Sebastian Gierlinger
1626a8f292 Merge pull request #4529 from cobbspur/permalink
Return computed url with post object
2014-12-11 10:30:41 +01:00
Hannah Wolfe
6ff51ad44e Add support for zip import
fixes #4607

- moves file checks from db and upload API endpoints to api utils
- adds code to accept and then extract a zip and pull out a JSON file
- zip handling requires a lot of dependencies - this needs a good refactor
2014-12-10 20:21:06 +00:00
cobbspur
cd5d87ddf2 Return computed url with post object
closes #4445

- post model gets permalink format
- post model queries urlPathForPost to return computed url
- url helper modified to use post url
- urlForPost method abolished and replaced where necessary
- updated tests
2014-12-10 17:23:02 +00:00
Jacob Gable
ef16c67a15 Sort newest to oldest in sitemap files
Closes #4611

Refactored generateXmlFromNodes to pull the urlElements itself from
sorted values in the lookup

Added some checks to existing unit tests to validate ordering.
2014-12-09 12:41:31 -08:00
Hannah Wolfe
2ef77d69de Sitemaps correctly filter draft posts
fixes #4612

- adds missing line of code to remove draft posts
- adds tests to check drafts aren't added
2014-12-09 17:27:12 +00:00
Paul Adam Davis
4e6c867183 Change sitemap root location
Closes #4590

- Removes `-index` from the root sitemap
- Removes redirects (which send sitemap.xml to sitemap-index.xml)
- Adjust tests
2014-12-07 11:59:43 +00:00
Sebastian Gierlinger
658dea9e6b Merge pull request #4580 from ErisDS/footnote-excerpt
Strip footnotes from excerpts
2014-12-04 17:24:56 +01:00
Hannah Wolfe
591d653b36 Strip footnotes from excerpts
fixes #4572

- Remove both inline and bottom footnotes from excerpt output before stripping the remaining HTML
- No more red errors, black text or bold links in codemirror, as codemirror gets confused by footnote syntax. This is a step towards the new editor which has no syntax highlighting in the editor
2014-12-04 15:28:30 +00:00
Jason Williams
de20f3af2a Match labels with element ids.
Refs #4578
- Match label "for" attributes with ids from the inputs they're
  labeling.
- Remove extra promise generation from ghost header and footer helpers.
2014-12-04 15:21:27 +00:00
Sebastian Gierlinger
32959b2269 Merge pull request #4578 from ErisDS/pr-3489
Code Injection PR 3489 rebased and updated
2014-12-04 15:16:37 +01:00
Sebastian Gierlinger
0b2541b19f Merge pull request #4575 from ErisDS/highlight
Adds markdown highlight support
2014-12-04 15:00:01 +01:00
Hannah Wolfe
9783f16e76 Adds markdown highlight support
closes #4574

- adds highlight showdown extension with tests
2014-12-04 13:37:29 +00:00
Hannah Wolfe
904918d5cc Code Injection - adds perms, shortcuts, icon, flag
refs #1993

- adds ctrl/cmd+s for save
- adds config flag
- adds icon on settings page, puts items in the right order
- sorts out permissions for all settings pages with consistent configuration
2014-12-04 13:34:44 +00:00
Hannah Wolfe
818085f18c Add XSL for Sitemaps
fixes #4555

- There's no easy way to declare an XSL with the node xml module, so I
  needed to move the declarations to both be strings
- Ideally the code to serve the XSL would also be inside the sitemap
  module, but I think we need to refactor a bit to get there easily
- Added the XSL from #4559, with minor amends to make the tables and urls
  display correctly
2014-12-04 09:38:09 +00:00
Sebastian Gierlinger
319887c77b Merge pull request #4573 from ErisDS/limit-all-sitemaps
Add limit=all consistently to users, posts & tags
2014-12-04 09:45:33 +01:00
Stefan Baumgartner
60effc1b51 adds code injection admin frontend implementation, handlebar helpers + settings
escaping handlebars
2014-12-04 04:16:08 +00:00
Jason Williams
5f9620cde0 Merge pull request #4567 from cobbspur/imagesubdir
Fix image helper for subdirectories
2014-12-03 14:39:52 -06:00
cobbspur
5f07f5503e Fix image helper for subdirectories
closes #4566

- Url created within urlFor with image context rather than calling createUrl function
2014-12-03 20:19:22 +00:00
Hannah Wolfe
9b146e59bb Add limit=all consistently to users, posts & tags
refs #623, #4348

- this fixes sitemaps to list all posts, pages, tags and users
- makes the API behave consistently across all paginated resources
2014-12-03 18:46:26 +00:00
Hannah Wolfe
13757041d9 Merge pull request #4270 from mispy/footnotes2
Footnotes extension for Showdown
2014-12-03 13:38:47 +00:00
Sebastian Gierlinger
9b8141bb08 Merge pull request #4530 from ErisDS/issue-4498
API - no more m-2-m relation ids by default
2014-12-02 20:49:47 +01:00
Hannah Wolfe
4cb909542a API - no more m-2-m relation ids by default
closes #4498

- remove toJSON code which returns only IDs from objects
- don't auto-include tags & fields in post responses
- don't auto-include roles in user responses
- fix #allthethings that made assumptions about the auto-includes, or otherwise were only working because of the auto-include
2014-12-02 19:24:44 +00:00
Hannah Wolfe
89905a8e3c Merge pull request #4560 from cobbspur/labs
Move ugly debug to Settings  Labs
2014-12-02 10:34:17 +00:00
cobbspur
edfa74f349 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
2014-12-01 19:19:08 +00:00
Hannah Wolfe
c06e649ab1 Merge pull request #4554 from sebgie/issue#3872
URL safe base64 encoding
2014-12-01 16:56:14 +00:00
Sebastian Gierlinger
9ddabffa10 URL safe base64 encoding
closes #3872
- updated base64 escaping to respect + and \
- updated base64 escaping to remove = during transport
- updated tests
2014-12-01 16:59:49 +01:00
Hannah Wolfe
aa44743c67 Merge pull request #4531 from Gargol/issue-4485
Cleans up HTML data attributes on body in default.hbs
2014-12-01 10:54:19 +00:00
Hannah Wolfe
d2d9e4aea2 Merge pull request #4348 from jgable/sitemaps
Generate sitemap.xml
2014-12-01 09:28:14 +00:00