Commit Graph

256 Commits

Author SHA1 Message Date
Hannah Wolfe
658a21bcf8 Quick file type amend
- adding .jpeg spelling to allowed extensions, #705 will fix this properly
2013-09-18 02:53:08 +01:00
Hannah Wolfe
c51c7e197d Merge branch 'master' of github.com:/TryGhost/Ghost 2013-09-17 22:48:18 +01:00
Hannah Wolfe
22f7eb1a8d Merge pull request #804 from cobbspur/metahelper
Added meta title and description theme helpers
2013-09-17 14:47:59 -07:00
Hannah Wolfe
b15b8d03da Clearing out images we don't use 2013-09-17 22:28:28 +01:00
cobbspur
6a5f88ed18 Added meta title and description theme helpers
closes #795

- firstly fixes res.locals to include path again
- adds {{media_title}} and {{media_description}} theme helpers
2013-09-17 22:11:02 +01:00
Sebastian Gierlinger
60d93bd3f3 Fix for images with special chars
closes #780
- added replacing of special chars with '_'
2013-09-17 22:11:22 +02:00
Matthew Harrison-Jones
2305329041 Complete Modal Refactor
* Smoother animations
* Removed blurring in Chrome temporarily
* Centering is now done in CSS (the height is calculated in JS to work in FF and Opera)
* Modals now need close: true to be set to enable the close icon and shortcuts for closing (ESC key, background clicking)
2013-09-17 20:40:19 +01:00
Hannah Wolfe
425328b4af Standard Importer
closes #734

- use models instead of knex so that we know we get correct data
- preprocesses post_tags, adds the right tags back to the posts

TODO

- deduplicate posts (if they have the same title and slug?)
2013-09-17 18:42:06 +01:00
Hannah Wolfe
b165dd3e62 Merge pull request #787 from cgiffard/new-404-handling
Initial 404 Error Handling Support
2013-09-17 07:07:19 -07:00
John O'Nolan
14d07ef98a Restyled delete post-settings menu item 2013-09-17 13:02:20 +01:00
Christopher Giffard
48b75fa396 Initial 404 Error Handling Support
Fixes #356

- Adds new generic methods for handling errors to errorHandling.js
- Initialises generic methods as middleware
- Created error.hbs view in admin
- Error handler searches for error.hbs view file in user theme folder
  and renders it if available, otherwise lets the error fall through
  to express.

- We *could* change the final behaviour to render a default ghost
  template should the user template be missing
- Because it currently isn't possible to require(ghost) in errorHandling.js,
  it was necessary to duplicate some aspects of the ghost path init code
  inside errorhandling.js. This should be cleaned up and moved back
  into ghost.js when possible.
2013-09-17 20:56:05 +10:00
Hannah Wolfe
83e655701c Post settings menu tweaks
closes #782, #783

- delete button hidden until ID
- publish date works before publish
2013-09-17 11:51:24 +01:00
Hannah Wolfe
750c19014a Populating admin email with user signup email
closes #775
2013-09-17 03:08:36 +01:00
Hannah Wolfe
c052fe82d8 Merge pull request #749 from cobbspur/urls2 2013-09-17 02:42:28 +01:00
Hannah Wolfe
16329ac6f0 Removing i18n until it's done properly 2013-09-17 02:41:40 +01:00
cobbspur
713e4c0d5c Adds slashes to urls
ref issue #448

- adds slashes to urls, templates and tests

TODO

Add function to add slash to urls automatically
2013-09-17 02:39:55 +01:00
Hannah Wolfe
79f75865a1 Error handling for the frontend routes 2013-09-17 01:54:36 +01:00
Hannah Wolfe
de7143bc62 Refactoring Ghost middleware
closes #657, closes #761

