diff --git a/common/pages.go b/common/pages.go
index 2edbf816..e9c94f32 100644
--- a/common/pages.go
+++ b/common/pages.go
@@ -165,6 +165,11 @@ type CustomPagePage struct {
Page *CustomPage
}
+type TopicCEditPost struct {
+ Source string
+ Ref string
+}
+
type TopicPage struct {
*Header
ItemList []ReplyUser
diff --git a/common/template_init.go b/common/template_init.go
index b112d1bb..b99e32f7 100644
--- a/common/template_init.go
+++ b/common/template_init.go
@@ -477,6 +477,8 @@ func compileJSTemplates(wg *sync.WaitGroup, c *tmpl.CTemplateSet, themeName stri
pageList := Paginate(20, itemsPerPage, 5)
tmpls.AddStd("paginator", "common.Paginator", Paginator{pageList, page, lastPage})
+ tmpls.AddStd("topic_c_edit_post", "common.TopicCEditPost", TopicCEditPost{Source: "", Ref: ""})
+
var dirPrefix = "./tmpl_client/"
var writeTemplate = func(name string, content string) {
log.Print("Writing template '" + name + "'")
diff --git a/public/global.js b/public/global.js
index 505b69d7..28908da0 100644
--- a/public/global.js
+++ b/public/global.js
@@ -662,8 +662,10 @@ function mainInit(){
let source = "";
if(srcNode!=null) source = srcNode.innerText;
else source = block.innerHTML;
- // TODO: Add a client template for this
- block.innerHTML = "
";
+ block.innerHTML = Template_topic_c_edit_post({
+ Source: source,
+ Ref: this.closest('a').getAttribute("href")
+ })
runHook("edit_item_pre_bind");
$(".submit_edit").click(function(event){
diff --git a/public/init.js b/public/init.js
index 4639886a..ac1570d9 100644
--- a/public/init.js
+++ b/public/init.js
@@ -176,7 +176,7 @@ function RelativeTime(date) {
function initPhrases() {
console.log("in initPhrases")
console.log("tmlInits:",tmplInits)
- fetchPhrases("status,topic_list,alerts,paginator,analytics")
+ fetchPhrases("status,topic_list,topic,alerts,paginator,analytics") // TODO: Break this up?
}
function fetchPhrases(plist) {
@@ -224,6 +224,11 @@ function fetchPhrases(plist) {
if(toLoad===0) initPhrases();
if(!Template_paginator) throw("template function not found");
});
+ notifyOnScriptW("template_topic_c_edit_post", () => {
+ toLoad--;
+ if(toLoad===0) initPhrases();
+ if(!Template_topic_c_edit_post) throw("template function not found");
+ });
let loggedIn = document.head.querySelector("[property='x-loggedin']").content;
if(loggedIn=="true") {
diff --git a/templates/header.html b/templates/header.html
index 2b75bab7..b64069ba 100644
--- a/templates/header.html
+++ b/templates/header.html
@@ -7,7 +7,7 @@
{{range .Header.PreScriptsAsync}}
{{end}}
-
+
{{range .Header.ScriptsAsync}}
{{end}}
diff --git a/templates/topic_c_edit_post.html b/templates/topic_c_edit_post.html
new file mode 100644
index 00000000..d6232d7b
--- /dev/null
+++ b/templates/topic_c_edit_post.html
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file