gosora/templates/profile.html
Azareal bdf7fa40d5 Improved the datetimes on the log pages.
Added an experimental template fragment optimisation.
The template generator can handle time.Time
The forum and profile templates now have guest and member variants generated for them.
Interpreted templates are no longer loaded, if there's a generated version of it.

Added absolute time on hover to the topic, topics, forum, and forums templates.
We now use lang instead of index in the stylesheets for phrases.
Renamed the .trash_label CSS class to .delete_label
Use the new toArr and concat template functions to reduce the amount of boilerplate in the theme stylesheets.
Removed bits of redundant code here and there in the stylesheets.
Added a .CurrentUser.Loggedin to profiles to make them slightly faster.
Shortened some themeStmt names.
Moved GzipResponseWriter, theme.RunTmpl and theme.GetTmpl from theme_list.go to theme.go
The fallback theme now falls back onto the last theme loaded, if the fallback theme doesn't exist.
Added the abstime template function for formatting absolute times a little more nicely.

Began work on the login logs.

Removed the alerts_no_new_alerts phrase.
Renamed the forums_topics_suffix phrase to forums.topics_suffix.
2018-12-14 14:08:53 +10:00

138 lines
5.5 KiB
HTML

{{template "header.html" . }}
<div id="profile_container" class="colstack">
<div id="profile_left_lane" class="colstack_left">
<div id="profile_left_pane" class="rowmenu">
<div class="topBlock">
<div class="rowitem avatarRow">
<img src="{{.ProfileOwner.Avatar}}" class="avatar" alt="{{.ProfileOwner.Name}}'s Avatar" title="{{.ProfileOwner.Name}}'s Avatar" />
</div>
<div class="rowitem nameRow">
<span class="profileName" title="{{.ProfileOwner.Name}}">{{.ProfileOwner.Name}}</span>{{if .ProfileOwner.Tag}}<span class="username" title="{{.ProfileOwner.Tag}}">{{.ProfileOwner.Tag}}</span>{{end}}
</div>
</div>
<div class="levelBlock">
<div class="rowitem passive">
<div class="profile_menu_item level_inprogress">
<div class="levelBit">
<a>{{level .ProfileOwner.Level}}</a>
</div>
<div class="progressWrap"{{if ne .CurrentScore 0}} style="width: 40%"{{end}}>
<div>{{.CurrentScore}} / {{.NextScore}}</div>
</div>
</div>
</div>
</div>
<div class="passiveBlock">
{{if not .CurrentUser.Loggedin}}<div class="rowitem passive">
<a class="profile_menu_item">{{lang "profile_login_for_options"}}</a>
</div>{{else}}
<!--<div class="rowitem passive">
<a class="profile_menu_item">{{lang "profile_add_friend"}}</a>
</div>-->
{{if (.CurrentUser.IsSuperMod) and not (.ProfileOwner.IsSuperMod) }}<div class="rowitem passive">
{{if .ProfileOwner.IsBanned }}<a href="/users/unban/{{.ProfileOwner.ID}}?session={{.CurrentUser.Session}}" class="profile_menu_item">{{lang "profile_unban"}}</a>
{{else}}<a href="#ban_user" class="profile_menu_item">{{lang "profile_ban"}}</a>{{end}}
</div>{{end}}
<div class="rowitem passive">
<a href="/report/submit/{{.ProfileOwner.ID}}?session={{.CurrentUser.Session}}&type=user" class="profile_menu_item report_item" aria-label="{{lang "profile_report_user_aria"}}" title="{{lang "profile_report_user_tooltip"}}"></a>
</div>
{{end}}
</div>
</div>
</div>
<div id="profile_right_lane" class="colstack_right">
{{if .CurrentUser.Loggedin}}
{{if .CurrentUser.Perms.BanUsers}}
<!-- TODO: Inline the display: none; CSS -->
<div id="ban_user_head" class="colstack_item colstack_head hash_hide ban_user_hash" style="display: none;">
<div class="rowitem"><h1><a>{{lang "profile_ban_user_head"}}</a></h1></div>
</div>
<form id="ban_user_form" class="hash_hide ban_user_hash" action="/users/ban/submit/{{.ProfileOwner.ID}}?session={{.CurrentUser.Session}}" method="post" style="display: none;">
{{/** TODO: Put a JS duration calculator here instead of this text? **/}}
<div class="colline">{{lang "profile_ban_user_notice"}}</div>
<div class="colstack_item">
<div class="formrow real_first_child">
<div class="formitem formlabel"><a>{{lang "profile_ban_user_days"}}</a></div>
<div class="formitem">
<input name="ban-duration-days" type="number" value="0" min="0" />
</div>
</div>
<div class="formrow">
<div class="formitem formlabel"><a>{{lang "profile_ban_user_weeks"}}</a></div>
<div class="formitem">
<input name="ban-duration-weeks" type="number" value="0" min="0" />
</div>
</div>
<div class="formrow">
<div class="formitem formlabel"><a>{{lang "profile_ban_user_months"}}</a></div>
<div class="formitem">
<input name="ban-duration-months" type="number" value="0" min="0" />
</div>
</div>
{{/**<!--<div class="formrow">
<div class="formitem formlabel"><a>{{lang "profile_ban_user_reason"}}</a></div>
<div class="formitem"><textarea name="ban-reason" placeholder="A really horrible person" required></textarea></div>
</div>-->**/}}
<div class="formrow">
<div class="formitem"><button name="ban-button" class="formbutton form_middle_button">{{lang "profile_ban_user_button"}}</button></div>
</div>
</div>
</form>
{{end}}
{{end}}
<div id="profile_comments_head" class="colstack_item colstack_head hash_hide">
<div class="rowitem"><h1><a>{{lang "profile_comments_head"}}</a></h1></div>
</div>
<div id="profile_comments" class="colstack_item hash_hide">{{template "profile_comments_row.html" . }}</div>
{{if .CurrentUser.Loggedin}}
{{if not .CurrentUser.IsBanned}}
<form id="profile_comments_form" class="hash_hide" action="/profile/reply/create/?session={{.CurrentUser.Session}}" method="post">
<input name="uid" value='{{.ProfileOwner.ID}}' type="hidden" />
<div class="colstack_item topic_reply_form" style="border-top: none;">
<div class="formrow">
<div class="formitem"><textarea class="input_content" name="reply-content" placeholder="{{lang "profile_comments_form_content"}}"></textarea></div>
</div>
<div class="formrow quick_button_row">
<div class="formitem"><button name="reply-button" class="formbutton">{{lang "profile_comments_form_button"}}</button></div>
</div>
</div>
</form>
{{end}}
{{else}}
<div class="colstack_item" style="border-top: none;">
<div class="rowitem passive">{{lang "profile_comments_form_guest"}}</div>
</div>
{{end}}
</div>
</div>
{{if .CurrentUser.Loggedin}}
{{/** Quick subpage switcher **/}}
{{/** TODO: Stop inlining this **/}}
<script type="text/javascript">
function handle_profile_hashbit() {
var hash_class = ""
switch(window.location.hash.substr(1)) {
case "ban_user":
hash_class = "ban_user_hash"
break
default:
console.log("Unknown hashbit")
return
}
$(".hash_hide").hide()
$("." + hash_class).show()
}
if(window.location.hash) handle_profile_hashbit()
window.addEventListener("hashchange", handle_profile_hashbit, false)
</script>
{{end}}
{{template "footer.html" . }}