2017-01-01 15:45:43 +00:00
|
|
|
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
|
2016-12-16 10:37:42 +00:00
|
|
|
package main
|
2016-12-17 03:39:53 +00:00
|
|
|
import "io"
|
2016-12-16 10:37:42 +00:00
|
|
|
import "strconv"
|
2016-12-17 03:39:53 +00:00
|
|
|
import "html/template"
|
2016-12-16 10:37:42 +00:00
|
|
|
|
|
|
|
func init() {
|
2017-01-01 15:45:43 +00:00
|
|
|
template_topic_handle = template_topic
|
|
|
|
//o_template_topic_handle = template_topic
|
|
|
|
ctemplates = append(ctemplates,"topic")
|
|
|
|
tmpl_ptr_map["topic"] = &template_topic_handle
|
|
|
|
tmpl_ptr_map["o_topic"] = template_topic
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
|
|
|
|
2016-12-21 02:30:32 +00:00
|
|
|
func template_topic(tmpl_topic_vars TopicPage, w io.Writer) {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`<!doctype html>
|
2016-12-16 10:37:42 +00:00
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2016-12-17 03:39:53 +00:00
|
|
|
<title>` + tmpl_topic_vars.Title + `</title>
|
2016-12-16 10:37:42 +00:00
|
|
|
<link href="/static/main.css" rel="stylesheet" type="text/css">
|
|
|
|
<script type="text/javascript" src="/static/jquery-1.12.3.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
2016-12-17 03:39:53 +00:00
|
|
|
var session = "` + tmpl_topic_vars.CurrentUser.Session + `";
|
2016-12-16 10:37:42 +00:00
|
|
|
</script>
|
|
|
|
<script type="text/javascript" src="/static/global.js"></script>
|
2016-12-24 13:14:40 +00:00
|
|
|
<meta name="viewport" content="width=device-width,initial-scale = 1.0, maximum-scale=1.0,user-scalable=no" />
|
2016-12-16 10:37:42 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="container">
|
2016-12-17 03:39:53 +00:00
|
|
|
<div class="nav">
|
2016-12-18 12:56:06 +00:00
|
|
|
<div class="move_left">
|
|
|
|
<div class="move_right">
|
2016-12-16 10:37:42 +00:00
|
|
|
<ul>
|
2016-12-18 12:56:06 +00:00
|
|
|
<li class="menu_left menu_overview"><a href="/">Overview</a></li>
|
|
|
|
<li class="menu_left menu_forums"><a href="/forums/">Forums</a></li>
|
|
|
|
<li class="menu_left menu_topics"><a href="/">Topics</a></li>
|
|
|
|
<li class="menu_left menu_create_topic"><a href="/topics/create/">Create Topic</a></li>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
if tmpl_topic_vars.CurrentUser.Loggedin {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-18 12:56:06 +00:00
|
|
|
<li class="menu_left menu_account"><a href="/user/edit/critical/">Account</a></li>
|
2016-12-24 13:14:40 +00:00
|
|
|
<li class="menu_left menu_profile"><a href="/user/` + strconv.Itoa(tmpl_topic_vars.CurrentUser.ID) + `">Profile</a></li>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
if tmpl_topic_vars.CurrentUser.Is_Super_Mod {
|
2016-12-24 13:14:40 +00:00
|
|
|
w.Write([]byte(`<li class="menu_left menu_account"><a href="/panel/">Panel</a></li>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-18 12:56:06 +00:00
|
|
|
<li class="menu_left menu_logout"><a href="/accounts/logout?session=` + tmpl_topic_vars.CurrentUser.Session + `">Logout</a></li>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
} else {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-18 12:56:06 +00:00
|
|
|
<li class="menu_left menu_register"><a href="/accounts/create/">Register</a></li>
|
|
|
|
<li class="menu_left menu_login"><a href="/accounts/login/">Login</a></li>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-16 10:37:42 +00:00
|
|
|
</ul>
|
2016-12-18 12:56:06 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="clear: both;"></div>
|
2016-12-17 03:39:53 +00:00
|
|
|
</div>
|
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
if len(tmpl_topic_vars.NoticeList) != 0 {
|
|
|
|
for _, item := range tmpl_topic_vars.NoticeList {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`<div class="alert">` + item + `</div>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-16 10:37:42 +00:00
|
|
|
<div class="rowblock">
|
2016-12-21 02:30:32 +00:00
|
|
|
<form action='/topic/edit/submit/` + strconv.Itoa(tmpl_topic_vars.Topic.ID) + `' method="post">
|
2016-12-17 03:39:53 +00:00
|
|
|
<div class="rowitem"`))
|
2016-12-21 02:30:32 +00:00
|
|
|
if tmpl_topic_vars.Topic.Sticky {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(` style="background-color: #FFFFEA;"`))
|
2016-12-26 04:44:07 +00:00
|
|
|
} else {
|
|
|
|
if tmpl_topic_vars.Topic.Is_Closed {
|
|
|
|
w.Write([]byte(` style="background-color: #eaeaea;"`))
|
|
|
|
}
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`>
|
2016-12-21 02:30:32 +00:00
|
|
|
<a class='topic_name hide_on_edit'>` + tmpl_topic_vars.Topic.Title + `</a>
|
2016-12-24 13:14:40 +00:00
|
|
|
<span class='username hide_on_micro topic_status_e topic_status_` + tmpl_topic_vars.Topic.Status + ` hide_on_edit' style="font-weight:normal;float: right;">` + tmpl_topic_vars.Topic.Status + `</span>
|
|
|
|
<span class="username hide_on_micro" style="border-right: 0;font-weight: normal;float: right;">Status</span>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
if tmpl_topic_vars.CurrentUser.Is_Mod {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-21 02:30:32 +00:00
|
|
|
<a href='/topic/edit/` + strconv.Itoa(tmpl_topic_vars.Topic.ID) + `' class="username hide_on_edit open_edit" style="font-weight: normal;margin-left: 6px;">Edit</a>
|
|
|
|
<a href='/topic/delete/submit/` + strconv.Itoa(tmpl_topic_vars.Topic.ID) + `' class="username" style="font-weight: normal;">Delete</a>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-21 02:30:32 +00:00
|
|
|
if tmpl_topic_vars.Topic.Sticky {
|
|
|
|
w.Write([]byte(`<a href='/topic/unstick/submit/` + strconv.Itoa(tmpl_topic_vars.Topic.ID) + `' class="username" style="font-weight: normal;">Unpin</a>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
} else {
|
2016-12-21 02:30:32 +00:00
|
|
|
w.Write([]byte(`<a href='/topic/stick/submit/` + strconv.Itoa(tmpl_topic_vars.Topic.ID) + `' class="username" style="font-weight: normal;">Pin</a>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-16 10:37:42 +00:00
|
|
|
|
2016-12-21 02:30:32 +00:00
|
|
|
<input class='show_on_edit topic_name_input' name="topic_name" value='` + tmpl_topic_vars.Topic.Title + `' type="text" />
|
2016-12-16 10:37:42 +00:00
|
|
|
<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'>
|
|
|
|
<option>open</option>
|
2017-01-01 15:45:43 +00:00
|
|
|
<option>shut</option>
|
2016-12-16 10:37:42 +00:00
|
|
|
</select>
|
|
|
|
<button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-21 02:30:32 +00:00
|
|
|
<a href="/report/submit/` + strconv.Itoa(tmpl_topic_vars.Topic.ID) + `?session=` + tmpl_topic_vars.CurrentUser.Session + `&type=topic" class="username report_item" style="font-weight: normal;">Report</a>
|
2016-12-16 10:37:42 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2016-12-24 13:14:40 +00:00
|
|
|
<div class="rowblock post_container">
|
|
|
|
<div class="rowitem passive editable_parent post_item" style="border-bottom: none;`))
|
2016-12-21 02:30:32 +00:00
|
|
|
if tmpl_topic_vars.Topic.Avatar != "" {
|
|
|
|
w.Write([]byte(`background-image: url(` + tmpl_topic_vars.Topic.Avatar + `), url(/static/white-dot.jpg);background-position: 0px `))
|
|
|
|
if tmpl_topic_vars.Topic.ContentLines <= 5 {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`-1`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-21 02:30:32 +00:00
|
|
|
w.Write([]byte(`0px;background-repeat: no-repeat, repeat-y;background-size: 128px;padding-left: 136px;` + string(tmpl_topic_vars.Topic.Css)))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`">
|
2016-12-24 13:14:40 +00:00
|
|
|
<p class="hide_on_edit topic_content user_content" style="margin: 0;padding: 0;">` + string(tmpl_topic_vars.Topic.Content.(template.HTML)) + `</p>
|
2016-12-21 02:30:32 +00:00
|
|
|
<textarea name="topic_content" class="show_on_edit topic_content_input">` + string(tmpl_topic_vars.Topic.Content.(template.HTML)) + `</textarea>
|
2016-12-16 10:37:42 +00:00
|
|
|
<br /><br />
|
2016-12-24 13:14:40 +00:00
|
|
|
<a href="/user/` + strconv.Itoa(tmpl_topic_vars.Topic.CreatedBy) + `" class="username real_username">` + tmpl_topic_vars.Topic.CreatedByName + `</a>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-21 02:30:32 +00:00
|
|
|
if tmpl_topic_vars.Topic.Tag != "" {
|
2016-12-24 13:14:40 +00:00
|
|
|
w.Write([]byte(`<a class="username hide_on_micro" style="float: right;">` + tmpl_topic_vars.Topic.Tag + `</a>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
} else {
|
2016-12-21 02:30:32 +00:00
|
|
|
if tmpl_topic_vars.Topic.URLName != "" {
|
|
|
|
w.Write([]byte(`<a href="` + tmpl_topic_vars.Topic.URL + `" class="username" style="color: #505050;float: right;">` + tmpl_topic_vars.Topic.URLName + `</a>
|
|
|
|
<a class="username" style="color: #505050;float: right;border-right: 0;">` + tmpl_topic_vars.Topic.URLPrefix + `</a>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-16 10:37:42 +00:00
|
|
|
</div>
|
|
|
|
</div><br />
|
2016-12-26 04:44:07 +00:00
|
|
|
<div class="rowblock post_container" style="overflow: hidden;">`))
|
2016-12-16 10:37:42 +00:00
|
|
|
if len(tmpl_topic_vars.ItemList) != 0 {
|
|
|
|
for _, item := range tmpl_topic_vars.ItemList {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-24 13:14:40 +00:00
|
|
|
<div class="rowitem passive deletable_block editable_parent post_item" style="`))
|
2016-12-21 02:30:32 +00:00
|
|
|
if item.Avatar != "" {
|
|
|
|
w.Write([]byte(`background-image: url(` + item.Avatar + `), url(/static/white-dot.jpg);background-position: 0px `))
|
|
|
|
if item.ContentLines <= 5 {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`-1`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-21 02:30:32 +00:00
|
|
|
w.Write([]byte(`0px;background-repeat: no-repeat, repeat-y;background-size: 128px;padding-left: 136px;` + string(item.Css)))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`">
|
2016-12-26 04:44:07 +00:00
|
|
|
<p class="editable_block user_content" style="margin: 0;padding: 0;">` + string(item.ContentHtml) + `</p><br /><br />
|
2016-12-24 13:14:40 +00:00
|
|
|
<a href="/user/` + strconv.Itoa(item.CreatedBy) + `" class="username real_username">` + item.CreatedByName + `</a>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-21 02:30:32 +00:00
|
|
|
if tmpl_topic_vars.CurrentUser.Perms.EditReply {
|
2016-12-24 13:14:40 +00:00
|
|
|
w.Write([]byte(`<a href="/reply/edit/submit/` + strconv.Itoa(item.ID) + `" class="mod_button"><button class="username edit_item">Edit</button></a>`))
|
2016-12-21 02:30:32 +00:00
|
|
|
}
|
|
|
|
w.Write([]byte(`
|
|
|
|
`))
|
|
|
|
if tmpl_topic_vars.CurrentUser.Perms.DeleteReply {
|
2016-12-24 13:14:40 +00:00
|
|
|
w.Write([]byte(`<a href="/reply/delete/submit/` + strconv.Itoa(item.ID) + `" class="mod_button"><button class="username delete_item">Delete</button></a>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-24 13:14:40 +00:00
|
|
|
<a href="/report/submit/` + strconv.Itoa(item.ID) + `?session=` + tmpl_topic_vars.CurrentUser.Session + `&type=reply" class="mod_button"><button class="username report_item">Report</button></a>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-21 02:30:32 +00:00
|
|
|
if item.Tag != "" {
|
2016-12-24 13:14:40 +00:00
|
|
|
w.Write([]byte(`<a class="username hide_on_micro" style="float: right;">` + item.Tag + `</a>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
} else {
|
2016-12-21 02:30:32 +00:00
|
|
|
if item.URLName != "" {
|
2016-12-24 13:14:40 +00:00
|
|
|
w.Write([]byte(`<a href="` + item.URL + `" class="username hide_on_mobile" style="color: #505050;float: right;" rel="nofollow">` + item.URLName + `</a>
|
|
|
|
<a class="username hide_on_mobile" style="color: #505050;float: right;border-right: 0;">` + item.URLPrefix + `</a>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-26 04:44:07 +00:00
|
|
|
</div>
|
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
|
|
|
}
|
2016-12-26 04:44:07 +00:00
|
|
|
w.Write([]byte(`</div>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-21 02:30:32 +00:00
|
|
|
if tmpl_topic_vars.CurrentUser.Perms.CreateReply {
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
2016-12-16 10:37:42 +00:00
|
|
|
<div class="rowblock">
|
|
|
|
<form action="/reply/create/" method="post">
|
2016-12-21 02:30:32 +00:00
|
|
|
<input name="tid" value='` + strconv.Itoa(tmpl_topic_vars.Topic.ID) + `' type="hidden" />
|
2016-12-16 10:37:42 +00:00
|
|
|
<div class="formrow">
|
|
|
|
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
|
|
|
|
</div>
|
|
|
|
<div class="formrow">
|
|
|
|
<div class="formitem"><button name="reply-button" class="formbutton">Create Reply</button></div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2016-12-17 03:39:53 +00:00
|
|
|
`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|
2016-12-17 03:39:53 +00:00
|
|
|
w.Write([]byte(`
|
|
|
|
<!--<link rel="stylesheet" href="https://use.fontawesome.com/8670aa03ca.css">-->
|
2016-12-16 10:37:42 +00:00
|
|
|
</div>
|
|
|
|
</body>
|
2016-12-17 03:39:53 +00:00
|
|
|
</html>`))
|
2016-12-16 10:37:42 +00:00
|
|
|
}
|