Added support for likes to the other themes. I'm pondering over how to best show the like counter on them.

Cleaned up the alternate topic layout, no longer do we have buttons on the topic header.
Added the topic specific permissions to the templates and removed the reliance on the Is_Mod flag.
Fixed a bug where the nav menu refuses to acknowledge that you're logged in.
This commit is contained in:
Azareal 2017-02-15 15:29:05 +00:00
parent 6fdf615cf5
commit 61358b5449
8 changed files with 338 additions and 281 deletions

View File

@ -1334,7 +1334,7 @@ func TestForumAdminRoute(t *testing.T) {
admin_session_cookie := http.Cookie{Name:"session",Value: admin.Session,Path:"/",MaxAge: year} admin_session_cookie := http.Cookie{Name:"session",Value: admin.Session,Path:"/",MaxAge: year}
forum_w := httptest.NewRecorder() forum_w := httptest.NewRecorder()
forum_req := httptest.NewRequest("get","/forum/2",bytes.NewReader(nil)) forum_req := httptest.NewRequest("get","/forum/1",bytes.NewReader(nil))
forum_req_admin := forum_req forum_req_admin := forum_req
forum_req_admin.AddCookie(&admin_uid_cookie) forum_req_admin.AddCookie(&admin_uid_cookie)
forum_req_admin.AddCookie(&admin_session_cookie) forum_req_admin.AddCookie(&admin_session_cookie)

View File

@ -1,7 +1,7 @@
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */ /* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
package main package main
import "strconv"
import "io" import "io"
import "strconv"
func init() { func init() {
template_forum_handle = template_forum template_forum_handle = template_forum

View File

@ -74,101 +74,102 @@ var topic_14 []byte = []byte(`<span class='username hide_on_micro topic_status_e
var topic_15 []byte = []byte(` var topic_15 []byte = []byte(`
<input class='show_on_edit topic_name_input' name="topic_name" value='`) <input class='show_on_edit topic_name_input' name="topic_name" value='`)
var topic_16 []byte = []byte(`' type="text" /> var topic_16 []byte = []byte(`' type="text" />
<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'> `)
var topic_17 []byte = []byte(`<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'>
<option>open</option> <option>open</option>
<option>closed</option> <option>closed</option>
</select> </select>`)
var topic_18 []byte = []byte(`
<button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button> <button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button>
`) `)
var topic_17 []byte = []byte(` var topic_19 []byte = []byte(`
</div> </div>
</form> </form>
</div> </div>
<div class="rowblock post_container"> <div class="rowblock post_container">
<div class="rowitem passive editable_parent post_item" style="border-bottom: none;`) <div class="rowitem passive editable_parent post_item" style="border-bottom: none;`)
var topic_18 []byte = []byte(`background-image:url(`) var topic_20 []byte = []byte(`background-image:url(`)
var topic_19 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px `) var topic_21 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px `)
var topic_20 []byte = []byte(`-1`) var topic_22 []byte = []byte(`-1`)
var topic_21 []byte = []byte(`0px;background-repeat:no-repeat, repeat-y;background-size:128px;padding-left:136px;`) var topic_23 []byte = []byte(`0px;background-repeat:no-repeat, repeat-y;background-size:128px;padding-left:136px;`)
var topic_22 []byte = []byte(`"> var topic_24 []byte = []byte(`">
<p class="hide_on_edit topic_content user_content" style="margin:0;padding:0;">`) <p class="hide_on_edit topic_content user_content" style="margin:0;padding:0;">`)
var topic_23 []byte = []byte(`</p> var topic_25 []byte = []byte(`</p>
<textarea name="topic_content" class="show_on_edit topic_content_input">`) <textarea name="topic_content" class="show_on_edit topic_content_input">`)
var topic_24 []byte = []byte(`</textarea><br /><br /> var topic_26 []byte = []byte(`</textarea><br /><br />
<a href="/user/`) <a href="/user/`)
var topic_25 []byte = []byte(`" class="username real_username">`) var topic_27 []byte = []byte(`" class="username real_username">`)
var topic_26 []byte = []byte(`</a>&nbsp; var topic_28 []byte = []byte(`</a>&nbsp;
<a href="/topic/like/submit/`)
var topic_27 []byte = []byte(`" class="mod_button" title="Love it" style="color:#202020;"><button class="username" style="`)
var topic_28 []byte = []byte(`background-color:/*#eaffea*/#D6FFD6;`)
var topic_29 []byte = []byte(`">😀</button></a>&nbsp;
`) `)
var topic_30 []byte = []byte(`<a href='/topic/edit/`) var topic_29 []byte = []byte(`<a href="/topic/like/submit/`)
var topic_31 []byte = []byte(`' class="mod_button open_edit" style="font-weight:normal;" title="Edit Topic"><button class="username">🖊</button></a>&nbsp; var topic_30 []byte = []byte(`" class="mod_button" title="Love it" style="color:#202020;"><button class="username" style="`)
<a href='/topic/delete/submit/`) var topic_31 []byte = []byte(`background-color:/*#eaffea*/#D6FFD6;`)
var topic_32 []byte = []byte(`' class="mod_button" style="font-weight:normal;" title="Delete Topic"><button class="username">🗑</button></a>&nbsp; var topic_32 []byte = []byte(`">😀</button></a>&nbsp;`)
`) var topic_33 []byte = []byte(`<a href='/topic/edit/`)
var topic_33 []byte = []byte(`<a class="mod_button" href='/topic/unstick/submit/`) var topic_34 []byte = []byte(`' class="mod_button open_edit" style="font-weight:normal;" title="Edit Topic"><button class="username">🖊️</button></a>&nbsp;`)
var topic_34 []byte = []byte(`' style="font-weight:normal;" title="Unpin Topic"><button class="username" style="background-color:/*#eaffea*/#D6FFD6;">📌</button></a>`) var topic_35 []byte = []byte(`<a href='/topic/delete/submit/`)
var topic_35 []byte = []byte(`<a href='/topic/stick/submit/`) var topic_36 []byte = []byte(`' class="mod_button" style="font-weight:normal;" title="Delete Topic"><button class="username">🗑️</button></a>&nbsp;`)
var topic_36 []byte = []byte(`' class="mod_button" style="font-weight:normal;" title="Pin Topic"><button class="username">📌</button></a>`) var topic_37 []byte = []byte(`<a class="mod_button" href='/topic/unstick/submit/`)
var topic_37 []byte = []byte(`&nbsp; var topic_38 []byte = []byte(`' style="font-weight:normal;" title="Unpin Topic"><button class="username" style="background-color:/*#eaffea*/#D6FFD6;">📌</button></a>`)
var topic_39 []byte = []byte(`<a href='/topic/stick/submit/`)
var topic_40 []byte = []byte(`' class="mod_button" style="font-weight:normal;" title="Pin Topic"><button class="username">📌</button></a>&nbsp;`)
var topic_41 []byte = []byte(`
<a href="/report/submit/`) <a href="/report/submit/`)
var topic_38 []byte = []byte(`?session=`) var topic_42 []byte = []byte(`?session=`)
var topic_39 []byte = []byte(`&type=topic" class="mod_button report_item" style="font-weight:normal;" title="Flag Topic"><button class="username">🚩</button></a>&nbsp; var topic_43 []byte = []byte(`&type=topic" class="mod_button report_item" style="font-weight:normal;" title="Flag Topic"><button class="username">🚩</button></a>&nbsp;
`) `)
var topic_40 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">`)
var topic_41 []byte = []byte(`</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;margin-left:5px;" title="Like Count">😀</a>`)
var topic_42 []byte = []byte(`<a class="username hide_on_micro" style="float:right;color:#505050;font-size:16px;">`)
var topic_43 []byte = []byte(`</a>`)
var topic_44 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">`) var topic_44 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">`)
var topic_45 []byte = []byte(`</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;" title="Level">👑</a>`) var topic_45 []byte = []byte(`</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;margin-left:5px;" title="Like Count">😀</a>`)
var topic_46 []byte = []byte(` var topic_46 []byte = []byte(`<a class="username hide_on_micro" style="float:right;color:#505050;font-size:16px;">`)
var topic_47 []byte = []byte(`</a>`)
var topic_48 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">`)
var topic_49 []byte = []byte(`</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;" title="Level">👑</a>`)
var topic_50 []byte = []byte(`
</div> </div>
</div><br /> </div><br />
<div class="rowblock post_container" style="overflow: hidden;">`) <div class="rowblock post_container" style="overflow: hidden;">`)
var topic_47 []byte = []byte(` var topic_51 []byte = []byte(`
<div class="rowitem rowhead passive deletable_block editable_parent post_item" style="`) <div class="rowitem rowhead passive deletable_block editable_parent post_item" style="`)
var topic_48 []byte = []byte(`background-image:url(`) var topic_52 []byte = []byte(`background-image:url(`)
var topic_49 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px `) var topic_53 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px `)
var topic_50 []byte = []byte(`-1`) var topic_54 []byte = []byte(`-1`)
var topic_51 []byte = []byte(`0px;background-repeat:no-repeat, repeat-y;background-size:128px;padding-left:136px;`) var topic_55 []byte = []byte(`0px;background-repeat:no-repeat, repeat-y;background-size:128px;padding-left:136px;`)
var topic_52 []byte = []byte(`"> var topic_56 []byte = []byte(`">
<p class="editable_block user_content" style="margin: 0;padding: 0;">`) <p class="editable_block user_content" style="margin: 0;padding: 0;">`)
var topic_53 []byte = []byte(`</p><br /><br /> var topic_57 []byte = []byte(`</p><br /><br />
<a href="/user/`) <a href="/user/`)
var topic_54 []byte = []byte(`" class="username real_username">`) var topic_58 []byte = []byte(`" class="username real_username">`)
var topic_55 []byte = []byte(`</a>&nbsp; var topic_59 []byte = []byte(`</a>&nbsp;
<a href="/reply/like/submit/`)
var topic_56 []byte = []byte(`" class="mod_button" title="Love it" style="color:#202020;"><button class="username" style="`)
var topic_57 []byte = []byte(`background-color:/*#eaffea*/#D6FFD6;`)
var topic_58 []byte = []byte(`">😀</button></a>&nbsp;
`) `)
var topic_59 []byte = []byte(`<a href="/reply/edit/submit/`) var topic_60 []byte = []byte(`<a href="/reply/like/submit/`)
var topic_60 []byte = []byte(`" class="mod_button" title="Edit Reply"><button class="username edit_item">🖊️</button></a>&nbsp;`) var topic_61 []byte = []byte(`" class="mod_button" title="Love it" style="color:#202020;"><button class="username" style="`)
var topic_61 []byte = []byte(`<a href="/reply/delete/submit/`) var topic_62 []byte = []byte(`background-color:/*#eaffea*/#D6FFD6;`)
var topic_62 []byte = []byte(`" class="mod_button" title="Delete Reply"><button class="username delete_item">🗑️</button></a>&nbsp;`) var topic_63 []byte = []byte(`">😀</button></a>&nbsp;`)
var topic_63 []byte = []byte(` var topic_64 []byte = []byte(`<a href="/reply/edit/submit/`)
var topic_65 []byte = []byte(`" class="mod_button" title="Edit Reply"><button class="username edit_item">🖊️</button></a>&nbsp;`)
var topic_66 []byte = []byte(`<a href="/reply/delete/submit/`)
var topic_67 []byte = []byte(`" class="mod_button" title="Delete Reply"><button class="username delete_item">🗑️</button></a>&nbsp;`)
var topic_68 []byte = []byte(`
<a href="/report/submit/`) <a href="/report/submit/`)
var topic_64 []byte = []byte(`?session=`) var topic_69 []byte = []byte(`?session=`)
var topic_65 []byte = []byte(`&type=reply" class="mod_button" title="Flag Reply"><button class="username report_item">🚩</button></a>&nbsp; var topic_70 []byte = []byte(`&type=reply" class="mod_button" title="Flag Reply"><button class="username report_item">🚩</button></a>&nbsp;
`) `)
var topic_66 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">`) var topic_71 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">`)
var topic_67 []byte = []byte(`</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;margin-left:5px;" title="Like Count">😀</a>`) var topic_72 []byte = []byte(`</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;margin-left:5px;" title="Like Count">😀</a>`)
var topic_68 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;font-size:16px;">`) var topic_73 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;font-size:16px;">`)
var topic_69 []byte = []byte(`</a>`) var topic_74 []byte = []byte(`</a>`)
var topic_70 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">`) var topic_75 []byte = []byte(`<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">`)
var topic_71 []byte = []byte(`</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;" title="Level">👑`) var topic_76 []byte = []byte(`</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;" title="Level">👑`)
var topic_72 []byte = []byte(`</a> var topic_77 []byte = []byte(`</a>
</div> </div>
`) `)
var topic_73 []byte = []byte(`</div> var topic_78 []byte = []byte(`</div>
`) `)
var topic_74 []byte = []byte(` var topic_79 []byte = []byte(`
<div class="rowblock"> <div class="rowblock">
<form action="/reply/create/" method="post"> <form action="/reply/create/" method="post">
<input name="tid" value='`) <input name="tid" value='`)
var topic_75 []byte = []byte(`' type="hidden" /> var topic_80 []byte = []byte(`' type="hidden" />
<div class="formrow"> <div class="formrow">
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div> <div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
</div> </div>
@ -203,31 +204,18 @@ var topic_alt_12 []byte = []byte(`">
var topic_alt_13 []byte = []byte(`</a> var topic_alt_13 []byte = []byte(`</a>
`) `)
var topic_alt_14 []byte = []byte(`<span class='username hide_on_micro topic_status_e topic_status_closed hide_on_edit' title='Status: Closed' style="font-weight:normal;float: right;position:relative;top:-5px;">&#x1F512;&#xFE0E</span>`) var topic_alt_14 []byte = []byte(`<span class='username hide_on_micro topic_status_e topic_status_closed hide_on_edit' title='Status: Closed' style="font-weight:normal;float: right;position:relative;top:-5px;">&#x1F512;&#xFE0E</span>`)
var topic_alt_15 []byte = []byte(`<span class='username hide_on_micro' title='Love it' style="font-weight:normal;float: right;position:relative;top:-5px;">&#x1F5A4;&#xFE0E</span>`) var topic_alt_15 []byte = []byte(`
var topic_alt_16 []byte = []byte(`
<a href='/topic/edit/`)
var topic_alt_17 []byte = []byte(`' class="username hide_on_edit open_edit topic_button" style="font-weight: normal;margin-left: 6px;">Edit</a>
<a href='/topic/delete/submit/`)
var topic_alt_18 []byte = []byte(`' class="username topic_button" style="font-weight: normal;">Delete</a>
`)
var topic_alt_19 []byte = []byte(`<a href='/topic/unstick/submit/`)
var topic_alt_20 []byte = []byte(`' class="username topic_button" style="font-weight: normal;">Unpin</a>`)
var topic_alt_21 []byte = []byte(`<a href='/topic/stick/submit/`)
var topic_alt_22 []byte = []byte(`' class="username topic_button" style="font-weight: normal;">Pin</a>`)
var topic_alt_23 []byte = []byte(`
<input class='show_on_edit topic_name_input' name="topic_name" value='`) <input class='show_on_edit topic_name_input' name="topic_name" value='`)
var topic_alt_24 []byte = []byte(`' type="text" /> var topic_alt_16 []byte = []byte(`' type="text" />
<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'> `)
var topic_alt_17 []byte = []byte(`<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'>
<option>open</option> <option>open</option>
<option>closed</option> <option>closed</option>
</select> </select>`)
var topic_alt_18 []byte = []byte(`
<button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button> <button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button>
`) `)
var topic_alt_25 []byte = []byte(` var topic_alt_19 []byte = []byte(`
<a href="/report/submit/`)
var topic_alt_26 []byte = []byte(`?session=`)
var topic_alt_27 []byte = []byte(`&type=topic" class="username report_item topic_button" style="font-weight: normal;">Report</a>
</div> </div>
</form> </form>
</div> </div>
@ -236,75 +224,96 @@ var topic_alt_27 []byte = []byte(`&type=topic" class="username report_item topic
<div class="rowitem passive deletable_block editable_parent post_item" style="background-color: #eaeaea;padding-top: 4px;padding-left: 5px;clear: both;border-bottom: none;padding-right: 4px;padding-bottom: 2px;"> <div class="rowitem passive deletable_block editable_parent post_item" style="background-color: #eaeaea;padding-top: 4px;padding-left: 5px;clear: both;border-bottom: none;padding-right: 4px;padding-bottom: 2px;">
<div class="userinfo"> <div class="userinfo">
<div class="avatar_item" style="background-image: url(`) <div class="avatar_item" style="background-image: url(`)
var topic_alt_28 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px -10px;">&nbsp;</div> var topic_alt_20 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px -10px;">&nbsp;</div>
<a href="/user/`) <a href="/user/`)
var topic_alt_29 []byte = []byte(`" class="the_name">`) var topic_alt_21 []byte = []byte(`" class="the_name">`)
var topic_alt_30 []byte = []byte(`</a> var topic_alt_22 []byte = []byte(`</a>
`) `)
var topic_alt_31 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">`) var topic_alt_23 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">`)
var topic_alt_32 []byte = []byte(`</div><div class="tag_post"></div></div>`) var topic_alt_24 []byte = []byte(`</div><div class="tag_post"></div></div>`)
var topic_alt_33 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag post_level">Level `) var topic_alt_25 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag post_level">Level `)
var topic_alt_34 []byte = []byte(`</div><div class="tag_post"></div></div>`) var topic_alt_26 []byte = []byte(`</div><div class="tag_post"></div></div>`)
var topic_alt_35 []byte = []byte(` var topic_alt_27 []byte = []byte(`
</div> </div>
<div class="content_container"> <div class="content_container">
<div class="hide_on_edit topic_content user_content">`) <div class="hide_on_edit topic_content user_content">`)
var topic_alt_36 []byte = []byte(`</div> var topic_alt_28 []byte = []byte(`</div>
<textarea name="topic_content" class="show_on_edit topic_content_input">`) <textarea name="topic_content" class="show_on_edit topic_content_input">`)
var topic_alt_37 []byte = []byte(`</textarea> var topic_alt_29 []byte = []byte(`</textarea>
<div class="button_container"> <div class="button_container">
`) `)
var topic_alt_38 []byte = []byte(`<a href="#" title="IP Address" class="action_button action_button_right ip_item">`) var topic_alt_30 []byte = []byte(`<a href="/topic/like/submit/`)
var topic_alt_39 []byte = []byte(`</a>`) var topic_alt_31 []byte = []byte(`" class="action_button">+1</a>`)
var topic_alt_32 []byte = []byte(`<a href="/topic/edit/`)
var topic_alt_33 []byte = []byte(`" class="action_button open_edit">Edit</a>`)
var topic_alt_34 []byte = []byte(`<a href="/topic/delete/submit/`)
var topic_alt_35 []byte = []byte(`" class="action_button delete_item">Delete</a>`)
var topic_alt_36 []byte = []byte(`<a href='/topic/unstick/submit/`)
var topic_alt_37 []byte = []byte(`' class="action_button">Unpin</a>`)
var topic_alt_38 []byte = []byte(`<a href='/topic/stick/submit/`)
var topic_alt_39 []byte = []byte(`' class="action_button">Pin</a>`)
var topic_alt_40 []byte = []byte(` var topic_alt_40 []byte = []byte(`
<a href="/report/submit/`)
var topic_alt_41 []byte = []byte(`?session=`)
var topic_alt_42 []byte = []byte(`&type=topic" class="action_button report_item">Report</a>
`)
var topic_alt_43 []byte = []byte(`<a href="#" title="IP Address" class="action_button action_button_right ip_item hide_on_mobile">`)
var topic_alt_44 []byte = []byte(`</a>`)
var topic_alt_45 []byte = []byte(`<a class="action_button action_button_right hide_on_micro">`)
var topic_alt_46 []byte = []byte(` up</a>`)
var topic_alt_47 []byte = []byte(`
</div> </div>
</div><div style="clear:both;"></div> </div><div style="clear:both;"></div>
</div> </div>
`) `)
var topic_alt_41 []byte = []byte(` var topic_alt_48 []byte = []byte(`
<div class="rowitem passive deletable_block editable_parent post_item"> <div class="rowitem passive deletable_block editable_parent post_item">
<div class="userinfo"> <div class="userinfo">
<div class="avatar_item" style="background-image: url(`) <div class="avatar_item" style="background-image: url(`)
var topic_alt_42 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px -10px;">&nbsp;</div> var topic_alt_49 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px -10px;">&nbsp;</div>
<a href="/user/`) <a href="/user/`)
var topic_alt_43 []byte = []byte(`" class="the_name">`) var topic_alt_50 []byte = []byte(`" class="the_name">`)
var topic_alt_44 []byte = []byte(`</a> var topic_alt_51 []byte = []byte(`</a>
`) `)
var topic_alt_45 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">`) var topic_alt_52 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">`)
var topic_alt_46 []byte = []byte(`</div><div class="tag_post"></div></div>`) var topic_alt_53 []byte = []byte(`</div><div class="tag_post"></div></div>`)
var topic_alt_47 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag post_level">Level `) var topic_alt_54 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag post_level">Level `)
var topic_alt_48 []byte = []byte(`</div><div class="tag_post"></div></div>`) var topic_alt_55 []byte = []byte(`</div><div class="tag_post"></div></div>`)
var topic_alt_49 []byte = []byte(` var topic_alt_56 []byte = []byte(`
</div> </div>
<div class="content_container"> <div class="content_container">
<div class="editable_block user_content">`) <div class="editable_block user_content">`)
var topic_alt_50 []byte = []byte(`</div> var topic_alt_57 []byte = []byte(`</div>
<div class="button_container"> <div class="button_container">
`) `)
var topic_alt_51 []byte = []byte(`<a href="/reply/edit/submit/`) var topic_alt_58 []byte = []byte(`<a href="/reply/like/submit/`)
var topic_alt_52 []byte = []byte(`" class="action_button edit_item">Edit</a>`) var topic_alt_59 []byte = []byte(`" class="action_button">+1</a>`)
var topic_alt_53 []byte = []byte(`<a href="/reply/delete/submit/`) var topic_alt_60 []byte = []byte(`<a href="/reply/edit/submit/`)
var topic_alt_54 []byte = []byte(`" class="action_button delete_item">Delete</a>`) var topic_alt_61 []byte = []byte(`" class="action_button edit_item">Edit</a>`)
var topic_alt_55 []byte = []byte(` var topic_alt_62 []byte = []byte(`<a href="/reply/delete/submit/`)
var topic_alt_63 []byte = []byte(`" class="action_button delete_item">Delete</a>`)
var topic_alt_64 []byte = []byte(`
<a href="/report/submit/`) <a href="/report/submit/`)
var topic_alt_56 []byte = []byte(`?session=`) var topic_alt_65 []byte = []byte(`?session=`)
var topic_alt_57 []byte = []byte(`&type=reply" class="action_button report_item">Report</a> var topic_alt_66 []byte = []byte(`&type=reply" class="action_button report_item">Report</a>
`) `)
var topic_alt_58 []byte = []byte(`<a href="#" title="IP Address" class="action_button action_button_right ip_item">`) var topic_alt_67 []byte = []byte(`<a href="#" title="IP Address" class="action_button action_button_right ip_item hide_on_mobile">`)
var topic_alt_59 []byte = []byte(`</a>`) var topic_alt_68 []byte = []byte(`</a>`)
var topic_alt_60 []byte = []byte(` var topic_alt_69 []byte = []byte(`<a class="action_button action_button_right hide_on_micro">`)
var topic_alt_70 []byte = []byte(` up</a>`)
var topic_alt_71 []byte = []byte(`
</div> </div>
</div> </div>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
`) `)
var topic_alt_61 []byte = []byte(`</div> var topic_alt_72 []byte = []byte(`</div>
`) `)
var topic_alt_62 []byte = []byte(` var topic_alt_73 []byte = []byte(`
<div class="rowblock" style="border-top: none;"> <div class="rowblock" style="border-top: none;">
<form action="/reply/create/" method="post"> <form action="/reply/create/" method="post">
<input name="tid" value='`) <input name="tid" value='`)
var topic_alt_63 []byte = []byte(`' type="hidden" /> var topic_alt_74 []byte = []byte(`' type="hidden" />
<div class="formrow"> <div class="formrow">
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div> <div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
</div> </div>

View File

@ -74,136 +74,151 @@ w.Write(topic_13)
if tmpl_topic_vars.Topic.Is_Closed { if tmpl_topic_vars.Topic.Is_Closed {
w.Write(topic_14) w.Write(topic_14)
} }
if tmpl_topic_vars.CurrentUser.Is_Mod { if tmpl_topic_vars.CurrentUser.Perms.EditTopic {
w.Write(topic_15) w.Write(topic_15)
w.Write([]byte(tmpl_topic_vars.Topic.Title)) w.Write([]byte(tmpl_topic_vars.Topic.Title))
w.Write(topic_16) w.Write(topic_16)
} if tmpl_topic_vars.CurrentUser.Perms.CloseTopic {
w.Write(topic_17) w.Write(topic_17)
if tmpl_topic_vars.Topic.Avatar != "" {
w.Write(topic_18)
w.Write([]byte(tmpl_topic_vars.Topic.Avatar))
w.Write(topic_19)
if tmpl_topic_vars.Topic.ContentLines <= 5 {
w.Write(topic_20)
} }
w.Write(topic_18)
}
w.Write(topic_19)
if tmpl_topic_vars.Topic.Avatar != "" {
w.Write(topic_20)
w.Write([]byte(tmpl_topic_vars.Topic.Avatar))
w.Write(topic_21) w.Write(topic_21)
if tmpl_topic_vars.Topic.ContentLines <= 5 {
w.Write(topic_22)
}
w.Write(topic_23)
w.Write([]byte(string(tmpl_topic_vars.Topic.Css))) w.Write([]byte(string(tmpl_topic_vars.Topic.Css)))
} }
w.Write(topic_22)
w.Write([]byte(tmpl_topic_vars.Topic.Content))
w.Write(topic_23)
w.Write([]byte(tmpl_topic_vars.Topic.Content))
w.Write(topic_24) w.Write(topic_24)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.CreatedBy))) w.Write([]byte(tmpl_topic_vars.Topic.Content))
w.Write(topic_25) w.Write(topic_25)
w.Write([]byte(tmpl_topic_vars.Topic.CreatedByName)) w.Write([]byte(tmpl_topic_vars.Topic.Content))
w.Write(topic_26) w.Write(topic_26)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.CreatedBy)))
w.Write(topic_27) w.Write(topic_27)
if tmpl_topic_vars.Topic.Liked { w.Write([]byte(tmpl_topic_vars.Topic.CreatedByName))
w.Write(topic_28) w.Write(topic_28)
} if tmpl_topic_vars.CurrentUser.Perms.LikeItem {
w.Write(topic_29) w.Write(topic_29)
if tmpl_topic_vars.CurrentUser.Is_Mod { w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID)))
w.Write(topic_30) w.Write(topic_30)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) if tmpl_topic_vars.Topic.Liked {
w.Write(topic_31) w.Write(topic_31)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) }
w.Write(topic_32) w.Write(topic_32)
if tmpl_topic_vars.Topic.Sticky { }
if tmpl_topic_vars.CurrentUser.Perms.EditTopic {
w.Write(topic_33) w.Write(topic_33)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID)))
w.Write(topic_34) w.Write(topic_34)
} else { }
if tmpl_topic_vars.CurrentUser.Perms.DeleteTopic {
w.Write(topic_35) w.Write(topic_35)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID)))
w.Write(topic_36) w.Write(topic_36)
} }
} if tmpl_topic_vars.CurrentUser.Perms.PinTopic {
if tmpl_topic_vars.Topic.Sticky {
w.Write(topic_37) w.Write(topic_37)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID)))
w.Write(topic_38) w.Write(topic_38)
w.Write([]byte(tmpl_topic_vars.CurrentUser.Session))
w.Write(topic_39)
if tmpl_topic_vars.Topic.LikeCount > 0 {
w.Write(topic_40)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.LikeCount)))
w.Write(topic_41)
}
if tmpl_topic_vars.Topic.Tag != "" {
w.Write(topic_42)
w.Write([]byte(tmpl_topic_vars.Topic.Tag))
w.Write(topic_43)
} else { } else {
w.Write(topic_39)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID)))
w.Write(topic_40)
}
}
w.Write(topic_41)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID)))
w.Write(topic_42)
w.Write([]byte(tmpl_topic_vars.CurrentUser.Session))
w.Write(topic_43)
if tmpl_topic_vars.Topic.LikeCount > 0 {
w.Write(topic_44) w.Write(topic_44)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.Level))) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.LikeCount)))
w.Write(topic_45) w.Write(topic_45)
} }
if tmpl_topic_vars.Topic.Tag != "" {
w.Write(topic_46) w.Write(topic_46)
w.Write([]byte(tmpl_topic_vars.Topic.Tag))
w.Write(topic_47)
} else {
w.Write(topic_48)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.Level)))
w.Write(topic_49)
}
w.Write(topic_50)
if len(tmpl_topic_vars.ItemList) != 0 { if len(tmpl_topic_vars.ItemList) != 0 {
for _, item := range tmpl_topic_vars.ItemList { for _, item := range tmpl_topic_vars.ItemList {
w.Write(topic_47)
if item.Avatar != "" {
w.Write(topic_48)
w.Write([]byte(item.Avatar))
w.Write(topic_49)
if item.ContentLines <= 5 {
w.Write(topic_50)
}
w.Write(topic_51) w.Write(topic_51)
if item.Avatar != "" {
w.Write(topic_52)
w.Write([]byte(item.Avatar))
w.Write(topic_53)
if item.ContentLines <= 5 {
w.Write(topic_54)
}
w.Write(topic_55)
w.Write([]byte(string(item.Css))) w.Write([]byte(string(item.Css)))
} }
w.Write(topic_52)
w.Write([]byte(item.ContentHtml))
w.Write(topic_53)
w.Write([]byte(strconv.Itoa(item.CreatedBy)))
w.Write(topic_54)
w.Write([]byte(item.CreatedByName))
w.Write(topic_55)
w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_56) w.Write(topic_56)
if item.Liked { w.Write([]byte(item.ContentHtml))
w.Write(topic_57) w.Write(topic_57)
} w.Write([]byte(strconv.Itoa(item.CreatedBy)))
w.Write(topic_58) w.Write(topic_58)
if tmpl_topic_vars.CurrentUser.Perms.EditReply { w.Write([]byte(item.CreatedByName))
w.Write(topic_59) w.Write(topic_59)
w.Write([]byte(strconv.Itoa(item.ID))) if tmpl_topic_vars.CurrentUser.Perms.LikeItem {
w.Write(topic_60) w.Write(topic_60)
}
if tmpl_topic_vars.CurrentUser.Perms.DeleteReply {
w.Write(topic_61)
w.Write([]byte(strconv.Itoa(item.ID))) w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_61)
if item.Liked {
w.Write(topic_62) w.Write(topic_62)
} }
w.Write(topic_63) w.Write(topic_63)
w.Write([]byte(strconv.Itoa(item.ID))) }
if tmpl_topic_vars.CurrentUser.Perms.EditReply {
w.Write(topic_64) w.Write(topic_64)
w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_65) w.Write(topic_65)
if item.LikeCount > 0 { }
if tmpl_topic_vars.CurrentUser.Perms.DeleteReply {
w.Write(topic_66) w.Write(topic_66)
w.Write([]byte(strconv.Itoa(item.LikeCount))) w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_67) w.Write(topic_67)
} }
if item.Tag != "" {
w.Write(topic_68) w.Write(topic_68)
w.Write([]byte(item.Tag)) w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_69) w.Write(topic_69)
} else { w.Write([]byte(tmpl_topic_vars.CurrentUser.Session))
w.Write(topic_70) w.Write(topic_70)
w.Write([]byte(strconv.Itoa(item.Level))) if item.LikeCount > 0 {
w.Write(topic_71) w.Write(topic_71)
} w.Write([]byte(strconv.Itoa(item.LikeCount)))
w.Write(topic_72) w.Write(topic_72)
} }
} if item.Tag != "" {
w.Write(topic_73) w.Write(topic_73)
if tmpl_topic_vars.CurrentUser.Perms.CreateReply { w.Write([]byte(item.Tag))
w.Write(topic_74) w.Write(topic_74)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) } else {
w.Write(topic_75) w.Write(topic_75)
w.Write([]byte(strconv.Itoa(item.Level)))
w.Write(topic_76)
}
w.Write(topic_77)
}
}
w.Write(topic_78)
if tmpl_topic_vars.CurrentUser.Perms.CreateReply {
w.Write(topic_79)
w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID)))
w.Write(topic_80)
} }
w.Write(footer_0) w.Write(footer_0)
} }

