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-18 12:56:06 +00:00
|
|
|
package main
|
2017-01-03 07:47:31 +00:00
|
|
|
import "io"
|
2017-01-05 14:41:14 +00:00
|
|
|
import "strconv"
|
2016-12-18 12:56:06 +00:00
|
|
|
|
|
|
|
func init() {
|
2017-01-01 15:45:43 +00:00
|
|
|
template_forum_handle = template_forum
|
|
|
|
//o_template_forum_handle = template_forum
|
|
|
|
ctemplates = append(ctemplates,"forum")
|
|
|
|
tmpl_ptr_map["forum"] = &template_forum_handle
|
|
|
|
tmpl_ptr_map["o_forum"] = template_forum
|
2016-12-18 12:56:06 +00:00
|
|
|
}
|
|
|
|
|
2017-01-01 15:45:43 +00:00
|
|
|
func template_forum(tmpl_forum_vars ForumPage, w io.Writer) {
|
2016-12-18 12:56:06 +00:00
|
|
|
w.Write([]byte(`<!doctype html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>` + tmpl_forum_vars.Title + `</title>
|
|
|
|
<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">
|
|
|
|
var session = "` + tmpl_forum_vars.CurrentUser.Session + `";
|
|
|
|
</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-18 12:56:06 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="container">
|
|
|
|
<div class="nav">
|
|
|
|
<div class="move_left">
|
|
|
|
<div class="move_right">
|
|
|
|
<ul>
|
|
|
|
<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>
|
|
|
|
`))
|
|
|
|
if tmpl_forum_vars.CurrentUser.Loggedin {
|
|
|
|
w.Write([]byte(`
|
|
|
|
<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_forum_vars.CurrentUser.ID) + `">Profile</a></li>
|
2016-12-18 12:56:06 +00:00
|
|
|
`))
|
|
|
|
if tmpl_forum_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-18 12:56:06 +00:00
|
|
|
}
|
|
|
|
w.Write([]byte(`
|
|
|
|
<li class="menu_left menu_logout"><a href="/accounts/logout?session=` + tmpl_forum_vars.CurrentUser.Session + `">Logout</a></li>
|
|
|
|
`))
|
|
|
|
} else {
|
|
|
|
w.Write([]byte(`
|
|
|
|
<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>
|
|
|
|
`))
|
|
|
|
}
|
|
|
|
w.Write([]byte(`
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
</div>
|
2017-01-07 06:31:04 +00:00
|
|
|
<div id="back"><div id="main">`))
|
2016-12-18 12:56:06 +00:00
|
|
|
if len(tmpl_forum_vars.NoticeList) != 0 {
|
|
|
|
for _, item := range tmpl_forum_vars.NoticeList {
|
|
|
|
w.Write([]byte(`<div class="alert">` + item + `</div>`))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
w.Write([]byte(`
|
|
|
|
<div class="rowblock">
|
2017-01-07 06:31:04 +00:00
|
|
|
<div class="rowitem rowhead"><a>` + tmpl_forum_vars.Title + `</a></div>
|
2016-12-18 12:56:06 +00:00
|
|
|
</div>
|
|
|
|
<div class="rowblock">
|
|
|
|
`))
|
|
|
|
if len(tmpl_forum_vars.ItemList) != 0 {
|
|
|
|
for _, item := range tmpl_forum_vars.ItemList {
|
|
|
|
w.Write([]byte(`<div class="rowitem passive" style="`))
|
2017-01-01 15:45:43 +00:00
|
|
|
if item.Avatar != "" {
|
|
|
|
w.Write([]byte(`background-image: url(` + item.Avatar + `);background-position: left;background-repeat: no-repeat;background-size: 64px;padding-left: 72px;`))
|
2016-12-18 12:56:06 +00:00
|
|
|
}
|
2017-01-01 15:45:43 +00:00
|
|
|
if item.Sticky {
|
2016-12-18 12:56:06 +00:00
|
|
|
w.Write([]byte(`background-color: #FFFFCC;`))
|
2016-12-26 04:44:07 +00:00
|
|
|
} else {
|
2017-01-01 15:45:43 +00:00
|
|
|
if item.Is_Closed {
|
2016-12-26 04:44:07 +00:00
|
|
|
w.Write([]byte(`background-color: #eaeaea;`))
|
|
|
|
}
|
2016-12-18 12:56:06 +00:00
|
|
|
}
|
|
|
|
w.Write([]byte(`">
|
2017-01-01 15:45:43 +00:00
|
|
|
<a href="/topic/` + strconv.Itoa(item.ID) + `">` + item.Title + `</a> `))
|
|
|
|
if item.Is_Closed {
|
|
|
|
w.Write([]byte(`<span class="username topic_status_e topic_status_closed" style="float: right;">shut</span>
|
2016-12-18 12:56:06 +00:00
|
|
|
`))
|
|
|
|
} else {
|
2016-12-24 13:14:40 +00:00
|
|
|
w.Write([]byte(`<span class="username hide_on_micro topic_status_e topic_status_open" style="float: right;">open</span>`))
|
2016-12-18 12:56:06 +00:00
|
|
|
}
|
|
|
|
w.Write([]byte(`
|
2016-12-24 13:14:40 +00:00
|
|
|
<span class="username hide_on_micro" style="border-right: 0;float: right;">Status</span>
|
2016-12-21 02:30:32 +00:00
|
|
|
</div>
|
|
|
|
`))
|
2016-12-18 12:56:06 +00:00
|
|
|
}
|
2016-12-21 02:30:32 +00:00
|
|
|
} else {
|
|
|
|
w.Write([]byte(`<div class="rowitem passive">There aren't any topics in this forum yet.</div>`))
|
2016-12-18 12:56:06 +00:00
|
|
|
}
|
|
|
|
w.Write([]byte(`
|
|
|
|
</div>
|
|
|
|
<!--<link rel="stylesheet" href="https://use.fontawesome.com/8670aa03ca.css">-->
|
2017-01-07 06:31:04 +00:00
|
|
|
</div><div style="clear: both;"></div></div></div>
|
2016-12-18 12:56:06 +00:00
|
|
|
</body>
|
|
|
|
</html>`))
|
|
|
|
}
|