- Got rid of initTheme from ghost.js (yay)
- Divided up the logic for static assets and views
- Ghost admin static assets are now served from /ghost/
- New logic to figure out if we're on the admin, or a theme and which theme we are on
- Activate theme method reregisters static access and uncaches views
- Re-ordered all of the middleware, and ensured we had a 404 handler at the end
- Activate theme method ensures that middleware maintains order
2013-09-17 01:49:08 +01:00
Hannah Wolfe
8c26249d46 Adding extra paths to not allow slugs for 2013-09-17 01:48:56 +01:00
John O'Nolan
0b89335339 Fix debug tools layout 2013-09-16 18:53:09 +01:00
Hannah Wolfe
e3bc0b3151 Mail documentation link is clickable
closes #760

Also updating notification template missed in issue #729
2013-09-16 18:34:20 +01:00
Hannah Wolfe
84e84b0612 Merge pull request #767 from sebgie/issue#715
Escape RSS post title
2013-09-16 06:34:11 -07:00
Hannah Wolfe
cefa0e14ef Merge pull request #764 from matthojo/Flash-Bar
Renamed the notifications container
2013-09-16 06:07:55 -07:00
Sebastian Gierlinger
141361c40e Escape RSS post title
closes #755
- added html escape for post title
- changed author for rss feed to current user
- added simple test to check rss is working
2013-09-16 13:11:53 +02:00
Hannah Wolfe
522f47a217 Logo in admin goes to blog front
closes #537
2013-09-16 10:25:45 +01:00
Hannah Wolfe
1ee0d51660 Merge pull request #730 from jgable/gruntClientFiles
Compile assets with grunt
2013-09-16 01:57:08 -07:00
Matthew Harrison-Jones
2fe7eda8e2 Renamed the notifications container
Renamed from `#flashbar` to `#notifications`
2013-09-16 09:46:29 +01:00
Hannah Wolfe
8af09e2dd1 Merge pull request #762 from ericterpstra/402-pub-date
Enabled post setting to change published date
2013-09-16 01:10:33 -07:00
ericterpstra
71c99913f6 Enabled post setting to change published date
closes #402
2013-09-15 22:19:53 -05:00
William Dibbern
4b8806ec1d Infinite Scroll Pagination for content screen
Fixes #258

- Modified post collection to have default values for paging.
- Added scroll handler to content view to check for more posts and load
as appropriate.
- Sanitized result from server-side post paging, ensure page # is
returned as an integer.
- Added a functional test stub.
2013-09-15 18:34:23 -05:00
William Dibbern
07629dd9ab Publish button amendments
Fixes #667

- Removed superfluous as-of-yet-unused options in the publish menu.
- Adjusted display names of publish buttons according to differing
states the publish menu can be in (new post, saved draft, published
post).
- Added red highlight style to "important" status change options in the
publish menu (draft => published, published => unpublished).
- Added suite of functional tests around new labels and classes.
2013-09-15 14:52:09 -05:00
Jacob Gable
63eb9581ea Compile assets with grunt
- Made a helper called ghostScriptTags that will spit out the relevant
  script tags with version parameter; 4 unminified files in development,
  1 minified file in production.
- Added grunt concat and uglify tasks to build files into core/built
- Fixed some unit tests by making them native date objects
2013-09-15 14:06:42 -05:00
Sebastian Gierlinger
8f22737f04 Make settings() 'magic'
- access value directly by using ghost.settings('key')
- removed use of <key>.value
- removed workaround for activeTheme path
2013-09-15 19:52:37 +02:00
Hannah Wolfe
117f70dcfd Merge pull request #752 from sebgie/settingsapi
Add setting filter
2013-09-15 09:53:23 -07:00
Hannah Wolfe
8d038b8bf2 One exporter to rule them all
closes #733

