TryGhost/Ghost — pull request #1839 by hswolff (2014-01-04 04:35:53+00:00)
Title: New Post UX behaviour.

This was based off @halfdan's existing work.

I mostly spruced it up into PR-ready status.

One note re: an item in #1351 - as @halfdan mentioned the database currently disallows a post's slug column to be nullable. Rather than create a whole migration (and I don't even think we have the ability for column migrations at this point) I kept the existing behavior, of creating a post's slug if it doesn't exist when the post is created in the db.

@JohnONolan could you take a look to see if this looks good to you? Let me know if any changes are desired.

refs #1351
- Make generateSlug a static method on base model
- Change UI behavior to update placeholder
when a post has not yet been saved to the backend
- Add new getSlug API method
- prevent saving a new post’s slug/date/static status
before the post exists in the backend