diff --git a/static/js/postactions.js b/static/js/postactions.js index 90b1f18..7862445 100644 --- a/static/js/postactions.js +++ b/static/js/postactions.js @@ -1,122 +1,122 @@ var postActions = function() { var basePath = window.WF_BASE_PATH || ""; var $container = He.get('moving'); var MultiMove = function(el, id, singleUser) { var lbl = el.options[el.selectedIndex].textContent; var collAlias = el.options[el.selectedIndex].value; var $lbl = He.$('label[for=move-'+id+']')[0]; $lbl.textContent = "moving to "+lbl+"..."; var params; if (collAlias == '|anonymous|') { params = [id]; } else { params = [{ id: id }]; } var callback = function(code, resp) { if (code == 200) { for (var i=0; i"; - var pre = "/"+collAlias; + var pre = `${basePath}/${collAlias}`; if (typeof singleUser !== 'undefined' && singleUser) { pre = ""; } - var newPostURL = basePath+pre+"/"+resp.data[i].post.slug; + var newPostURL = pre+"/"+resp.data[i].post.slug; try { // Posts page He.$('#post-'+resp.data[i].post.id+' > h3 > a')[0].href = newPostURL; } catch (e) { // Blog index var $article = He.get('post-'+resp.data[i].post.id); $article.className = 'norm moved'; if (collAlias == '|anonymous|') { var draftPre = ""; if (typeof singleUser !== 'undefined' && singleUser) { draftPre = "d/"; } - $article.innerHTML = '

Unpublished post.

'; + $article.innerHTML = `

Moved to ${lbl}.

`; } else { - $article.innerHTML = '

Moved to '+lbl+'.

'; + $article.innerHTML = `

Moved to ${lbl}.

`; } } } else { $lbl.innerHTML = "unable to move: "+resp.data[i].error_msg; } } } }; if (collAlias == '|anonymous|') { He.postJSON(basePath + "/api/posts/disperse", params, callback); } else { He.postJSON(basePath + "/api/collections/"+collAlias+"/collect", params, callback); } }; var Move = function(el, id, collAlias, singleUser) { var lbl = el.textContent; try { var m = lbl.match(/move to (.*)/); lbl = m[1]; } catch (e) { if (collAlias == '|anonymous|') { lbl = "draft"; } } el.textContent = "moving to "+lbl+"..."; if (collAlias == '|anonymous|') { params = [id]; } else { params = [{ id: id }]; } var callback = function(code, resp) { if (code == 200) { for (var i=0; i"; el.onclick = null; - var pre = "/"+collAlias; + var pre = `${basePath}/${collAlias}`; if (typeof singleUser !== 'undefined' && singleUser) { pre = ""; } - var newPostURL = basePath+pre+"/"+resp.data[i].post.slug; + var newPostURL = pre+"/"+resp.data[i].post.slug; el.href = newPostURL; el.title = "View on "+lbl; try { // Posts page He.$('#post-'+resp.data[i].post.id+' > h3 > a')[0].href = newPostURL; } catch (e) { // Blog index var $article = He.get('post-'+resp.data[i].post.id); $article.className = 'norm moved'; if (collAlias == '|anonymous|') { var draftPre = ""; if (typeof singleUser !== 'undefined' && singleUser) { draftPre = "d/"; } - $article.innerHTML = '

Unpublished post.

'; + $article.innerHTML = `

Unpublished post.

`; } else { - $article.innerHTML = '

Moved to '+lbl+'.

'; + $article.innerHTML = `

Moved to ${lbl}.

`; } } } else { - el.innerHTML = "unable to move: "+resp.data[i].error_msg; + el.innerHTML = `unable to move: ${resp.data[i].error_msg}`; } } } } if (collAlias == '|anonymous|') { He.postJSON(basePath + "/api/posts/disperse", params, callback); } else { He.postJSON(basePath + "/api/collections/"+collAlias+"/collect", params, callback); } }; return { move: Move, multiMove: MultiMove, }; }(); diff --git a/templates/chorus-collection.tmpl b/templates/chorus-collection.tmpl index aa1168b..09195ea 100644 --- a/templates/chorus-collection.tmpl +++ b/templates/chorus-collection.tmpl @@ -1,243 +1,243 @@ {{define "collection"}} {{template "head-base" .}} {{.DisplayTitle}}{{if not .SingleUser}} — {{.SiteName}}{{end}} {{if .CustomCSS}}{{end}} {{if .Favicon}}{{else}}{{end}} {{if gt .CurrentPage 1}}{{end}} {{if lt .CurrentPage .TotalPages}}{{end}} {{if not .IsPrivate}}{{end}} {{template "collection-meta" .}} {{if .StyleSheet}}{{end}} {{if .RenderMathJax}} {{template "mathjax" .}} {{end}} {{if .RenderMermaid}} {{template "mermaid" .}} {{end}} {{template "highlighting" . }} {{template "user-navigation" .}} {{if .Silenced}} {{template "user-silenced"}} {{end}}

{{.DisplayTitle}}

{{if .Description}}

{{.Description}}

{{end}} {{/*if not .Public/*}} {{/*end*/}} {{if .PinnedPosts}} {{end}}
{{if .Posts}}
{{else}}
{{end}} {{if .IsWelcome}}

Welcome, {{.Username}}!

This is your new blog.

Start writing, or customize your blog.

Check out our writing guide to see what else you can do, and get in touch anytime with questions or feedback.

{{end}} {{template "posts" .}} {{if gt .TotalPages 1}}{{end}} {{if .Posts}}
{{else}}{{end}} {{if .ShowFooterBranding }} {{ end }} {{if .CanShowScript}} {{range .ExternalScripts}}{{end}} {{if .Script}}{{end}} {{end}} {{end}} diff --git a/templates/collection-archive.tmpl b/templates/collection-archive.tmpl index ec1cc43..5bcd127 100644 --- a/templates/collection-archive.tmpl +++ b/templates/collection-archive.tmpl @@ -1,119 +1,119 @@ {{define "collection"}} {{template "head-base" .}} Archive — {{.Collection.DisplayTitle}} {{if .CustomCSS}}{{end}} {{if .Favicon}}{{else}}{{end}} {{if gt .CurrentPage 1}}{{end}} {{if lt .CurrentPage .TotalPages}}{{end}} {{if not .IsPrivate}}{{end}} {{template "collection-meta" .}} {{if .StyleSheet}}{{end}}

{{.Collection.DisplayTitle}}

{{if .Posts -}}
{{- else -}}
{{- end}}

Archive

{{if .Flash}}

{{.Flash}}

{{end}} {{template "paging" .}} {{if .Posts}}
{{else}}{{end}} {{if .ShowFooterBranding }} {{ end }} {{if .CanShowScript}} {{range .ExternalScripts}}{{end}} {{if .Collection.Script}}{{end}} {{end}} {{end}} diff --git a/templates/collection-tags.tmpl b/templates/collection-tags.tmpl index abed7d2..71acaff 100644 --- a/templates/collection-tags.tmpl +++ b/templates/collection-tags.tmpl @@ -1,218 +1,218 @@ {{define "collection-tags"}} {{template "head-base" .}} {{.Tag}} — {{.Collection.DisplayTitle}} {{if .CustomCSS}}{{end}} {{if .Favicon}}{{else}}{{end}} {{if not .Collection.IsPrivate}}{{end}} {{if gt .Views 1}} {{end}} {{template "collection-meta" .}} {{if .Collection.StyleSheet}}{{end}} {{if .Collection.RenderMathJax}} {{template "mathjax" .}} {{end}} {{if .Collection.RenderMermaid}} {{template "mermaid" .}} {{end}} {{template "highlighting" . }}

{{.Collection.DisplayTitle}}

{{if .Silenced}} {{template "user-silenced"}} {{end}} {{if .Posts}}
{{else}}
{{end}}

{{.Tag}}

{{template "posts" .}} {{if gt .TotalPages 1}}{{end}} {{if .Posts}}
{{else}}{{end}} {{ if .Collection.ShowFooterBranding }} {{ end }} {{if .CanShowScript}} {{range .ExternalScripts}}{{end}} {{if .Collection.Script}}{{end}} {{end}} {{if .IsOwner}} {{end}} {{end}} diff --git a/templates/collection.tmpl b/templates/collection.tmpl index 87338fe..4752318 100644 --- a/templates/collection.tmpl +++ b/templates/collection.tmpl @@ -1,268 +1,268 @@ {{define "collection"}} {{template "head-base" .}} {{.DisplayTitle}}{{if not .SingleUser}} — {{.SiteName}}{{end}} {{if .CustomCSS}}{{end}} {{if .Favicon}}{{else}}{{end}} {{if gt .CurrentPage 1}}{{end}} {{if lt .CurrentPage .TotalPages}}{{end}} {{if not .IsPrivate}}{{end}} {{template "collection-meta" .}} {{if .StyleSheet}}{{end}} {{if .RenderMathJax}} {{template "mathjax" .}} {{end}} {{if .RenderMermaid}} {{template "mermaid" .}} {{end}} {{template "highlighting" . }} {{if or .IsOwner .SingleUser}} {{else if .IsCollLoggedIn}} {{end}}
{{if .Silenced}} {{template "user-silenced"}} {{end}}

{{if .Posts}}{{else}}write.as {{end}}{{.DisplayTitle}}

{{if .Description}}

{{.DisplayDescription}}

{{end}} {{/*if not .Public/*}} {{/*end*/}} {{if .PinnedPosts}} + {{range .PinnedPosts}}{{.PlainDisplayTitle}}{{end}} {{end}}
{{if .Posts}}
{{else}}
{{end}} {{if .IsWelcome}}

Welcome, {{.Username}}!

This is your new blog.

Start writing, or customize your blog.

Check out our writing guide to see what else you can do, and get in touch anytime with questions or feedback.

{{end}} {{if .Flash}}

{{.Flash}}

{{end}} {{template "posts" .}} {{if gt .TotalPages 1}}{{end}} {{if not .IsWelcome}}{{template "emailsubscribe" .}}{{end}} {{if .Posts}}
{{else}}{{end}} {{if .ShowFooterBranding }} {{ end }} {{if .CanShowScript}} {{range .ExternalScripts}}{{end}} {{if .Script}}{{end}} {{end}} {{end}}