- Exporter will read meta data to determine the tables which are present and export all data from those tables
- Exporter figures out which version to export, rather than requiring that information
- deleted old exporters
2013-09-15 17:04:42 +01:00
Sebastian Gierlinger
bd8db968ea Add setting filter
closes #172
- added type to ghost.settings()
- added /api/settings?type=<filter>
- added availableThemes to settingsCache
- removed cachedSettingsRequestHandler
- removed /api/themes (including front end)
- changed activePlugins to type "plugin" in default-settings.json
2013-09-15 18:04:01 +02:00
Hannah Wolfe
596c1dccd2 Updating example config file
- url first, replaced with temporary URL with documentation
- mail config is a commented out example
- mail documentation link in config and mail file
- no more staging
- gruntfile updated to generate correct docs
2013-09-15 15:45:18 +01:00
Hannah Wolfe
71a92194ca Improved error messaging
closes #748

- Removed the alpha software warning
- Better error message output for the whole app - can now specify an error, a context, and a help message
- Improved invalid node version, start and stop messaging
- Listens for Ctrl+C and exits nicely
- Minor improvements to handling and errors with old DBs (temporary)
2013-09-15 13:52:58 +01:00
Hannah Wolfe
9fa659aeee Merge branch 'new-data-model' 2013-09-15 00:36:54 +01:00
Hannah Wolfe
02436645fe Migration adds fixtures on first run only
closes #731, closes #732

- fixtures are imported using the models, rather than knex
- migration treats fresh installs differently
- migration throws errors for un-initialisable databases
- small amount of extra code to deal with old DBs still using currentVersion & give them a nice error message
2013-09-15 00:22:13 +01:00
John O'Nolan
19272a03cc New post title placeholder 2013-09-14 23:18:35 +01:00
Hannah Wolfe
b902f8109c Renaming default to defaultValue as default is reserved 2013-09-14 22:39:31 +01:00
Hannah Wolfe
9fcc0a6ed6 Renamed currentVersion setting to databaseVersion to avoid confusion with software version 2013-09-14 22:13:59 +01:00
Hannah Wolfe
d968495996 Mass renaming of things
Conflicts:
	core/client/views/settings.js
	core/server/models/user.js
2013-09-14 21:56:07 +01:00
Hannah Wolfe
d587a845d4 Set migrations to use new 000 schema
issue #632

- removed old schemas
- updated base model to reflect all of the consistent behaviours and properties across the models
- updated all models to match the new schema

TODO

- no fixtures are currently loaded except settings
- need to rename properties across the codebase
2013-09-14 20:01:46 +01:00
Hannah Wolfe
72229fa8ea Adding the new schema - it doesn't do anything yet
issue #632

- shiny new 000 file contains the new much more detailed schema
2013-09-14 19:17:41 +01:00
Hannah Wolfe
70824a247f Merge branch 'migrations-003' into new-version
Conflicts:
	.gitignore
	config.example.js
	core/server/models/post.js
	package.json
2013-09-14 19:15:04 +01:00
Hannah Wolfe
0b1ffcd1f5 Updating settings types
- issue #573, issue #632
2013-09-14 19:04:41 +01:00
Hannah Wolfe
dea7ac56ac Fixing config path in email 2013-09-14 18:34:21 +01:00
Hannah Wolfe
3fab1f708a Merge pull request #728 from skattyadz/default-settings-validations
Conflicts:
	Gruntfile.js
	core/server.js
	core/server/data/default-settings.json
	core/test/unit/admin_spec.js
2013-09-14 14:37:52 +01:00
Adam Howard
3823d10c35 Restructure default-settings.json and add validations to important settings. 2013-09-14 14:29:27 +01:00
Sebastian Gierlinger
7aca800f53 Remove path from activeTheme
no issue
- obvious
2013-09-14 14:08:38 +01:00
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
Hannah Wolfe
486c2b4eea Use software version in RSS
closes #723

 Still waiting on https://github.com/dylang/node-rss/pull/16 to get this to actually output
2013-09-14 12:12:27 +01:00
Gabor Javorszky
6c99b67ab3 Added client side validation
Closes #581.

