Skip to content

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

Open
Tanner wants to merge 30 commits intoCarterA:masterfrom
Tanner:drafts
Open

Implement drafts and allow the use of time in publish dates.#39
Tanner wants to merge 30 commits intoCarterA:masterfrom
Tanner:drafts

Conversation

@Tanner
Copy link

@Tanner Tanner commented Sep 5, 2013

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 added 26 commits August 27, 2013 11:11
Makes the code a more readable.

Made the factory methods, e.g.
+ (instancetype)TBPageWithURL..
into init methods, e.g.
- (instancetype)initWithURL...

No functional changes.
Site doesn't manage this anymore, only manages posts.
Posts are now created in root/Posts/slug/ directory.

The metadata file is created in the same directory.
The method now takes in the post's directory, e.g. root/Post/slug/.
Having two instances of each label in IB was making things hard to do as
far as aligning text. Everything still works the same though.
Changes process and write post methods to include a parameter on whether
or not to include drafts.
The placeholder text for content was not being set a color.
Changes the date to be the correct color blue (as used previously).
Drafts are now gray instead of red.
Set the state rather than changing the menu item.
I realized that "TB" is the class prefix for "Tribo".
@CarterA
Copy link
Owner

CarterA commented Sep 5, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants