{{define "timeline"}} {{.Room.Name}} - Hummingbard {{template "common-head" .}} {{if gt (len .Room.CSS) 0}} {{end}}
{{if .LoggedInUser}} {{template "nav" Map "Page" .}} {{end}}
{{template "header" Map "Page" . "Name" "timeline"}}
{{if and .IsUserProfile (not .IsPermalink)}} {{$hd := gt (len .Room.Header) 0}}
{{if $hd}}
{{end}}
{{if gt (len .Room.Avatar) 0}}
{{end}}
{{if .IsOwner}}
{{end}}
{{if and .LoggedInUser (.IsUserProfile) (not .IsOwner)}}
{{end}}
{{$nm := .Room.Path}} {{if gt (len .Room.Name) 0}}{{$nm = .Room.Name}}{{end}}
{{$nm}}
{{if gt (len .Room.Name) 0}}
{{.Room.Path}}
{{end}}
{{.Room.Topic}}
Joined on {{.Room.CreatedAt}}
{{end}} {{if and (not .IsUserProfile) (gt (len .Room.Header) 0)}}
{{end}}
{{if not .IsUserProfile}}
{{if gt (len .Room.Avatar) 0}} {{$hms := .HomeServerURL}} {{$mxc := .Room.Avatar}}
{{else}}
{{end}}
{{$path := .Room.Path}} {{$ln := len .Room.PathItems}} {{$sin := eq (len .Room.PathItems) 1 }} {{$prm := .IsPermalink}} {{range $id, $val := .Room.PathItems}} {{$last := IsLastItem $id $ln}} {{$mtc := or (eq $val.Path $path) ($sin)}} {{if and $prm $last}}{{$mtc = true}}{{end}} {{$val.Item}} {{if not $last}} / {{end}} {{end}}
{{else}} {{if and .IsUserProfile .IsPermalink}} {{end}} {{end}} {{if and .IsUserProfile (not .IsPermalink)}} {{if gt .Room.Members 0}}
{{.Room.Members}} Follower{{if gt .Room.Members 1}}s{{end}}
{{end}} {{end}}
{{if and .LoggedInUser (not .IsPermalink) (not .IsPage)}} {{if or (and .IsUserProfile .IsOwner) (and (not .IsUserProfile) (or .IsOwner .IsMember))}}
{{end}} {{end}} {{if and (not .LoggedInUser) (not .IsPermalink) (not .IsReplyPermalink)}} {{end}} {{if and .LoggedInUser (not .IsMember) (not .IsOwner) (not .IsUserProfile) (not .IsPermalink)}}
{{end}} {{if and .LoggedInUser (not .IsPermalink) (.IsPage)}} {{if or .IsOwner .IsMember}}
{{end}} {{end}}
{{if or .IsAdmin .IsOwner}}
{{end}} {{$hms := .HomeServerURL}} {{if not .IsPage}} {{if .IsPermalink}} {{if .PermalinkedPost}} {{$rpth := .Room.Path}} {{$rid := .Room.ID}} {{$liu := .LoggedInUser}}
{{template "timeline-event" Map "Event" .PermalinkedPost "HomeServerURL" $hms "PermalinkedPost" true "RoomPath" $rpth "LoggedInUser" $liu "RoomID" $rid "Focus" true}}
{{if .LoggedInUser}} {{if or .IsMember .IsOwner}}
{{end}} {{else}}
{{end}}
{{end}}
{{end}} {{if and .LoggedInUser }}
{{end}}
{{if .IsReplyPermalink}} {{end}} {{$rpth := .Room.Path}} {{$rid := .Room.ID}} {{$liu := .LoggedInUser}} {{if .IsPermalink}}
{{else}} {{$rpth := .Room.Path}} {{$rid := .Room.ID}} {{$liu := .LoggedInUser}} {{range $idx, $post := .Posts}} {{if and (not $post.Redacted)}} {{template "timeline-event" Map "Event" $post "HomeServerURL" $hms "RoomPath" $rpth "LoggedInUser" $liu "RoomID" $rid}} {{end}} {{end}} {{end}}
{{else}}
{{Title .Room.Name}}
{{$rid := .Room.ID}} {{$rpth := .Room.Path}} {{$liu := .LoggedInUser}} {{range $idx, $post := .Posts}} {{if and (eq $post.Type "com.hummingbard.post") (eq $idx 0) (not $post.Redacted)}}
{{$con := index $post.Content "bodyHTML"}} {{$con}}
Last Edited: {{$post.Date}}
{{end}} {{end}}
{{end}} {{if and (not .IsPermalink) (not .IsPage)}} {{end}}
{{if not .IsUserProfile}} {{template "timeline-sidebar" .}} {{end}}
{{template "state" .}}
{{end}}