View File

@ -73,108 +73,138 @@ w.Write([]byte(tmpl_topic_alt_vars.Topic.Title))
w.Write(topic_alt_13) w.Write(topic_alt_13)
if tmpl_topic_alt_vars.Topic.Is_Closed { if tmpl_topic_alt_vars.Topic.Is_Closed {
w.Write(topic_alt_14) w.Write(topic_alt_14)
} else { }
if tmpl_topic_alt_vars.CurrentUser.Perms.EditTopic {
w.Write(topic_alt_15) w.Write(topic_alt_15)
}
if tmpl_topic_alt_vars.CurrentUser.Is_Mod {
w.Write(topic_alt_16)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_17)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_18)
if tmpl_topic_alt_vars.Topic.Sticky {
w.Write(topic_alt_19)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_20)
} else {
w.Write(topic_alt_21)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_22)
}
w.Write(topic_alt_23)
w.Write([]byte(tmpl_topic_alt_vars.Topic.Title)) w.Write([]byte(tmpl_topic_alt_vars.Topic.Title))
w.Write(topic_alt_24) w.Write(topic_alt_16)
if tmpl_topic_alt_vars.CurrentUser.Perms.CloseTopic {
w.Write(topic_alt_17)
} }
w.Write(topic_alt_25) w.Write(topic_alt_18)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) }
w.Write(topic_alt_26) w.Write(topic_alt_19)
w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session))
w.Write(topic_alt_27)
w.Write([]byte(tmpl_topic_alt_vars.Topic.Avatar)) w.Write([]byte(tmpl_topic_alt_vars.Topic.Avatar))
w.Write(topic_alt_28) w.Write(topic_alt_20)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.CreatedBy))) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.CreatedBy)))
w.Write(topic_alt_29) w.Write(topic_alt_21)
w.Write([]byte(tmpl_topic_alt_vars.Topic.CreatedByName)) w.Write([]byte(tmpl_topic_alt_vars.Topic.CreatedByName))
w.Write(topic_alt_30) w.Write(topic_alt_22)
if tmpl_topic_alt_vars.Topic.Tag != "" { if tmpl_topic_alt_vars.Topic.Tag != "" {
w.Write(topic_alt_31) w.Write(topic_alt_23)
w.Write([]byte(tmpl_topic_alt_vars.Topic.Tag)) w.Write([]byte(tmpl_topic_alt_vars.Topic.Tag))
w.Write(topic_alt_32) w.Write(topic_alt_24)
} else { } else {
w.Write(topic_alt_33) w.Write(topic_alt_25)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.Level))) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.Level)))
w.Write(topic_alt_34) w.Write(topic_alt_26)
} }
w.Write(topic_alt_27)
w.Write([]byte(tmpl_topic_alt_vars.Topic.Content))
w.Write(topic_alt_28)
w.Write([]byte(tmpl_topic_alt_vars.Topic.Content))
w.Write(topic_alt_29)
if tmpl_topic_alt_vars.CurrentUser.Perms.LikeItem {
w.Write(topic_alt_30)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_31)
}
if tmpl_topic_alt_vars.CurrentUser.Perms.EditTopic {
w.Write(topic_alt_32)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_33)
}
if tmpl_topic_alt_vars.CurrentUser.Perms.DeleteTopic {
w.Write(topic_alt_34)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_35) w.Write(topic_alt_35)
w.Write([]byte(tmpl_topic_alt_vars.Topic.Content)) }
if tmpl_topic_alt_vars.CurrentUser.Perms.PinTopic {
if tmpl_topic_alt_vars.Topic.Sticky {
w.Write(topic_alt_36) w.Write(topic_alt_36)
w.Write([]byte(tmpl_topic_alt_vars.Topic.Content)) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_37) w.Write(topic_alt_37)
if tmpl_topic_alt_vars.CurrentUser.Perms.ViewIPs { } else {
w.Write(topic_alt_38) w.Write(topic_alt_38)
w.Write([]byte(tmpl_topic_alt_vars.Topic.IpAddress)) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_39) w.Write(topic_alt_39)
} }
}
w.Write(topic_alt_40) w.Write(topic_alt_40)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_41)
w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session))
w.Write(topic_alt_42)
if tmpl_topic_alt_vars.CurrentUser.Perms.ViewIPs {
w.Write(topic_alt_43)
w.Write([]byte(tmpl_topic_alt_vars.Topic.IpAddress))
w.Write(topic_alt_44)
}
if tmpl_topic_alt_vars.Topic.LikeCount > 0 {
w.Write(topic_alt_45)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.LikeCount)))
w.Write(topic_alt_46)
}
w.Write(topic_alt_47)
if len(tmpl_topic_alt_vars.ItemList) != 0 { if len(tmpl_topic_alt_vars.ItemList) != 0 {
for _, item := range tmpl_topic_alt_vars.ItemList { for _, item := range tmpl_topic_alt_vars.ItemList {
w.Write(topic_alt_41)
w.Write([]byte(item.Avatar))
w.Write(topic_alt_42)
w.Write([]byte(strconv.Itoa(item.CreatedBy)))
w.Write(topic_alt_43)
w.Write([]byte(item.CreatedByName))
w.Write(topic_alt_44)
if item.Tag != "" {
w.Write(topic_alt_45)
w.Write([]byte(item.Tag))
w.Write(topic_alt_46)
} else {
w.Write(topic_alt_47)
w.Write([]byte(strconv.Itoa(item.Level)))
w.Write(topic_alt_48) w.Write(topic_alt_48)
} w.Write([]byte(item.Avatar))
w.Write(topic_alt_49) w.Write(topic_alt_49)
w.Write([]byte(item.ContentHtml)) w.Write([]byte(strconv.Itoa(item.CreatedBy)))
w.Write(topic_alt_50) w.Write(topic_alt_50)
if tmpl_topic_alt_vars.CurrentUser.Perms.EditReply { w.Write([]byte(item.CreatedByName))
w.Write(topic_alt_51) w.Write(topic_alt_51)
w.Write([]byte(strconv.Itoa(item.ID))) if item.Tag != "" {
w.Write(topic_alt_52) w.Write(topic_alt_52)
} w.Write([]byte(item.Tag))
if tmpl_topic_alt_vars.CurrentUser.Perms.DeleteReply {
w.Write(topic_alt_53) w.Write(topic_alt_53)
w.Write([]byte(strconv.Itoa(item.ID))) } else {
w.Write(topic_alt_54) w.Write(topic_alt_54)
} w.Write([]byte(strconv.Itoa(item.Level)))
w.Write(topic_alt_55) w.Write(topic_alt_55)
w.Write([]byte(strconv.Itoa(item.ID))) }
w.Write(topic_alt_56) w.Write(topic_alt_56)
w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write([]byte(item.ContentHtml))
w.Write(topic_alt_57) w.Write(topic_alt_57)
if tmpl_topic_alt_vars.CurrentUser.Perms.ViewIPs { if tmpl_topic_alt_vars.CurrentUser.Perms.LikeItem {
w.Write(topic_alt_58) w.Write(topic_alt_58)
w.Write([]byte(item.IpAddress)) w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_alt_59) w.Write(topic_alt_59)
} }
if tmpl_topic_alt_vars.CurrentUser.Perms.EditReply {
w.Write(topic_alt_60) w.Write(topic_alt_60)
} w.Write([]byte(strconv.Itoa(item.ID)))
}
w.Write(topic_alt_61) w.Write(topic_alt_61)
if tmpl_topic_alt_vars.CurrentUser.Perms.CreateReply { }
if tmpl_topic_alt_vars.CurrentUser.Perms.DeleteReply {
w.Write(topic_alt_62) w.Write(topic_alt_62)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_alt_63) w.Write(topic_alt_63)
} }
w.Write(topic_alt_64)
w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_alt_65)
w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session))
w.Write(topic_alt_66)
if tmpl_topic_alt_vars.CurrentUser.Perms.ViewIPs {
w.Write(topic_alt_67)
w.Write([]byte(item.IpAddress))
w.Write(topic_alt_68)
}
if item.LikeCount > 0 {
w.Write(topic_alt_69)
w.Write([]byte(strconv.Itoa(item.LikeCount)))
w.Write(topic_alt_70)
}
w.Write(topic_alt_71)
}
}
w.Write(topic_alt_72)
if tmpl_topic_alt_vars.CurrentUser.Perms.CreateReply {
w.Write(topic_alt_73)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_74)
}
w.Write(footer_0) w.Write(footer_0)
} }

