Improved the mobile theme for Tempra Mobile. I broke something in the process of doing so, but it shouldn't take too long to make right!

Action posts are now visible on Tempra Conflux, Cosmo, and Cosmo Conflux.
Action posts now work properly on mobile.
This commit is contained in:
Azareal 2017-05-13 15:27:42 +01:00
parent b841acef29
commit b60792391e
9 changed files with 170 additions and 80 deletions

View File

@ -90,7 +90,7 @@ var topic_19 []byte = []byte(`
</div>
</form>
</div>
<div class="rowblock post_container">
<div class="rowblock post_container top_post">
<div class="rowitem passive editable_parent post_item" style="border-bottom: none;`)
var topic_20 []byte = []byte(`background-image:url(`)
var topic_21 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px `)
@ -130,10 +130,10 @@ var topic_48 []byte = []byte(`<a class="username hide_on_micro level">`)
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><br />
</div>
<div class="rowblock post_container" style="overflow: hidden;">`)
var topic_51 []byte = []byte(`
<div class="rowitem passive deletable_block editable_parent post_item" style="padding:14px;text-align:center;background-color:rgb(255,245,245);">
<div class="rowitem passive deletable_block editable_parent post_item action_item">
<span class="action_icon" style="font-size: 18px;padding-right: 5px;">`)
var topic_52 []byte = []byte(`</span>
<span>`)
@ -176,6 +176,7 @@ var topic_80 []byte = []byte(`</a>
</div>
`)
var topic_81 []byte = []byte(`</div>
`)
var topic_82 []byte = []byte(`
<div class="rowblock">
@ -205,6 +206,7 @@ var topic_alt_5 []byte = []byte(`" />
var topic_alt_6 []byte = []byte(`?page=`)
var topic_alt_7 []byte = []byte(`">&gt;</a></div>`)
var topic_alt_8 []byte = []byte(`
<div class="rowblock topic_block">
<form action='/topic/edit/submit/`)
var topic_alt_9 []byte = []byte(`' method="post">
@ -231,6 +233,7 @@ var topic_alt_19 []byte = []byte(`
</div>
</form>
</div>
<style type="text/css">.rowitem:last-child .content_container { margin-bottom: 5px !important; }</style>
<div class="rowblock post_container" style="border-top: none;">
<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;">
@ -279,53 +282,67 @@ var topic_alt_47 []byte = []byte(`
</div>
`)
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 `)
var topic_alt_49 []byte = []byte(`action_item`)
var topic_alt_50 []byte = []byte(`">
<div class="userinfo">
<div class="avatar_item" style="background-image: url(`)
var topic_alt_49 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px -10px;">&nbsp;</div>
var topic_alt_51 []byte = []byte(`), url(/static/white-dot.jpg);background-position: 0px -10px;">&nbsp;</div>
<a href="/user/`)
var topic_alt_50 []byte = []byte(`" class="the_name">`)
var topic_alt_51 []byte = []byte(`</a>
var topic_alt_52 []byte = []byte(`" class="the_name">`)
var topic_alt_53 []byte = []byte(`</a>
`)
var topic_alt_52 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">`)
var topic_alt_53 []byte = []byte(`</div><div class="tag_post"></div></div>`)
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_54 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">`)
var topic_alt_55 []byte = []byte(`</div><div class="tag_post"></div></div>`)
var topic_alt_56 []byte = []byte(`
var topic_alt_56 []byte = []byte(`<div class="tag_block"><div class="tag_pre"></div><div class="post_tag post_level">Level `)
var topic_alt_57 []byte = []byte(`</div><div class="tag_post"></div></div>`)
var topic_alt_58 []byte = []byte(`
</div>
<div class="content_container">
<div class="content_container" `)
var topic_alt_59 []byte = []byte(`style="margin-left: 0px;"`)
var topic_alt_60 []byte = []byte(`>
`)
var topic_alt_61 []byte = []byte(`
<span class="action_icon" style="font-size: 18px;padding-right: 5px;">`)
var topic_alt_62 []byte = []byte(`</span>
<span>`)
var topic_alt_63 []byte = []byte(`</span>
`)
var topic_alt_64 []byte = []byte(`
<div class="editable_block user_content">`)
var topic_alt_57 []byte = []byte(`</div>
var topic_alt_65 []byte = []byte(`</div>
<div class="button_container">
`)
var topic_alt_58 []byte = []byte(`<a href="/reply/like/submit/`)
var topic_alt_59 []byte = []byte(`" class="action_button">+1</a>`)
var topic_alt_60 []byte = []byte(`<a href="/reply/edit/submit/`)
var topic_alt_61 []byte = []byte(`" class="action_button edit_item">Edit</a>`)
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(`
var topic_alt_66 []byte = []byte(`<a href="/reply/like/submit/`)
var topic_alt_67 []byte = []byte(`" class="action_button">+1</a>`)
var topic_alt_68 []byte = []byte(`<a href="/reply/edit/submit/`)
var topic_alt_69 []byte = []byte(`" class="action_button edit_item">Edit</a>`)
var topic_alt_70 []byte = []byte(`<a href="/reply/delete/submit/`)
var topic_alt_71 []byte = []byte(`" class="action_button delete_item">Delete</a>`)
var topic_alt_72 []byte = []byte(`
<a href="/report/submit/`)
var topic_alt_65 []byte = []byte(`?session=`)
var topic_alt_66 []byte = []byte(`&type=reply" class="action_button report_item">Report</a>
var topic_alt_73 []byte = []byte(`?session=`)
var topic_alt_74 []byte = []byte(`&type=reply" class="action_button report_item">Report</a>
`)
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_68 []byte = []byte(`</a>`)
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(`
var topic_alt_75 []byte = []byte(`<a href="#" title="IP Address" class="action_button action_button_right ip_item hide_on_mobile">`)
var topic_alt_76 []byte = []byte(`</a>`)
var topic_alt_77 []byte = []byte(`<a class="action_button action_button_right hide_on_micro">`)
var topic_alt_78 []byte = []byte(` up</a>`)
var topic_alt_79 []byte = []byte(`
</div>
`)
var topic_alt_80 []byte = []byte(`
</div>
<div style="clear:both;"></div>
</div>
`)
var topic_alt_72 []byte = []byte(`</div>
var topic_alt_81 []byte = []byte(`</div>
`)
var topic_alt_73 []byte = []byte(`
var topic_alt_82 []byte = []byte(`
<div class="rowblock" style="border-top: none;">
<form action="/reply/create/" method="post">
<input name="tid" value='`)
var topic_alt_74 []byte = []byte(`' type="hidden" />
var topic_alt_83 []byte = []byte(`' type="hidden" />
<div class="formrow">
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
</div>

View File

@ -150,62 +150,80 @@ w.Write(topic_alt_47)
if len(tmpl_topic_alt_vars.ItemList) != 0 {
for _, item := range tmpl_topic_alt_vars.ItemList {
w.Write(topic_alt_48)
w.Write([]byte(item.Avatar))
if item.ActionType != "" {
w.Write(topic_alt_49)
w.Write([]byte(strconv.Itoa(item.CreatedBy)))
w.Write(topic_alt_50)
w.Write([]byte(item.CreatedByName))
w.Write(topic_alt_51)
if item.Tag != "" {
w.Write(topic_alt_52)
w.Write([]byte(item.Tag))
w.Write(topic_alt_53)
} else {
w.Write(topic_alt_54)
w.Write([]byte(strconv.Itoa(item.Level)))
w.Write(topic_alt_55)
}
w.Write(topic_alt_50)
w.Write([]byte(item.Avatar))
w.Write(topic_alt_51)
w.Write([]byte(strconv.Itoa(item.CreatedBy)))
w.Write(topic_alt_52)
w.Write([]byte(item.CreatedByName))
w.Write(topic_alt_53)
if item.Tag != "" {
w.Write(topic_alt_54)
w.Write([]byte(item.Tag))
w.Write(topic_alt_55)
} else {
w.Write(topic_alt_56)
w.Write([]byte(item.ContentHtml))
w.Write([]byte(strconv.Itoa(item.Level)))
w.Write(topic_alt_57)
if tmpl_topic_alt_vars.CurrentUser.Perms.LikeItem {
}
w.Write(topic_alt_58)
w.Write([]byte(strconv.Itoa(item.ID)))
if item.ActionType != "" {
w.Write(topic_alt_59)
}
if tmpl_topic_alt_vars.CurrentUser.Perms.EditReply {
w.Write(topic_alt_60)
w.Write([]byte(strconv.Itoa(item.ID)))
if item.ActionType != "" {
w.Write(topic_alt_61)
w.Write([]byte(item.ActionIcon))
w.Write(topic_alt_62)
w.Write([]byte(item.ActionType))
w.Write(topic_alt_63)
} else {
w.Write(topic_alt_64)
w.Write([]byte(item.ContentHtml))
w.Write(topic_alt_65)
if tmpl_topic_alt_vars.CurrentUser.Perms.LikeItem {
w.Write(topic_alt_66)
w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_alt_67)
}
if tmpl_topic_alt_vars.CurrentUser.Perms.EditReply {
w.Write(topic_alt_68)
w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_alt_69)
}
if tmpl_topic_alt_vars.CurrentUser.Perms.DeleteReply {
w.Write(topic_alt_62)
w.Write([]byte(strconv.Itoa(item.ID)))
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([]byte(strconv.Itoa(item.ID)))
w.Write(topic_alt_71)
}
}
w.Write(topic_alt_72)
if tmpl_topic_alt_vars.CurrentUser.Perms.CreateReply {
w.Write([]byte(strconv.Itoa(item.ID)))
w.Write(topic_alt_73)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session))
w.Write(topic_alt_74)
if tmpl_topic_alt_vars.CurrentUser.Perms.ViewIPs {
w.Write(topic_alt_75)
w.Write([]byte(item.IpAddress))
w.Write(topic_alt_76)
}
if item.LikeCount > 0 {
w.Write(topic_alt_77)
w.Write([]byte(strconv.Itoa(item.LikeCount)))
w.Write(topic_alt_78)
}
w.Write(topic_alt_79)
}
w.Write(topic_alt_80)
}
}
w.Write(topic_alt_81)
if tmpl_topic_alt_vars.CurrentUser.Perms.CreateReply {
w.Write(topic_alt_82)
w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID)))
w.Write(topic_alt_83)
}
w.Write(footer_0)
}

View File

@ -33,7 +33,7 @@
</div>
</div>
<div class="rowblock post_container" style="overflow: hidden;">{{range .ItemList}}{{if .ActionType}}
<div class="rowitem passive deletable_block editable_parent post_item" style="padding:14px;text-align:center;background-color:rgb(255,245,245);">
<div class="rowitem passive deletable_block editable_parent post_item action_item">
<span class="action_icon" style="font-size: 18px;padding-right: 5px;">{{.ActionIcon}}</span>
<span>{{.ActionType}}</span>
</div>
@ -49,6 +49,7 @@
{{if .Tag}}<a class="username hide_on_micro" style="float: right;color:#505050;font-size:16px;">{{.Tag}}</a>{{else}}<a class="username hide_on_micro level">{{.Level}}</a><a class="username hide_on_micro" style="color:#505050;float:right;opacity:0.85;" title="Level">👑{{end}}</a>
</div>
{{end}}{{end}}</div>
{{if .CurrentUser.Perms.CreateReply}}
<div class="rowblock">
<form action="/reply/create/" method="post">

View File

@ -2,6 +2,7 @@
{{if gt .Page 1}}<div id="prevFloat" class="prev_button"><a class="prev_link" href="/topic/{{.Topic.ID}}?page={{subtract .Page 1}}">&lt;</a></div>{{end}}
{{if ne .LastPage .Page}}<link rel="prerender" href="/topic/{{.Topic.ID}}?page={{add .Page 1}}" />
<div id="nextFloat" class="next_button"><a class="next_link" href="/topic/{{.Topic.ID}}?page={{add .Page 1}}">&gt;</a></div>{{end}}
<div class="rowblock topic_block">
<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}}">
@ -18,6 +19,7 @@
</div>
</form>
</div>
<style type="text/css">.rowitem:last-child .content_container { margin-bottom: 5px !important; }</style>
<div class="rowblock post_container" style="border-top: none;">
<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;">
@ -36,20 +38,24 @@
{{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. Who knows when or *if* the W3C will standardise it */}}
{{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 style="clear:both;"></div>
</div>
{{range .ItemList}}
<div class="rowitem passive deletable_block editable_parent post_item">
<div class="rowitem passive deletable_block editable_parent post_item {{if .ActionType}}action_item{{end}}">
<div class="userinfo">
<div class="avatar_item" style="background-image: url({{.Avatar}}), url(/static/white-dot.jpg);background-position: 0px -10px;">&nbsp;</div>
<a href="/user/{{.CreatedBy}}" class="the_name">{{.CreatedByName}}</a>
{{if .Tag}}<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">{{.Tag}}</div><div class="tag_post"></div></div>{{else}}<div class="tag_block"><div class="tag_pre"></div><div class="post_tag post_level">Level {{.Level}}</div><div class="tag_post"></div></div>{{end}}
</div>
<div class="content_container">
<div class="content_container" {{if .ActionType}}style="margin-left: 0px;"{{end}}>
{{if .ActionType}}
<span class="action_icon" style="font-size: 18px;padding-right: 5px;">{{.ActionIcon}}</span>
<span>{{.ActionType}}</span>
{{else}}
<div class="editable_block user_content">{{.ContentHtml}}</div>
<div class="button_container">
{{if $.CurrentUser.Perms.LikeItem}}<a href="/reply/like/submit/{{.ID}}" class="action_button">+1</a>{{end}}
@ -59,6 +65,7 @@
{{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>
{{end}}
</div>
<div style="clear:both;"></div>
</div>

View File

@ -700,6 +700,15 @@ blockquote p
box-shadow:0 1px 2px rgba(0,0,0,.1);
}
.action_item .userinfo {
display: none;
}
.action_item .content_container {
min-height: auto;
padding: 15px;
text-align: center;
}
.prev_button, .next_button {
position: fixed;
top: 50%;

View File

@ -736,6 +736,15 @@ blockquote p
border-radius: 4px;
}
.action_item .userinfo {
display: none;
}
.action_item .content_container {
min-height: auto;
padding: 15px;
text-align: center;
}
.prev_button, .next_button {
position: fixed;
top: 50%;

View File

@ -543,6 +543,15 @@ button.username
box-shadow:0 1px 2px rgba(0,0,0,.1);
}
.action_item .userinfo {
display: none;
}
.action_item .content_container {
min-height: auto;
padding: 15px;
text-align: center;
}
.prev_button, .next_button {
position: fixed;
top: 50%;
@ -625,6 +634,7 @@ button.username
}
@media (max-width: 470px) {
ul { margin-bottom: 10px; }
.menu_overview, .menu_profile, .hide_on_micro { display: none; }
.post_container { overflow: visible !important; }

View File

@ -417,6 +417,12 @@ button.username
opacity: 0.9;
}
.action_item {
padding: 14px;
text-align: center;
background-color: rgb(255,245,245);
}
.postQuote {
border: 1px solid #ccc;
background: white;

View File

@ -395,6 +395,12 @@ button.username { position: relative; top: -0.25px; }
opacity: 0.9;
}
.action_item {
padding: 14px;
text-align: center;
background-color: rgb(255,245,245);
}
.postQuote {
border: 1px solid #ccc;
background: white;
@ -534,9 +540,9 @@ button.username { position: relative; top: -0.25px; }
.menu_overview, .menu_profile { display: none; }
.hide_on_micro { display: none !important; }
.post_container { overflow: visible !important; }
.post_item {
.post_item:not(.action_item) {
background-position: 0px 2px !important;
background-size: 64px 64px !important;
background-size: 64px auto !important;
padding-left: 2px !important;
min-height: 96px;
position: relative !important;
@ -552,15 +558,22 @@ button.username { position: relative; top: -0.25px; }
}
.post_item > .mod_button > button { opacity: 1; }
.post_item > .real_username {
position: absolute;
/*position: absolute;
top: 70px;
float: left;
margin-top: -2px;
padding-top: 3px !important;
margin-top: -2px;*/
margin-top: 0px;
/*padding-top: 3px !important;
margin-right: 2px;
width: 60px;
width: 60px;*/
margin-left: 74px;
margin-right: 0px;
font-size: 15px;
text-align: center;
/*text-align: center;*/
color: black;
max-width: 61px;
/*overflow: hidden;*/
text-overflow: ellipsis;
}
.container { width: 100% !important; }
}