* Basically adds the client side of node validator, that we're already using
* Validator is plonked onto `Ghost.Validator`
* Usage is identical as to https://github.com/chriso/node-validator
* Has sanitizing values et al
* `Ghost.Validator.error` is redefined, it populates Ghost.Validator._errors (Array)
* `Ghost.Validator.handleErrors` is supposed to print out the multiple error messages, if there are multiple (this is broken due to how notifications are presented `.html` instead of `.append`), and also apply class to element
* The ajax calls are wrapped in an if to prevent network traffic if something's not right on client side
* Added validation to general settings and user settings screens.
* On validation error, optionally adds `.input-error` to whatever element you reference, see below (if `el` exists on the error object). This is the only place where usage is different to the original implementation. Redeclared `error()` function in `init.js`
* Usage: `Ghost.Validate.check(valueToCheck, {message: "the error message", el: $('#the element')}).isEmail()`
* The element above will receive the `.input-error` class. `isEmail()` is one of the stuff you can check against.
2013-09-14 10:52:27 +01:00
Hannah Wolfe
486b2406b1 Merge pull request #722 from ericterpstra/370-post-settings-permalink
Added post-settings menu with edit permalink field
2013-09-13 14:31:49 -07:00
Hannah Wolfe
420986de62 Updating tag saving logic to never save duplicates 2013-09-13 21:38:53 +01:00
ericterpstra
e2bc5257a6 Added post-settings menu with edit permalink field
closes #370
- Added new Backbone view for post settings menu
- Moved sass styles to global.scss for post settings menu items
- Added field to change post slug (permalink) using existing slug
  validation
2013-09-13 12:36:38 -05:00
Hannah Wolfe
01f6551bf2 Small model update for tags and users
- tags are now created with uuid & timestamps
- user role is no longer a model, just a join done with attach
2013-09-13 15:06:17 +01:00
Adam Howard
f6b86a98ff Fix bug preventing tags from being saved when a Post is created.
Fixes #658
2013-09-13 14:30:22 +01:00
Hannah Wolfe
8c9bcf661f Merge pull request #707 from sebgie/stable-db-version
Remove path from activeTheme
2013-09-12 07:40:37 -07:00
Sebastian Gierlinger
212521712d 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-12 15:25:58 +01:00
Hannah Wolfe
cc785cc981 Merge pull request #686 from matthojo/Sign-up-screen-UI
Improved Auth screen markup and validation checks
2013-09-12 06:25:27 -07:00
Hannah Wolfe
4cd9f79116 Merge pull request #703 from matthojo/Dashboard-Removal
Temporarily removed the Dashboard and all references
2013-09-12 06:19:59 -07:00
Matthew Harrison-Jones
2678de902d Improved Auth screen markup and validation checks
* Signup now focuses on 'name' on load
* Fixed fade in on auth forms to work with `display: table`
* The 'name' field is required on Sign up forms
* The length check on the Signup form is in order of inputs
* Added check for password length
* Changed the auth form class names to better represent individual pages
* Updated CasperJS tests
2013-09-12 09:59:58 +01:00
Sebastian Gierlinger
8d16b20c49 Remove path from activeTheme
no issue
- obvious
2013-09-11 19:51:56 +02:00
Matthew Harrison-Jones
a85e8e1efc Temporarily removed the Dashboard and all references
This also updates the CasperJS to match the new changes.
2013-09-11 15:38:09 +01:00
jamesbloomer
3e28803672 Ensure image uploads do not overwrite if they have the same name
closes #619
- check if uploaded image name exists in month/year path
- if unique then save
- if not unique then add -1 to the end of the name eg. image-1.jpg
- if image-1.jpg exists then increment to -2
- keep going until a unique name is found
- uses tail recursion as normal path will be to save the first filename and deep recursion will be the exception
- (the alternative of loading the names of all the files in the directory could result in a large in memory array)
2013-09-10 22:02:28 +01:00
Hannah Wolfe
687d7ed72d Changing icon setting to cover in defaults
issue #571