View File

@ -7,12 +7,12 @@
<div class="rowitem topic_item"{{if .Topic.Sticky}} style="background-color:#FFFFEA;"{{else if .Topic.Is_Closed}} style="background-color:#eaeaea;"{{end}}> <div class="rowitem topic_item"{{if .Topic.Sticky}} style="background-color:#FFFFEA;"{{else if .Topic.Is_Closed}} style="background-color:#eaeaea;"{{end}}>
<a class='topic_name hide_on_edit'>{{.Topic.Title}}</a> <a class='topic_name hide_on_edit'>{{.Topic.Title}}</a>
{{if .Topic.Is_Closed}}<span class='username hide_on_micro topic_status_e topic_status_closed hide_on_edit' title='Status: Closed' style="font-weight:normal;float: right;position:relative;top:-5px;">&#x1F512;&#xFE0E</span>{{end}} {{if .Topic.Is_Closed}}<span class='username hide_on_micro topic_status_e topic_status_closed hide_on_edit' title='Status: Closed' style="font-weight:normal;float: right;position:relative;top:-5px;">&#x1F512;&#xFE0E</span>{{end}}
{{if .CurrentUser.Is_Mod}} {{if .CurrentUser.Perms.EditTopic}}
<input class='show_on_edit topic_name_input' name="topic_name" value='{{.Topic.Title}}' type="text" /> <input class='show_on_edit topic_name_input' name="topic_name" value='{{.Topic.Title}}' type="text" />
<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'> {{if .CurrentUser.Perms.CloseTopic}}<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'>
<option>open</option> <option>open</option>
<option>closed</option> <option>closed</option>
</select> </select>{{end}}
<button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button> <button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button>
{{end}} {{end}}
</div> </div>
@ -23,11 +23,10 @@
<p class="hide_on_edit topic_content user_content" style="margin:0;padding:0;">{{.Topic.Content}}</p> <p class="hide_on_edit topic_content user_content" style="margin:0;padding:0;">{{.Topic.Content}}</p>
<textarea name="topic_content" class="show_on_edit topic_content_input">{{.Topic.Content}}</textarea><br /><br /> <textarea name="topic_content" class="show_on_edit topic_content_input">{{.Topic.Content}}</textarea><br /><br />
<a href="/user/{{.Topic.CreatedBy}}" class="username real_username">{{.Topic.CreatedByName}}</a>&nbsp; <a href="/user/{{.Topic.CreatedBy}}" class="username real_username">{{.Topic.CreatedByName}}</a>&nbsp;
<a href="/topic/like/submit/{{.Topic.ID}}" class="mod_button" title="Love it" style="color:#202020;"><button class="username" style="{{if .Topic.Liked}}background-color:/*#eaffea*/#D6FFD6;{{end}}">😀</button></a>&nbsp; {{if .CurrentUser.Perms.LikeItem}}<a href="/topic/like/submit/{{.Topic.ID}}" class="mod_button" title="Love it" style="color:#202020;"><button class="username" style="{{if .Topic.Liked}}background-color:/*#eaffea*/#D6FFD6;{{end}}">😀</button></a>&nbsp;{{end}}
{{if .CurrentUser.Is_Mod}}<a href='/topic/edit/{{.Topic.ID}}' class="mod_button open_edit" style="font-weight:normal;" title="Edit Topic"><button class="username">🖊️</button></a>&nbsp; {{if .CurrentUser.Perms.EditTopic}}<a href='/topic/edit/{{.Topic.ID}}' class="mod_button open_edit" style="font-weight:normal;" title="Edit Topic"><button class="username">🖊️</button></a>&nbsp;{{end}}
<a href='/topic/delete/submit/{{.Topic.ID}}' class="mod_button" style="font-weight:normal;" title="Delete Topic"><button class="username">🗑️</button></a>&nbsp; {{if .CurrentUser.Perms.DeleteTopic}}<a href='/topic/delete/submit/{{.Topic.ID}}' class="mod_button" style="font-weight:normal;" title="Delete Topic"><button class="username">🗑️</button></a>&nbsp;{{end}}
{{if .Topic.Sticky}}<a class="mod_button" href='/topic/unstick/submit/{{.Topic.ID}}' style="font-weight:normal;" title="Unpin Topic"><button class="username" style="background-color:/*#eaffea*/#D6FFD6;">📌</button></a>{{else}}<a href='/topic/stick/submit/{{.Topic.ID}}' class="mod_button" style="font-weight:normal;" title="Pin Topic"><button class="username">📌</button></a>{{end}} {{if .CurrentUser.Perms.PinTopic}}{{if .Topic.Sticky}}<a class="mod_button" href='/topic/unstick/submit/{{.Topic.ID}}' style="font-weight:normal;" title="Unpin Topic"><button class="username" style="background-color:/*#eaffea*/#D6FFD6;">📌</button></a>{{else}}<a href='/topic/stick/submit/{{.Topic.ID}}' class="mod_button" style="font-weight:normal;" title="Pin Topic"><button class="username">📌</button></a>&nbsp;{{end}}{{end}}
{{end}}&nbsp;
<a href="/report/submit/{{.Topic.ID}}?session={{.CurrentUser.Session}}&type=topic" class="mod_button report_item" style="font-weight:normal;" title="Flag Topic"><button class="username">🚩</button></a>&nbsp; <a href="/report/submit/{{.Topic.ID}}?session={{.CurrentUser.Session}}&type=topic" class="mod_button report_item" style="font-weight:normal;" title="Flag Topic"><button class="username">🚩</button></a>&nbsp;
{{if .Topic.LikeCount}}<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">{{.Topic.LikeCount}}</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;margin-left:5px;" title="Like Count">😀</a>{{end}} {{if .Topic.LikeCount}}<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">{{.Topic.LikeCount}}</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;margin-left:5px;" title="Like Count">😀</a>{{end}}
{{if .Topic.Tag}}<a class="username hide_on_micro" style="float:right;color:#505050;font-size:16px;">{{.Topic.Tag}}</a>{{else}}<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">{{.Topic.Level}}</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;" title="Level">👑</a>{{end}} {{if .Topic.Tag}}<a class="username hide_on_micro" style="float:right;color:#505050;font-size:16px;">{{.Topic.Tag}}</a>{{else}}<a class="username hide_on_micro" style="float: right;color:#505050;border-left:none;padding-left:5px;padding-right:5px;font-size:17px;">{{.Topic.Level}}</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;" title="Level">👑</a>{{end}}
@ -37,7 +36,7 @@
<div class="rowitem rowhead passive deletable_block editable_parent post_item" style="{{if .Avatar}}background-image:url({{.Avatar}}), url(/static/white-dot.jpg);background-position: 0px {{if le .ContentLines 5}}-1{{end}}0px;background-repeat:no-repeat, repeat-y;background-size:128px;padding-left:136px;{{.Css}}{{end}}"> <div class="rowitem rowhead passive deletable_block editable_parent post_item" style="{{if .Avatar}}background-image:url({{.Avatar}}), url(/static/white-dot.jpg);background-position: 0px {{if le .ContentLines 5}}-1{{end}}0px;background-repeat:no-repeat, repeat-y;background-size:128px;padding-left:136px;{{.Css}}{{end}}">
<p class="editable_block user_content" style="margin: 0;padding: 0;">{{.ContentHtml}}</p><br /><br /> <p class="editable_block user_content" style="margin: 0;padding: 0;">{{.ContentHtml}}</p><br /><br />
<a href="/user/{{.CreatedBy}}" class="username real_username">{{.CreatedByName}}</a>&nbsp; <a href="/user/{{.CreatedBy}}" class="username real_username">{{.CreatedByName}}</a>&nbsp;
<a href="/reply/like/submit/{{.ID}}" class="mod_button" title="Love it" style="color:#202020;"><button class="username" style="{{if .Liked}}background-color:/*#eaffea*/#D6FFD6;{{end}}">😀</button></a>&nbsp; {{if $.CurrentUser.Perms.LikeItem}}<a href="/reply/like/submit/{{.ID}}" class="mod_button" title="Love it" style="color:#202020;"><button class="username" style="{{if .Liked}}background-color:/*#eaffea*/#D6FFD6;{{end}}">😀</button></a>&nbsp;{{end}}
{{if $.CurrentUser.Perms.EditReply}}<a href="/reply/edit/submit/{{.ID}}" class="mod_button" title="Edit Reply"><button class="username edit_item">🖊️</button></a>&nbsp;{{end}} {{if $.CurrentUser.Perms.EditReply}}<a href="/reply/edit/submit/{{.ID}}" class="mod_button" title="Edit Reply"><button class="username edit_item">🖊️</button></a>&nbsp;{{end}}
{{if $.CurrentUser.Perms.DeleteReply}}<a href="/reply/delete/submit/{{.ID}}" class="mod_button" title="Delete Reply"><button class="username delete_item">🗑️</button></a>&nbsp;{{end}} {{if $.CurrentUser.Perms.DeleteReply}}<a href="/reply/delete/submit/{{.ID}}" class="mod_button" title="Delete Reply"><button class="username delete_item">🗑️</button></a>&nbsp;{{end}}
<a href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=reply" class="mod_button" title="Flag Reply"><button class="username report_item">🚩</button></a>&nbsp; <a href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=reply" class="mod_button" title="Flag Reply"><button class="username report_item">🚩</button></a>&nbsp;

