From f1445b9c24b286a9f74a2fead655ab5c169bc74b Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 22 Oct 2016 10:03:38 +0200 Subject: [PATCH] client/posts: add post merging --- client/css/post-detail-view.styl | 33 +++++ .../{post-view.styl => post-main-view.styl} | 0 client/html/post_detail.tpl | 12 ++ client/html/post_edit_sidebar.tpl | 5 +- client/html/{post.tpl => post_main.tpl} | 0 client/html/post_merge.tpl | 23 ++++ client/html/post_merge_side.tpl | 48 +++++++ client/js/controllers/base_post_controller.js | 20 +++ .../js/controllers/post_detail_controller.js | 86 ++++++++++++ ..._controller.js => post_main_controller.js} | 37 +++-- .../js/controls/post_edit_sidebar_control.js | 19 +++ client/js/main.js | 3 +- client/js/models/post.js | 25 ++++ client/js/views/post_detail_view.js | 80 +++++++++++ .../views/{post_view.js => post_main_view.js} | 6 +- client/js/views/post_merge_view.js | 129 ++++++++++++++++++ 16 files changed, 502 insertions(+), 24 deletions(-) create mode 100644 client/css/post-detail-view.styl rename client/css/{post-view.styl => post-main-view.styl} (100%) create mode 100644 client/html/post_detail.tpl rename client/html/{post.tpl => post_main.tpl} (100%) create mode 100644 client/html/post_merge.tpl create mode 100644 client/html/post_merge_side.tpl create mode 100644 client/js/controllers/base_post_controller.js create mode 100644 client/js/controllers/post_detail_controller.js rename client/js/controllers/{post_controller.js => post_main_controller.js} (91%) create mode 100644 client/js/views/post_detail_view.js rename client/js/views/{post_view.js => post_main_view.js} (97%) create mode 100644 client/js/views/post_merge_view.js diff --git a/client/css/post-detail-view.styl b/client/css/post-detail-view.styl new file mode 100644 index 00000000..32e74973 --- /dev/null +++ b/client/css/post-detail-view.styl @@ -0,0 +1,33 @@ +#post + width: 100% + max-width: 40em + h1 + margin-top: 0 + form + width: 100% + .buttons i + margin-right: 0.5em + .post-merge + .left-post-container + width: 47% + float: left + .right-post-container + width: 47% + float: right + input[type=text] + width: 8em + margin-top: -2px + .post-mirror + margin-bottom: 1em + &:after + display: block + height: 1px + content: ' ' + clear: both + .post-thumbnail .thumbnail + width: 100% + height: 9em + .target-post .thumbnail + margin-right: 0.35em + .target-post, .target-post-content + margin: 1em 0 diff --git a/client/css/post-view.styl b/client/css/post-main-view.styl similarity index 100% rename from client/css/post-view.styl rename to client/css/post-main-view.styl diff --git a/client/html/post_detail.tpl b/client/html/post_detail.tpl new file mode 100644 index 00000000..5e04ab22 --- /dev/null +++ b/client/html/post_detail.tpl @@ -0,0 +1,12 @@ +
+

Post #<%- ctx.post.id %>

+ +
+
diff --git a/client/html/post_edit_sidebar.tpl b/client/html/post_edit_sidebar.tpl index 9b088917..d36a0e4e 100644 --- a/client/html/post_edit_sidebar.tpl +++ b/client/html/post_edit_sidebar.tpl @@ -84,12 +84,15 @@ <% } %> - <% if (ctx.canFeaturePosts || ctx.canDeletePosts) { %> + <% if (ctx.canFeaturePosts || ctx.canDeletePosts || ctx.canMergePosts) { %>