- forgot to do this
2013-09-10 20:05:35 +01:00
Matthew Harrison-Jones
2280276fdd Removed unused user menu items and linked "Help / Support" to the right place
Also updated CasperJS tests to support changes
2013-09-10 15:05:42 +01:00
Matthew Harrison-Jones
84c2767da6 Temporarily remove unused Post Menu options 2013-09-10 13:53:01 +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
Hannah Wolfe
0b3f2797e9 Fix for file upload paths on Windows
closes #669

- override incorrect path separators with / in the src for an image.
2013-09-09 17:19:58 +01:00
Hannah Wolfe
bbbfed9921 Temporary aliasing on the User model
issue #389

- Output only aliases (saving data with these keys won't work) gives us the right names in the theme API
2013-09-09 15:25:20 +01:00
Hannah Wolfe
add7136bd6 Merge pull request #660 from sebgie/issue#626
Remove {{nav}} helper
2013-09-09 06:11:06 -07:00
Hannah Wolfe
d01a4c4662 Merge pull request #665 from JohnONolan/ie
Remove detection for IE7 and lower
2013-09-09 04:36:40 -07:00
John O'Nolan
42a011d6a9 Introducing chromeframe, correcting content type meta tag. 2013-09-09 13:03:36 +02: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
John O'Nolan
935afbf873 Remove detection for IE7 and lower 2013-09-09 12:58:48 +02:00
Hannah Wolfe
946544996c Updating forgotten password email template
closes #288

- added sign off using url from config
2013-09-09 11:51:12 +01:00
Hannah Wolfe
3f51d51e47 Merge pull request #656 from JohnONolan/signup-screen
Signup screen
2013-09-09 01:59:32 -07:00
Hannah Wolfe
4307f48084 Merge pull request #655 from cobbspur/userprofile
User Profile Image Upload
2013-09-09 00:59:57 -07:00
John O'Nolan
229597d341 Input signup name into user profile 2013-09-08 21:16:40 +02:00
cobbspur
9ce0e9f4a0 User Profile Image Upload
closes #280

- adds image uploader to user profile page.
- click on cover picture or change cover button to open file upload modal.
- created new upload modal that extends model to reduce some code duplication
2013-09-08 17:19:57 +01:00
John O'Nolan
4b40bb5aab Center login form with CSS instead of JS 2013-09-08 17:12:25 +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
Sebastian Gierlinger
27ba9289d6 Add setting for posts per page
closes #593
- added default setting of 6 posts per page
- added posts per page to settings page
- added limit to frontend.js (setting does not change API behavior)
2013-09-05 14:56:09 +02:00
Hannah Wolfe
5bae29a0db Merge branch 'master' into migrations-003
Conflicts:
	core/server/data/migration/index.js
	core/server/models/post.js
2013-09-05 12:40:43 +01:00
Hannah Wolfe
ddcc7b78b6 Removing api calls from server side
closes #603, issue #395

- Changed hard-coded 'JOE BLOGGS' to use author data
- We still had api calls loading data server side before rendering pages.. which is unnecessary.
- Only thing using this was editor title, which is now populated client side
- May improve content screen load time.
2013-09-04 21:51:54 +01:00
Hannah Wolfe
c469d05c46 Mail settings are per environment
closes #624

- example mail setting in development config
- updated mail module & tests
2013-09-04 16:15:21 +01:00
Hannah Wolfe
21487aa802 Email errors & cleanup
closes #618

- don't send a welcome email. This appeared to be breaking tests.
- make sure we handle errors from sending emails properly
- use promises when adding notifications
2013-09-04 15:04:25 +01:00
Adam Howard
e24b5c3382 Proper settings infrastructure, allowing new features without compromising old data.
On server load, check for settings which have not been set, and apply a default value to the settings table from a JSON file.
2013-09-03 22:56:34 +01:00
Hannah Wolfe
36874badd5 Merge pull request #587 from javorszky/iss288
Email sending with Sendgrid plus password reset
2013-09-02 15:44:48 -07: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
1ff9550e1f User property aliases
issue #389

 - Temporary aliases for user model, schema will be changed soon, in the meantime we want themes to be built using the right properties
2013-09-02 20:58:49 +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