View File

@ -6,20 +6,15 @@
<form action='/topic/edit/submit/{{.Topic.ID}}' method="post"> <form action='/topic/edit/submit/{{.Topic.ID}}' method="post">
<div class="rowitem topic_item rowhead{{if .Topic.Sticky}} topic_sticky_head{{else if .Topic.Is_Closed}} topic_closed_head{{end}}"> <div class="rowitem topic_item rowhead{{if .Topic.Sticky}} topic_sticky_head{{else if .Topic.Is_Closed}} topic_closed_head{{end}}">
<a class='topic_name hide_on_edit'>{{.Topic.Title}}</a> <a class='topic_name hide_on_edit'>{{.Topic.Title}}</a>
{{if .Topic.Is_Closed}}<span class='username hide_on_micro topic_status_e topic_status_closed hide_on_edit' title='Status: Closed' style="font-weight:normal;float: right;position:relative;top:-5px;">&#x1F512;&#xFE0E</span>{{else}}<span class='username hide_on_micro' title='Love it' style="font-weight:normal;float: right;position:relative;top:-5px;">&#x1F5A4;&#xFE0E</span>{{end}} {{if .Topic.Is_Closed}}<span class='username hide_on_micro topic_status_e topic_status_closed hide_on_edit' title='Status: Closed' style="font-weight:normal;float: right;position:relative;top:-5px;">&#x1F512;&#xFE0E</span>{{end}}
{{if .CurrentUser.Is_Mod}} {{if .CurrentUser.Perms.EditTopic}}
<a href='/topic/edit/{{.Topic.ID}}' class="username hide_on_edit open_edit topic_button" style="font-weight: normal;margin-left: 6px;">Edit</a>
<a href='/topic/delete/submit/{{.Topic.ID}}' class="username topic_button" style="font-weight: normal;">Delete</a>
{{if .Topic.Sticky}}<a href='/topic/unstick/submit/{{.Topic.ID}}' class="username topic_button" style="font-weight: normal;">Unpin</a>{{else}}<a href='/topic/stick/submit/{{.Topic.ID}}' class="username topic_button" style="font-weight: normal;">Pin</a>{{end}}
<input class='show_on_edit topic_name_input' name="topic_name" value='{{.Topic.Title}}' type="text" /> <input class='show_on_edit topic_name_input' name="topic_name" value='{{.Topic.Title}}' type="text" />
<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'> {{if .CurrentUser.Perms.CloseTopic}}<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'>
<option>open</option> <option>open</option>
<option>closed</option> <option>closed</option>
</select> </select>{{end}}
<button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button> <button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button>
{{end}} {{end}}
<a href="/report/submit/{{.Topic.ID}}?session={{.CurrentUser.Session}}&type=topic" class="username report_item topic_button" style="font-weight: normal;">Report</a>
</div> </div>
</form> </form>
</div> </div>
@ -35,8 +30,15 @@
<div class="hide_on_edit topic_content user_content">{{.Topic.Content}}</div> <div class="hide_on_edit topic_content user_content">{{.Topic.Content}}</div>
<textarea name="topic_content" class="show_on_edit topic_content_input">{{.Topic.Content}}</textarea> <textarea name="topic_content" class="show_on_edit topic_content_input">{{.Topic.Content}}</textarea>
<div class="button_container"> <div class="button_container">
{{if .CurrentUser.Perms.LikeItem}}<a href="/topic/like/submit/{{.Topic.ID}}" class="action_button">+1</a>{{end}}
{{if .CurrentUser.Perms.EditTopic}}<a href="/topic/edit/{{.Topic.ID}}" class="action_button open_edit">Edit</a>{{end}}
{{if .CurrentUser.Perms.DeleteTopic}}<a href="/topic/delete/submit/{{.Topic.ID}}" class="action_button delete_item">Delete</a>{{end}}
{{if .CurrentUser.Perms.PinTopic}}
{{if .Topic.Sticky}}<a href='/topic/unstick/submit/{{.Topic.ID}}' class="action_button">Unpin</a>{{else}}<a href='/topic/stick/submit/{{.Topic.ID}}' class="action_button">Pin</a>{{end}}{{end}}
<a href="/report/submit/{{.Topic.ID}}?session={{.CurrentUser.Session}}&type=topic" class="action_button report_item">Report</a>
{{/* Element Queries might help with having to use JS. Unfortunately, the W3C is taking a while with it */}} {{/* Element Queries might help with having to use JS. Unfortunately, the W3C is taking a while with it */}}
{{if $.CurrentUser.Perms.ViewIPs}}<a href="#" title="IP Address" class="action_button action_button_right ip_item">{{.Topic.IpAddress}}</a>{{end}} {{if .CurrentUser.Perms.ViewIPs}}<a href="#" title="IP Address" class="action_button action_button_right ip_item hide_on_mobile">{{.Topic.IpAddress}}</a>{{end}}
{{if .Topic.LikeCount}}<a class="action_button action_button_right hide_on_micro">{{.Topic.LikeCount}} up</a>{{end}}
</div> </div>
</div><div style="clear:both;"></div> </div><div style="clear:both;"></div>
</div> </div>
@ -50,10 +52,12 @@
<div class="content_container"> <div class="content_container">
<div class="editable_block user_content">{{.ContentHtml}}</div> <div class="editable_block user_content">{{.ContentHtml}}</div>
<div class="button_container"> <div class="button_container">
{{if $.CurrentUser.Perms.LikeItem}}<a href="/reply/like/submit/{{.ID}}" class="action_button">+1</a>{{end}}
{{if $.CurrentUser.Perms.EditReply}}<a href="/reply/edit/submit/{{.ID}}" class="action_button edit_item">Edit</a>{{end}} {{if $.CurrentUser.Perms.EditReply}}<a href="/reply/edit/submit/{{.ID}}" class="action_button edit_item">Edit</a>{{end}}
{{if $.CurrentUser.Perms.DeleteReply}}<a href="/reply/delete/submit/{{.ID}}" class="action_button delete_item">Delete</a>{{end}} {{if $.CurrentUser.Perms.DeleteReply}}<a href="/reply/delete/submit/{{.ID}}" class="action_button delete_item">Delete</a>{{end}}
<a href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=reply" class="action_button report_item">Report</a> <a href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=reply" class="action_button report_item">Report</a>
{{if $.CurrentUser.Perms.ViewIPs}}<a href="#" title="IP Address" class="action_button action_button_right ip_item">{{.IpAddress}}</a>{{end}} {{if $.CurrentUser.Perms.ViewIPs}}<a href="#" title="IP Address" class="action_button action_button_right ip_item hide_on_mobile">{{.IpAddress}}</a>{{end}}
{{if .LikeCount}}<a class="action_button action_button_right hide_on_micro">{{.LikeCount}} up</a>{{end}}
</div> </div>
</div> </div>
<div style="clear:both;"></div> <div style="clear:both;"></div>

