bbbd0c381f
The porting is still underway, part of it relies on functionality which hasn't be implemented in Gosora yet like sidebars and alerts. Restructured the BBCode parser plugin. Added the [code] tag to the BBCode parser. Disabled by default for now. Added a benchmark for comparing performance between when [code] is enabled and when it isn't. Tweaked the templates to make them more flexible, thus allowing a wider variety of themes. Images of the themes can now be found in the Theme Manager. There's an emoji on each theme row to show which themes are mobile friendly and which aren't. Fixed editing and deleting posts on Tempra Conflux. Moved a large portion of the inline CSS in the topic_alt template into the stylesheets.
109 lines
3.8 KiB
Go
109 lines
3.8 KiB
Go
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
|
|
package main
|
|
import "strconv"
|
|
import "io"
|
|
|
|
func init() {
|
|
template_topics_handle = template_topics
|
|
//o_template_topics_handle = template_topics
|
|
ctemplates = append(ctemplates,"topics")
|
|
tmpl_ptr_map["topics"] = &template_topics_handle
|
|
tmpl_ptr_map["o_topics"] = template_topics
|
|
}
|
|
|
|
func template_topics(tmpl_topics_vars TopicsPage, w io.Writer) {
|
|
w.Write([]byte(`<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>` + tmpl_topics_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_topics_vars.CurrentUser.Session + `";
|
|
</script>
|
|
<script type="text/javascript" src="/static/global.js"></script>
|
|
<meta name="viewport" content="width=device-width,initial-scale = 1.0, maximum-scale=1.0,user-scalable=no" />
|
|
</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_topics_vars.CurrentUser.Loggedin {
|
|
w.Write([]byte(`
|
|
<li class="menu_left menu_account"><a href="/user/edit/critical/">Account</a></li>
|
|
<li class="menu_left menu_profile"><a href="/user/` + strconv.Itoa(tmpl_topics_vars.CurrentUser.ID) + `">Profile</a></li>
|
|
`))
|
|
if tmpl_topics_vars.CurrentUser.Is_Super_Mod {
|
|
w.Write([]byte(`<li class="menu_left menu_account"><a href="/panel/">Panel</a></li>`))
|
|
}
|
|
w.Write([]byte(`
|
|
<li class="menu_left menu_logout"><a href="/accounts/logout?session=` + tmpl_topics_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>
|
|
<div id="back"><div id="main">`))
|
|
if len(tmpl_topics_vars.NoticeList) != 0 {
|
|
for _, item := range tmpl_topics_vars.NoticeList {
|
|
w.Write([]byte(`<div class="alert">` + item + `</div>`))
|
|
}
|
|
}
|
|
w.Write([]byte(`
|
|
<div class="rowblock">
|
|
<div class="rowitem rowhead"><a>Topic List</a></div>
|
|
</div>
|
|
<div class="rowblock">
|
|
`))
|
|
if len(tmpl_topics_vars.ItemList) != 0 {
|
|
for _, item := range tmpl_topics_vars.ItemList {
|
|
w.Write([]byte(`<div class="rowitem passive" style="`))
|
|
if item.Avatar != "" {
|
|
w.Write([]byte(`background-image: url(` + item.Avatar + `);background-position: left;background-repeat: no-repeat;background-size: 64px;padding-left: 72px;`))
|
|
}
|
|
if item.Sticky {
|
|
w.Write([]byte(`background-color: #FFFFCC;`))
|
|
} else {
|
|
if item.Is_Closed {
|
|
w.Write([]byte(`background-color: #eaeaea;`))
|
|
}
|
|
}
|
|
w.Write([]byte(`">
|
|
<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>
|
|
`))
|
|
} else {
|
|
w.Write([]byte(`<span class="username hide_on_micro topic_status_e topic_status_open" style="float: right;">open</span>`))
|
|
}
|
|
w.Write([]byte(`
|
|
<span class="username hide_on_micro status_label" style="border-right: 0;float: right;">Status</span>
|
|
</div>
|
|
`))
|
|
}
|
|
} else {
|
|
w.Write([]byte(`<div class="rowitem passive">There aren't any topics yet.</div>`))
|
|
}
|
|
w.Write([]byte(`
|
|
</div>
|
|
<!--<link rel="stylesheet" href="https://use.fontawesome.com/8670aa03ca.css">-->
|
|
</div><div style="clear: both;"></div></div></div>
|
|
</body>
|
|
</html>`))
|
|
}
|