diff options
| author | rr- | 2016-10-22 10:03:38 +0200 |
|---|---|---|
| committer | rr- | 2016-10-22 14:05:56 +0200 |
| commit | f1445b9c24b286a9f74a2fead655ab5c169bc74b (patch) | |
| tree | eba026eb8dcd53f8d4db58e9dc50af1b857d92ed /client/html | |
| parent | 8c0fa7f49ea24606e1887b76e89c2bfd155b1776 (diff) | |
client/posts: add post merging
Diffstat (limited to 'client/html')
| -rw-r--r-- | client/html/post_detail.tpl | 12 | ||||
| -rw-r--r-- | client/html/post_edit_sidebar.tpl | 5 | ||||
| -rw-r--r-- | client/html/post_main.tpl (renamed from client/html/post.tpl) | 0 | ||||
| -rw-r--r-- | client/html/post_merge.tpl | 23 | ||||
| -rw-r--r-- | client/html/post_merge_side.tpl | 48 |
5 files changed, 87 insertions, 1 deletions
diff --git a/client/html/post_detail.tpl b/client/html/post_detail.tpl new file mode 100644 index 0000000..5e04ab2 --- /dev/null +++ b/client/html/post_detail.tpl @@ -0,0 +1,12 @@ +<div class='content-wrapper' id='post'> + <h1>Post #<%- ctx.post.id %></h1> + <nav class='buttons'><!-- + --><ul><!-- + --><li><a href='/post/<%- ctx.post.id %>'><i class='fa fa-reply'></i> Main view</a></li><!-- + --><% if (ctx.canMerge) { %><!-- + --><li data-name='merge'><a href='/post/<%- ctx.post.id %>/merge'>Merge with…</a></li><!-- + --><% } %><!-- + --></ul><!-- + --></nav> + <div class='post-content-holder'></div> +</div> diff --git a/client/html/post_edit_sidebar.tpl b/client/html/post_edit_sidebar.tpl index 9b08891..d36a0e4 100644 --- a/client/html/post_edit_sidebar.tpl +++ b/client/html/post_edit_sidebar.tpl @@ -84,12 +84,15 @@ </section> <% } %> - <% if (ctx.canFeaturePosts || ctx.canDeletePosts) { %> + <% if (ctx.canFeaturePosts || ctx.canDeletePosts || ctx.canMergePosts) { %> <section class='management'> <ul> <% if (ctx.canFeaturePosts) { %> <li><a href class='feature'>Feature this post on main page</a></li> <% } %> + <% if (ctx.canMergePosts) { %> + <li><a href class='merge'>Merge this post with another</a></li> + <% } %> <% if (ctx.canDeletePosts) { %> <li><a href class='delete'>Delete this post</a></li> <% } %> diff --git a/client/html/post.tpl b/client/html/post_main.tpl index 07ade0b..07ade0b 100644 --- a/client/html/post.tpl +++ b/client/html/post_main.tpl diff --git a/client/html/post_merge.tpl b/client/html/post_merge.tpl new file mode 100644 index 0000000..59b3f49 --- /dev/null +++ b/client/html/post_merge.tpl @@ -0,0 +1,23 @@ +<div class='post-merge'> + <form> + <ul> + <li class='post-mirror'> + <div class='left-post-container'></div> + <div class='right-post-container'></div> + </li> + + <li> + <p>Tags, relations, scores, favorites and comments will be + merged. All other properties need to be handled manually.</p> + + <%= ctx.makeCheckbox({required: true, text: 'I confirm that I want to merge these posts.'}) %> + </li> + </ul> + + <div class='messages'></div> + + <div class='buttons'> + <input type='submit' value='Merge posts'/> + </div> + </form> +</div> diff --git a/client/html/post_merge_side.tpl b/client/html/post_merge_side.tpl new file mode 100644 index 0000000..60cc080 --- /dev/null +++ b/client/html/post_merge_side.tpl @@ -0,0 +1,48 @@ +<% if (ctx.editable) { %> + <p>Post # <input type='text' pattern='^[0-9]+$' value='<%- ctx.post ? ctx.post.id : '' %>'/></p> +<% } else { %> + <p>Post # <input type='text' pattern='^[0-9]+$' value='<%- ctx.post ? ctx.post.id : '' %>' readonly/></p> +<% } %> + +<% if (ctx.post) { %> + <div class='post-thumbnail'> + <a rel='external' href='<%- ctx.post.contentUrl %>'> + <%= ctx.makeThumbnail(ctx.post.thumbnailUrl) %> + </a> + </div> + <div class='target-post'> + <%= ctx.makeRadio({ + required: true, + text: 'Merge to this post<br/><small>' + + ctx.makeUserLink(ctx.post.user) + + ', ' + + ctx.makeRelativeTime(ctx.post.creationTime) + + '</small>', + name: 'target-post', + value: ctx.name, + }) %> + </div> + <div class='target-post-content'> + <%= ctx.makeRadio({ + required: true, + text: 'Use this file<br/><small>' + + ctx.makeFileSize(ctx.post.fileSize) + ' ' + + { + 'image/gif': 'GIF', + 'image/jpeg': 'JPEG', + 'image/png': 'PNG', + 'video/webm': 'WEBM', + 'application/x-shockwave-flash': 'SWF', + }[ctx.post.mimeType] + + ' (' + + (ctx.post.canvasWidth ? + `${ctx.post.canvasWidth}x${ctx.post.canvasHeight}` : + '?') + + ')</small>', + name: 'target-post-content', + value: ctx.name, + }) %> + <p> + </p> + </div> +<% } %> |