10
user.go
View File

@ -96,7 +96,7 @@ func (sts *StaticUserStore) CascadeGet(id int) (*User, error) {
return user, nil return user, nil
} }
user = &User{ID:id} user = &User{ID:id,Loggedin:true}
err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP) err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP)
if user.Avatar != "" { if user.Avatar != "" {
@ -115,7 +115,7 @@ func (sts *StaticUserStore) CascadeGet(id int) (*User, error) {
} }
func (sts *StaticUserStore) Load(id int) error { func (sts *StaticUserStore) Load(id int) error {
user := &User{ID:id} user := &User{ID:id,Loggedin:true}
err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP) err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP)
if err != nil { if err != nil {
return err return err
@ -209,7 +209,7 @@ func NewSqlUserStore() *SqlUserStore {
} }
func (sus *SqlUserStore) Get(id int) (*User, error) { func (sus *SqlUserStore) Get(id int) (*User, error) {
user := User{ID:id} user := User{ID:id,Loggedin:true}
err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP) err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP)
if user.Avatar != "" { if user.Avatar != "" {
@ -225,7 +225,7 @@ func (sus *SqlUserStore) Get(id int) (*User, error) {
} }
func (sus *SqlUserStore) GetUnsafe(id int) (*User, error) { func (sus *SqlUserStore) GetUnsafe(id int) (*User, error) {
user := User{ID:id} user := User{ID:id,Loggedin:true}
err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP) err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP)
if user.Avatar != "" { if user.Avatar != "" {
@ -241,7 +241,7 @@ func (sus *SqlUserStore) GetUnsafe(id int) (*User, error) {
} }
func (sus *SqlUserStore) CascadeGet(id int) (*User, error) { func (sus *SqlUserStore) CascadeGet(id int) (*User, error) {
user := User{ID:id} user := User{ID:id,Loggedin:true}
err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP) err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP)
if user.Avatar != "" { if user.Avatar != "" {