reduce boilerplate in the client template builder

save a few more bytes in client templates
shave down img tags and global.js mini parse
remove comment in topic alt userinfo
This commit is contained in:
Azareal 2020-03-22 12:37:32 +10:00
parent f074b5578c
commit f86346ba22
27 changed files with 111 additions and 105 deletions

View File

@ -63,15 +63,18 @@ func (list SFileList) JSTmplInit() error {
replace := func(data []byte, replaceThis, withThis string) []byte {
return bytes.Replace(data, []byte(replaceThis), []byte(withThis), -1)
}
rep := func(replaceThis, withThis string) {
data = replace(data, replaceThis, withThis)
}
startIndex, hasFunc := skipAllUntilCharsExist(data, 0, []byte("if(tmplInits===undefined)"))
if !hasFunc {
return errors.New("no init map found")
}
data = data[startIndex-len([]byte("if(tmplInits===undefined)")):]
data = replace(data, "// nolint", "")
data = replace(data, "func ", "function ")
data = replace(data, " error {\n", " {\nlet o = \"\"\n")
rep("// nolint", "")
rep("func ", "function ")
rep(" error {\n", " {\nlet o = \"\"\n")
funcIndex, hasFunc := skipAllUntilCharsExist(data, 0, []byte("function Template_"))
if !hasFunc {
return errors.New("no template function found")
@ -89,8 +92,8 @@ func (list SFileList) JSTmplInit() error {
fmt.Println("string(data[spaceIndex:endBrace]): ", string(data[spaceIndex:endBrace]))
preLen := len(data)
data = replace(data, string(data[spaceIndex:endBrace]), "")
data = replace(data, "))\n", " \n")
rep(string(data[spaceIndex:endBrace]), "")
rep("))\n", " \n")
endBrace -= preLen - len(data) // Offset it as we've deleted portions
fmt.Println("new endBrace: ", endBrace)
fmt.Println("data: ", string(data))
@ -175,47 +178,48 @@ func (list SFileList) JSTmplInit() error {
data[braceAt-1] = ')' // Drop a brace here to satisfy JS
}
})
data = replace(data, "for _, item := range ", "for(item of ")
data = replace(data, "w.Write([]byte(", "o += ")
data = replace(data, "w.Write(StringToBytes(", "o += ")
data = replace(data, "w.Write(", "o += ")
data = replace(data, "+= c.", "+= ")
data = replace(data, "strconv.Itoa(", "")
data = replace(data, "strconv.FormatInt(", "")
data = replace(data, " c.", "")
data = replace(data, "phrases.", "")
data = replace(data, ", 10;", "")
rep("for _, item := range ", "for(item of ")
rep("w.Write([]byte(", "o += ")
rep("w.Write(StringToBytes(", "o += ")
rep("w.Write(", "o += ")
rep("+= c.", "+= ")
rep("strconv.Itoa(", "")
rep("strconv.FormatInt(", "")
rep(" c.", "")
rep("phrases.", "")
rep(", 10;", "")
//data = replace(data, "var plist = GetTmplPhrasesBytes("+shortName+"_tmpl_phrase_id)", "const plist = tmplPhrases[\""+tmplName+"\"];")
//data = replace(data, "//var plist = GetTmplPhrasesBytes("+shortName+"_tmpl_phrase_id)", "const "+shortName+"_phrase_arr = tmplPhrases[\""+tmplName+"\"];")
data = replace(data, "//var plist = GetTmplPhrasesBytes("+shortName+"_tmpl_phrase_id)", "const pl=tmplPhrases[\""+tmplName+"\"];")
data = replace(data, shortName+"_phrase_arr", "pl")
data = replace(data, "tmpl_"+shortName+"_vars", "t_vars")
//rep("var plist = GetTmplPhrasesBytes("+shortName+"_tmpl_phrase_id)", "const plist = tmplPhrases[\""+tmplName+"\"];")
//rep("//var plist = GetTmplPhrasesBytes("+shortName+"_tmpl_phrase_id)", "const "+shortName+"_phrase_arr = tmplPhrases[\""+tmplName+"\"];")
rep("//var plist = GetTmplPhrasesBytes("+shortName+"_tmpl_phrase_id)", "const pl=tmplPhrases[\""+tmplName+"\"];")
rep(shortName+"_phrase_arr", "pl")
rep("tmpl_"+shortName+"_vars", "t_vars")
data = replace(data, "var c_var_", "let c_var_")
data = replace(data, `t_vars, ok := tmpl_i.`, `/*`)
data = replace(data, "[]byte(", "")
data = replace(data, "StringToBytes(", "")
data = replace(data, "RelativeTime(t_vars.", "t_vars.Relative")
rep("var c_v_", "let c_v_")
rep(`t_vars, ok := tmpl_i.`, `/*`)
rep("[]byte(", "")
rep("StringToBytes(", "")
rep("RelativeTime(t_vars.", "t_vars.Relative")
// TODO: Format dates properly on the client side
data = replace(data, ".Format(\"2006-01-02 15:04:05\"", "")
data = replace(data, ", 10", "")
data = replace(data, "if ", "if(")
data = replace(data, "return nil", "return o")
data = replace(data, " )", ")")
data = replace(data, " \n", "\n")
data = replace(data, "\n", ";\n")
data = replace(data, "{;", "{")
data = replace(data, "};", "}")
data = replace(data, "[;", "[")
data = replace(data, ";;", ";")
data = replace(data, ",;", ",")
data = replace(data, "=;", "=")
data = replace(data, `,
rep(".Format(\"2006-01-02 15:04:05\"", "")
rep(", 10", "")
rep("if ", "if(")
rep("return nil", "return o")
rep(" )", ")")
rep(" \n", "\n")
rep("\n", ";\n")
rep("{;", "{")
rep("};", "}")
rep("[;", "[")
rep(";;", ";")
rep(",;", ",")
rep("=;", "=")
rep(`,
});
}`, "\n\t];")
data = replace(data, `=
rep(`=
}`, "=[]")
rep("o += ", "o+=")
fragset := tmpl.GetFrag(shortName)
if fragset != nil {
@ -227,7 +231,7 @@ func (list SFileList) JSTmplInit() error {
sfrags = append(sfrags, []byte("];\n")...)
data = append(sfrags, data...)
}
data = replace(data, "\n;", "\n")
rep("\n;", "\n")
for name, _ := range Themes {
if strings.HasSuffix(shortName, "_"+name) {

View File

@ -1959,7 +1959,7 @@ func (c *CTemplateSet) afterTemplate(con CContext, startIndex int) {
varmap := make(map[string]int)
for name, count := range varcounts {
if count > 1 {
varstr += "var c_var_" + strconv.Itoa(i) + "=" + name + "\n"
varstr += "var c_v_" + strconv.Itoa(i) + "=" + name + "\n"
varmap[name] = i
i++
}
@ -1979,7 +1979,7 @@ func (c *CTemplateSet) afterTemplate(con CContext, startIndex int) {
} else if item.Type == "varsub" && loopDepth == 0 {
index, ok := varmap[item.Body]
if ok {
item.Body = "c_var_" + strconv.Itoa(index)
item.Body = "c_v_" + strconv.Itoa(index)
item.Type = "cvarsub"
outBuf[i] = item
}

View File

@ -946,15 +946,18 @@ function bindTopic() {
// Miniature implementation of the parser to avoid sending as much data back and forth
function quickParse(m) {
m = m.replace(":)", "😀")
m = m.replace(":(", "😞")
m = m.replace(":D", "😃")
m = m.replace(":P", "😛")
m = m.replace(":O", "😲")
m = m.replace(":p", "😛")
m = m.replace(":o", "😲")
m = m.replace(";)", "😉")
m = m.replace("\n","<br>")
const r = (o,n) => {
m = m.replace(o,n)
}
r(":)", "😀")
r(":(", "😞")
r(":D", "😃")
r(":P", "😛")
r(":O", "😲")
r(":p", "😛")
r(":o", "😲")
r(";)", "😉")
r("\n","<br>")
return m
}

View File

@ -8,7 +8,7 @@
<input form="dash_username_form" name="account-new-username" value="{{.CurrentUser.Name}}"/>
<button form="dash_username_form" class="formbutton">{{lang "account_username_save"}}</button>
</span>
<img src="{{.CurrentUser.Avatar}}" height="128px" />
<img src="{{.CurrentUser.Avatar}}" height="128px">
<span id="dash_avatar_buttons">
{{if .CurrentUser.Perms.UploadAvatars}}
<input form="avatar_form" id="select_avatar" name="account-avatar" type="file" required class="auto_hide"/>

View File

@ -1,2 +1,2 @@
{{if .Avatar}}<div class='alertItem withAvatar' style='background-image:url("{{.Avatar}}");'><img src='{{.Avatar}}' class='bgsub' /><a class='text' data-asid='{{.ASID}}' href="{{.Path}}">{{.Message}}</a></div>{{else}}
{{if .Avatar}}<div class='alertItem withAvatar'style='background-image:url("{{.Avatar}}");'><img src='{{.Avatar}}'class='bgsub'><a class='text'data-asid='{{.ASID}}'href="{{.Path}}">{{.Message}}</a></div>{{else}}
<div class='alertItem'><a href="{{.Path}}"class='text'>{{.Message}}</a></div>{{end}}

View File

@ -2,7 +2,7 @@
<div id="post-{{.ID}}" class="rowitem passive deletable_block editable_parent comment {{.ClassName}}">
<div class="topRow">
<div class="userbit">
<img src="{{.User.MicroAvatar}}" alt="Avatar" title="{{.User.Name}}'s Avatar" aria-hidden="true" />
<img src="{{.User.MicroAvatar}}" alt="Avatar" title="{{.User.Name}}'s Avatar" aria-hidden="true">
<span class="nameAndTitle">
<a href="{{.User.Link}}" class="real_username username">{{.User.Name}}</a>
{{if .User.Tag}}<a class="username hide_on_mobile user_tag" style="float:right;">{{.User.Tag}}</a>{{end}}

View File

@ -27,7 +27,7 @@
{{range .Convos}}
<div class="rowitem">
<span class="to_left">
{{if .OneOnOne}}{{range .ShortUsers}}<img class="bgsub" src="{{.MicroAvatar}}" height=48 width=48/>{{end}}{{end}}
{{if .OneOnOne}}{{range .ShortUsers}}<img class="bgsub" src="{{.MicroAvatar}}" height=48 width=48>{{end}}{{end}}
<a href="/user/convo/{{.ID}}">{{range .ShortUsers}}<span class="convos_item_user">{{.Name}}</span>&nbsp;{{end}}</a></span></a>
</span>
<span title="{{abstime .LastReplyAt}}" class="to_right">{{reltime .LastReplyAt}}</span>

View File

@ -31,7 +31,7 @@
{{if .CurrentUser.Perms.CreateTopic}}
<div id="forum_topic_create_form" class="rowblock topic_create_form quick_create_form auto_hide" aria-label="{{lang "quick_topic.aria"}}">
<form id="quick_post_form" enctype="multipart/form-data" action="/topic/create/submit/?s={{.CurrentUser.Session}}" method="post"></form>
<img class="little_row_avatar" src="{{.CurrentUser.MicroAvatar}}" height=64 alt="{{lang "quick_topic.avatar_alt"}}" title="{{lang "quick_topic.avatar_tooltip"}}"/>
<img class="little_row_avatar" src="{{.CurrentUser.MicroAvatar}}" height=64 alt="{{lang "quick_topic.avatar_alt"}}" title="{{lang "quick_topic.avatar_tooltip"}}">
<input form="quick_post_form" id="topic_board_input" name="board" value="{{.Forum.ID}}" type="hidden">
<div class="main_form">
<div class="topic_meta">
@ -50,7 +50,7 @@
{{range .ItemList}}<div class="topic_row{{if .Sticky}} topic_sticky{{else if .IsClosed}} topic_closed{{end}}" data-tid="{{.ID}}">
<div class="rowitem topic_left passive datarow">
<span class="selector"></span>
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"/></a>
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"></a>
<span class="topic_inner_left">
<a class="rowtopic"href="{{.Link}}"itemprop="itemListElement" title="{{.Title}}"><span>{{.Title}}</span></a>
<br><a class="rowsmall starter" href="{{.Creator.Link}}" title="{{.Creator.Name}}">{{.Creator.Name}}</a>
@ -73,7 +73,7 @@
</div>
<div class="rowitem topic_right passive datarow">
<div class="topic_right_inside">
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}" height=64 alt="Avatar"title="{{.LastUser.Name}}'s Avatar"aria-hidden="true"/></a>
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}"height=64 alt="Avatar"title="{{.LastUser.Name}}'s Avatar"aria-hidden="true"></a>
<span>
<a href="{{.LastUser.Link}}" class="lastName" title="{{.LastUser.Name}}">{{.LastUser.Name}}</a><br>
<a href="{{.Link}}?page={{.LastPage}}{{if .LastReplyID}}#post-{{.LastReplyID}}{{end}}" class="rowsmall lastReplyAt" title="{{abstime .LastReplyAt}}">{{reltime .LastReplyAt}}</a>

View File

@ -26,7 +26,7 @@
{{if .CurrentUser.Perms.CreateTopic}}
<div id="forum_topic_create_form" class="rowblock topic_create_form quick_create_form auto_hide" aria-label="{{lang "quick_topic.aria"}}">
<form id="quick_post_form" enctype="multipart/form-data" action="/topic/create/submit/?s={{.CurrentUser.Session}}" method="post"></form>
<img class="little_row_avatar" src="{{.CurrentUser.MicroAvatar}}" height=64 alt="{{lang "quick_topic.avatar_alt"}}" title="{{lang "quick_topic.avatar_tooltip"}}"/>
<img class="little_row_avatar" src="{{.CurrentUser.MicroAvatar}}" height=64 alt="{{lang "quick_topic.avatar_alt"}}" title="{{lang "quick_topic.avatar_tooltip"}}">
<input form="quick_post_form" id="topic_board_input" name="board" value="{{.Forum.ID}}" type="hidden">
<div class="main_form">
<div class="topic_meta">
@ -44,11 +44,11 @@
<div id="forum_topic_list" class="rowblock micro_grid" aria-label="{{lang "forum_list_aria"}}" style="grid-template-columns:repeat(auto-fit,minmax(130px,1fr));">
{{range .ItemList}}<div class="rowitem" data-tid="{{.ID}}">
<div>
<a class="rowtopic" href="{{.Link}}" itemprop="itemListElement"><img src="{{.Content}}" style="width:100%;height:160px;"/></a>
<a class="rowtopic" href="{{.Link}}" itemprop="itemListElement"><img src="{{.Content}}" style="width:100%;height:160px;"></a>
<br><a class="rowsmall starter" href="{{.Link}}">{{.Title}}</a>
</div>
<!--<div class="topic_left passive datarow">
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar" title="{{.Creator.Name}}'s Avatar" aria-hidden="true"/></a>
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar" title="{{.Creator.Name}}'s Avatar" aria-hidden="true"></a>
<span class="topic_inner_left">
<a class="rowtopic" href="{{.Link}}" itemprop="itemListElement" title="{{.Title}}"><span>{{.Title}}</span></a>
<br><a class="rowsmall starter" href="{{.Creator.Link}}" title="{{.Creator.Name}}">{{.Creator.Name}}</a>
@ -63,7 +63,7 @@
</div>
<div class="topic_right passive datarow">
<div class="topic_right_inside">
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}" height=64 alt="Avatar" title="{{.LastUser.Name}}'s Avatar" aria-hidden="true"/></a>
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}" height=64 alt="Avatar" title="{{.LastUser.Name}}'s Avatar" aria-hidden="true"></a>
<span>
<a href="{{.LastUser.Link}}" class="lastName" style="font-size: 14px;" title="{{.LastUser.Name}}">{{.LastUser.Name}}</a><br>
<a href="{{.Link}}?page={{.LastPage}}{{if .LastReplyID}}#post-{{.LastReplyID}}{{end}}" class="rowsmall lastReplyAt" title="{{abstime .LastReplyAt}}">{{reltime .LastReplyAt}}</a>

View File

@ -16,7 +16,7 @@
{{end}}
</span>
<span class="forum_right shift_right">
{{if .LastReplyer.MicroAvatar}}<img class="extra_little_row_avatar" src="{{.LastReplyer.MicroAvatar}}" height=64 width=64 alt="Avatar" title="{{.LastReplyer.Name}}'s Avatar" aria-hidden="true"/>{{end}}
{{if .LastReplyer.MicroAvatar}}<img class="extra_little_row_avatar"src="{{.LastReplyer.MicroAvatar}}" height=64 width=64 alt="Avatar"title="{{.LastReplyer.Name}}'s Avatar"aria-hidden="true">{{end}}
<span>
<a {{if .LastTopic.Link}}href="{{.LastTopic.Link}}"{{else}}class="forum_no_poster"{{end}}>{{if .LastTopic.Title}}{{.LastTopic.Title}}{{else}}{{lang "forums_none"}}{{end}}</a>
{{if .LastTopicTime}}<br><span class="rowsmall" title="{{abstime .LastTopic.LastReplyAt}}">{{.LastTopicTime}}</span>{{end}}

View File

@ -45,7 +45,7 @@
{{/** TODO: Make this a separate template and load it via the theme docks, here for now so we can rapidly prototype the Nox theme **/}}
{{if eq .Header.Theme.Name "nox"}}
<div class="user_box">
<img src="{{.CurrentUser.MicroAvatar}}"/>
<img src="{{.CurrentUser.MicroAvatar}}">
<div class="option_box">
<a href="{{.CurrentUser.Link}}"class="username">{{.CurrentUser.Name}}</a>
<span class="alerts">{{lang "alerts.no_alerts_short"}}</span>

View File

@ -14,7 +14,7 @@
</div>
{{if .IP}}<div class="rowblock rowlist bgavatars micro_grid{{if .ItemList}} has_items{{end}}">
{{range .ItemList}}<div class="rowitem" style="background-image:url('{{.Avatar}}');">
<img src="{{.Avatar}}" class="bgsub" alt="Avatar" aria-hidden="true"/>
<img src="{{.Avatar}}"class="bgsub"alt="Avatar"aria-hidden="true">
<a class="rowTitle" href="{{.Link}}">{{.Name}}</a>
</div>
{{else}}<div class="rowitem rowmsg">{{lang "ip_search_no_users"}}</div>{{end}}

View File

@ -8,7 +8,7 @@
<div class="formrow">
<div class="formitem formlabel"><a>{{lang "panel_user_avatar"}}</a></div>
<div class="formitem avataritem">
{{if .User.RawAvatar}}<img src="{{.User.Avatar}}" height=56 width=56 />{{end}}
{{if .User.RawAvatar}}<img src="{{.User.Avatar}}" height=56 width=56>{{end}}
<div class="avatarbuttons">
<input form="avatar_form" id="select_avatar" name="avatar_file" type="file" required class="auto_hide"/>
<label for="select_avatar" class="formbutton">{{lang "panel_user_avatar_select"}}</label>

View File

@ -5,7 +5,7 @@
{{range .ItemList}}
<div class="rowitem" style="background-image:url('{{.Avatar}}');">
<a class="rowAvatar"{{if $.CurrentUser.Perms.EditUser}} href="/panel/users/edit/{{.ID}}"{{end}}>
<img class="bgsub" src="{{.Avatar}}" alt="Avatar" aria-hidden="true" />
<img class="bgsub"src="{{.Avatar}}"alt="Avatar"aria-hidden="true">
</a>
<a class="rowTitle"{{if $.CurrentUser.Perms.EditUser}} href="/panel/users/edit/{{.ID}}"{{end}}>{{.Name}}</a>
<span class="panel_floater">

View File

@ -5,7 +5,7 @@
<div id="profile_left_pane" class="rowmenu">
<div class="topBlock">
<div class="rowitem avatarRow">
<a href="{{.ProfileOwner.Avatar}}"><img src="{{.ProfileOwner.Avatar}}" class="avatar" alt="Avatar" title="{{.ProfileOwner.Name}}'s Avatar" aria-hidden="true"/></a>
<a href="{{.ProfileOwner.Avatar}}"><img src="{{.ProfileOwner.Avatar}}"class="avatar"alt="Avatar"title="{{.ProfileOwner.Name}}'s Avatar"aria-hidden="true"></a>
</div>
<div class="rowitem nameRow">
<span class="profileName" title="{{.ProfileOwner.Name}}">{{.ProfileOwner.Name}}</span>{{if .ProfileOwner.Tag}}<span class="username" title="{{.ProfileOwner.Tag}}">{{.ProfileOwner.Tag}}</span>{{end}}

View File

@ -2,7 +2,7 @@
<div id="post-{{.ID}}" class="rowitem passive deletable_block editable_parent comment {{.ClassName}}">
<div class="topRow">
<div class="userbit">
<img src="{{.MicroAvatar}}" alt="Avatar" title="{{.CreatedByName}}'s Avatar" aria-hidden="true" />
<img src="{{.MicroAvatar}}"alt="Avatar"title="{{.CreatedByName}}'s Avatar"aria-hidden="true">
<span class="nameAndTitle">
<a href="{{.UserLink}}" class="real_username username">{{.CreatedByName}}</a>
{{if .Tag}}<a class="username hide_on_mobile user_tag" style="float:right;">{{.Tag}}</a>{{end}}

View File

@ -62,7 +62,7 @@
<div class="show_on_edit attach_edit_bay" type="topic" id="{{.Topic.ID}}">
{{range .Topic.Attachments}}
<div class="attach_item attach_item_item{{if .Image}} attach_image_holder{{end}}">
{{if .Image}}<img src="//{{$.Header.Site.URL}}/attachs/{{.Path}}?sid={{.SectionID}}&amp;stype=forums" height=24 width=24/>{{end}}
{{if .Image}}<img src="//{{$.Header.Site.URL}}/attachs/{{.Path}}?sid={{.SectionID}}&amp;stype=forums" height=24 width=24>{{end}}
<span class="attach_item_path" aid="{{.ID}}" fullPath="//{{$.Header.Site.URL}}/attachs/{{.Path}}">{{.Path}}</span>
<button class="attach_item_select">{{lang "topic.select_button_text"}}</button>
<button class="attach_item_copy">{{lang "topic.copy_button_text"}}</button>

View File

@ -12,7 +12,7 @@
<div class="show_on_block_edit attach_edit_bay"type="reply"id="{{.ID}}">
{{range .Attachments}}
<div class="attach_item attach_item_item{{if .Image}} attach_image_holder{{end}}">
{{if .Image}}<img src="//{{$.Header.Site.URL}}/attachs/{{.Path}}?sid={{.SectionID}}&amp;stype=forums" height=24 width=24 />{{end}}
{{if .Image}}<img src="//{{$.Header.Site.URL}}/attachs/{{.Path}}?sid={{.SectionID}}&amp;stype=forums"height=24 width=24>{{end}}
<span class="attach_item_path" aid={{.ID}} fullPath="//{{$.Header.Site.URL}}/attachs/{{.Path}}">{{.Path}}</span>
<button class="attach_item_select">{{lang "topic.select_button_text"}}</button>
<button class="attach_item_copy">{{lang "topic.copy_button_text"}}</button>

View File

@ -1,5 +1,4 @@
<div class="userinfo"aria-label="{{lang "topic.userinfo_aria"}}">
<!--<div class="avatar_item" style="background-image:url({{.Avatar}}),url(/s/white-dot.jpg);">&nbsp;</div>-->
<img class="aitem"src="{{.Avatar}}"alt="Avatar">
<div class="user_meta">
<a href="{{.UserLink}}"class="the_name"rel="author">{{.CreatedByName}}</a>

View File

@ -1,4 +1,4 @@
{{if .ImgSrc}}<img src='{{.ImgSrc}}' height=24 width=24/>{{end}}
{{if .ImgSrc}}<img src='{{.ImgSrc}}'height=24 width=24>{{end}}
<span class='attach_item_path'aid='{{.ID}}'fullpath='{{.FullPath}}'>{{.Path}}</span>
<button class='attach_item_select'>{{lang "topic.select_button_text"}}</button>
<button class='attach_item_copy'>{{lang "topic.copy_button_text"}}</button>

View File

@ -54,7 +54,7 @@
</div>
<div class="rowblock topic_create_form quick_create_form auto_hide" aria-label="{{lang "quick_topic.aria"}}">
<form name="topic_create_form_form"id="quick_post_form" enctype="multipart/form-data"action="/topic/create/submit/?s={{.CurrentUser.Session}}" method="post"></form>
<img class="little_row_avatar" src="{{.CurrentUser.MicroAvatar}}" height=64 alt="{{lang "quick_topic.avatar_alt"}}" title="{{lang "quick_topic.avatar_tooltip"}}"/>
<img class="little_row_avatar"src="{{.CurrentUser.MicroAvatar}}" height=64 alt="{{lang "quick_topic.avatar_alt"}}" title="{{lang "quick_topic.avatar_tooltip"}}">
<div class="main_form">
<div class="topic_meta">
<div class="formrow topic_board_row real_first_child">

View File

@ -1,7 +1,7 @@
<div class="topic_row{{if .Sticky}} topic_sticky{{else if .IsClosed}} topic_closed{{end}}" data-tid="{{.ID}}">
<div class="rowitem topic_left passive datarow">
<span class="selector"></span>
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"/></a>
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"></a>
<span class="topic_inner_left">
<a class="rowtopic"href="{{.Link}}"itemprop="itemListElement" title="{{.Title}}"><span>{{.Title}}</span></a> {{if .ForumName}}<a class="rowsmall parent_forum"href="{{.ForumLink}}"title="{{.ForumName}}">{{.ForumName}}</a>{{end}}
<br><a class="rowsmall starter"href="{{.Creator.Link}}"title="{{.Creator.Name}}">{{.Creator.Name}}</a>
@ -24,7 +24,7 @@
</div>
<div class="rowitem topic_right passive datarow">
<div class="topic_right_inside">
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}" height=64 alt="Avatar"title="{{.LastUser.Name}}'s Avatar" aria-hidden="true"/></a>
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}" height=64 alt="Avatar"title="{{.LastUser.Name}}'s Avatar" aria-hidden="true"></a>
<span>
<a href="{{.LastUser.Link}}" class="lastName" title="{{.LastUser.Name}}">{{.LastUser.Name}}</a><br>
<a href="{{.Link}}?page={{.LastPage}}{{if .LastReplyID}}#post-{{.LastReplyID}}{{end}}" class="rowsmall lastReplyAt" title="{{abstime .LastReplyAt}}">{{reltime .LastReplyAt}}</a>

View File

@ -4,7 +4,7 @@
<div class="rowblock rowlist bgavatars not_grid widget_online">
{{if lt .UserCount 30}}
{{range .Users}}<div class="rowitem"style="background-image:url('{{.Avatar}}');">
<img src="{{.Avatar}}" class="bgsub" alt="Avatar" aria-hidden="true" />
<img src="{{.Avatar}}"class="bgsub"alt="Avatar"aria-hidden="true">
<a class="rowTitle" href="{{.Link}}">{{.Name}}</a>
</div>
{{else}}<div class="rowitem rowmsg">{{lang "widget.online_none_online"}}</div>{{end}}

View File

@ -1,6 +1,6 @@
<div class="above_right">
<div class="left_bit"><a href="/">{{lang "panel_back_to_site"}}</a></div>
<div class="right_bit">
<img src="{{.CurrentUser.MicroAvatar}}" height=32 width=32 />
<img src="{{.CurrentUser.MicroAvatar}}" height=32 width=32>
<span>{{lang "panel_welcome"}}{{.CurrentUser.Name}}</span></div>
</div>

View File

@ -1,6 +1,6 @@
<div class="topic_row{{if .Sticky}} topic_sticky{{else if .IsClosed}} topic_closed{{end}}"data-tid={{.ID}}>
<div class="rowitem topic_left passive datarow">
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"/></a>
<a href="{{.Creator.Link}}"><img src="{{.Creator.MicroAvatar}}" height=64 alt="Avatar"title="{{.Creator.Name}}'s Avatar"aria-hidden="true"></a>
<span class="topic_inner_left">
<span class="rowtopic"itemprop="itemListElement"title="{{.Title}}"><a href="{{.Link}}">{{.Title}}</a>{{if .ForumName}}<a class="parent_forum_sep">-</a><a href="{{.ForumLink}}"title="{{.ForumName}}"class="rowsmall parent_forum">{{.ForumName}}</a>{{end}}</span>
<br><a class="rowsmall starter"href="{{.Creator.Link}}"title="{{.Creator.Name}}">{{.Creator.Name}}</a>
@ -15,7 +15,7 @@
</div>
<div class="rowitem topic_right passive datarow">
<div class="topic_right_inside">
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}" height=64 alt="Avatar"title="{{.LastUser.Name}}'s Avatar"aria-hidden="true"/></a>
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.MicroAvatar}}" height=64 alt="Avatar"title="{{.LastUser.Name}}'s Avatar"aria-hidden="true"></a>
<span>
<a href="{{.LastUser.Link}}"class="lastName"title="{{.LastUser.Name}}">{{.LastUser.Name}}</a><br>
<a href="{{.Link}}?page={{.LastPage}}{{if .LastReplyID}}#post-{{.LastReplyID}}{{end}}"class="rowsmall lastReplyAt"title="{{abstime .LastReplyAt}}">{{reltime .LastReplyAt}}</a>