Tribo icon indicating copy to clipboard operation
Tribo copied to clipboard

Implement drafts and allow the use of time in publish dates.

Open Tanner opened this issue 12 years ago • 1 comments

This pull request adds a drafts feature and allows the use of times, e.g. 11:53 PM EST, in publish dates.

Presentation

When any new post is created, it is a draft.

A post represents whether it is a draft or not in the posts table view. Posts now have a "draft" string in the location where the published date would be: screen shot 2013-09-05 at 8 54 10 am

A draft will only show up in local previews and will not be included in the generated site during publishing.

You can switch a post between draft/published by using the contextual menu for the post:

For a published post... screen shot 2013-09-05 at 8 54 19 am

And for a draft… screen shot 2013-09-05 at 8 54 15 am

Hurrah!

Technical Stuff

The implementation stuck to "Method B" in the discussion for #16.

A metadata class was added so that we can manage whatever metadata goes along with a post. This data must be written to the metadata file when changed, otherwise it will not be saved.

There were no major changes per-say. Some of the changes were cleaning up the code so I could modify it (and grasp it).

Problem

There is one problem with this pull request, albeit a small one. When you resize the window while viewing the posts view, it is possible for the title and date labels to collide. screen shot 2013-09-05 at 8 54 24 am

Not a huge issue, but I imagine it could be solved with some auto layout voodoo (Xcode 5?).

Tanner avatar Sep 05 '13 12:09 Tanner

I really appreciate all the work here, Tanner. The feature looks like a huge improvement, and it will allow many more rich additions (tags have been on my mental list for a while now!).

Before I merge it, however, I'd like to see the coding style match up with the project as a whole. That means that all the extra newlines that you added should be removed (I like whitespace, but not that much whitespace), and the public -init methods should be switched to factory methods. I favor factory methods as they reduce typing (no need to type an -alloc call every time), and there is really no downside.

I apologize for being a stickler about this, but this is part of open-source projects. If we can't keep a common, consistent coding style, then the code will just get progressively messier until no one can understand all of it. Thanks again for all your hard work.

CarterA avatar Sep 05 '13 16:09 CarterA