Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/12267 draft publish action #12273

Merged
merged 4 commits into from Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
@@ -1,5 +1,6 @@
13.1
-----
* Adds a Publish Now action to posts in the posts list.

13.0
-----
Expand Down
9 changes: 7 additions & 2 deletions WordPress/Classes/ViewRelated/Post/PostActionSheet.swift
Expand Up @@ -25,13 +25,17 @@ class PostActionSheet {
}
}

if post.status == .publish || post.status == .draft {
if post.status == .publish {
actionSheetController.addDefaultActionWithTitle(Titles.stats) { [weak self] _ in
self?.interactivePostViewDelegate?.stats(for: post)
}
}

if post.status != .draft {
if post.status == .draft {
actionSheetController.addDefaultActionWithTitle(Titles.publish) { [weak self] _ in
self?.interactivePostViewDelegate?.publish(post)
}
} else {
actionSheetController.addDefaultActionWithTitle(Titles.draft) { [weak self] _ in
self?.interactivePostViewDelegate?.draft(post)
}
Expand All @@ -54,6 +58,7 @@ class PostActionSheet {
struct Titles {
static let cancel = NSLocalizedString("Cancel", comment: "Dismiss the post action sheet")
static let stats = NSLocalizedString("Stats", comment: "Label for post stats option. Tapping displays statistics for a post.")
static let publish = NSLocalizedString("Publish Now", comment: "Label for an option that moves a publishes a post immediately")
static let draft = NSLocalizedString("Move to Draft", comment: "Label for an option that moves a post to the draft folder")
static let delete = NSLocalizedString("Delete Permanently", comment: "Label for the delete post option. Tapping permanently deletes a post.")
static let trash = NSLocalizedString("Move to Trash", comment: "Label for a option that moves a post to the trash folder")
Expand Down