From 3e6b98df92a9e723a7d1b33e28b7d6b057981783 Mon Sep 17 00:00:00 2001 From: raku-cat Date: Thu, 27 Dec 2018 03:22:36 -0600 Subject: [PATCH] client: Reimplement post source functionality --- client/html/post_edit_sidebar.tpl | 10 ++++++ client/html/post_readonly_sidebar.tpl | 8 +++++ client/js/controllers/post_main_controller.js | 3 ++ .../js/controls/post_edit_sidebar_control.js | 11 +++++- client/js/models/post.js | 10 ++++++ client/js/util/uri.js | 36 ++++++++++++++++--- 6 files changed, 73 insertions(+), 5 deletions(-) diff --git a/client/html/post_edit_sidebar.tpl b/client/html/post_edit_sidebar.tpl index a66a375..78e90aa 100644 --- a/client/html/post_edit_sidebar.tpl +++ b/client/html/post_edit_sidebar.tpl @@ -58,6 +58,16 @@ <% } %> + <% if (ctx.canEditPostSource) { %> +
+ <%= ctx.makeTextInput({ + text: 'Source', + name: 'source', + value: ctx.post.source, + }) %> +
+ <% } %> + <% if (ctx.canEditPostTags) { %>
<%= ctx.makeTextInput({}) %> diff --git a/client/html/post_readonly_sidebar.tpl b/client/html/post_readonly_sidebar.tpl index 401ce20..78e92fb 100644 --- a/client/html/post_readonly_sidebar.tpl +++ b/client/html/post_readonly_sidebar.tpl @@ -38,6 +38,14 @@ both
+ <% if (ctx.post.source) { %> +
+ Source: + <%- ctx.post.prettyPrintSource() %> + +
+ <% } %> +