Tweak news appearance
This commit is contained in:
parent
f8d5f9fce5
commit
3324428f8b
|
@ -1,16 +1,18 @@
|
|||
<div class="timeline-item flex flex-column pa3 mb2 br3" {{ with .FilterTitle }}data-filter-title="{{ . }}"{{ end }}>
|
||||
{{/* top bar - avatar, info, date */}}
|
||||
<div class="flex items-center">
|
||||
{{ if .OwnerAvatarUrl }}
|
||||
<a class="flex-shrink-0" href="{{ .OwnerUrl }}">
|
||||
<img class="avatar-icon lite {{ if not .SmallInfo }}big{{ end }} {{ if .SmallInfo }}mr2{{ else }}mr3{{ end }}" src="{{ .OwnerAvatarUrl }}" />
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
<div class="overflow-hidden flex-grow-1 flex flex-column justify-center">
|
||||
{{ if .Breadcrumbs }}
|
||||
{{ template "breadcrumbs.html" .Breadcrumbs }}
|
||||
{{ end }}
|
||||
{{ if .Title }}
|
||||
<div class="f5 nowrap truncate">
|
||||
<div class="f5 {{ if not .AllowTitleWrap }}nowrap truncate{{ end }}">
|
||||
{{ with .TypeTitle }}<b class="dn di-ns">{{ . }}:</b>{{ end }}
|
||||
<a href="{{ .Url }}">{{ .Title }}</a>
|
||||
</div>
|
||||
|
|
|
@ -258,12 +258,13 @@ type TimelineItem struct {
|
|||
OwnerUrl string
|
||||
|
||||
Description template.HTML
|
||||
TruncateDescription bool
|
||||
|
||||
PreviewMedia TimelineItemMedia
|
||||
EmbedMedia []TimelineItemMedia
|
||||
|
||||
SmallInfo bool
|
||||
AllowTitleWrap bool
|
||||
TruncateDescription bool
|
||||
CanShowcase bool // whether this snippet can be shown in a showcase gallery
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,10 @@ func Index(c *RequestContext) ResponseData {
|
|||
if len(newsThreads) > 0 {
|
||||
t := newsThreads[0]
|
||||
item := PostToTimelineItem(lineageBuilder, &t.FirstPost, &t.Thread, &t.Project, t.FirstPostAuthor, c.Theme)
|
||||
item.OwnerAvatarUrl = ""
|
||||
item.Breadcrumbs = nil
|
||||
item.TypeTitle = ""
|
||||
item.AllowTitleWrap = true
|
||||
item.Description = template.HTML(t.FirstPostCurrentVersion.TextParsed)
|
||||
item.TruncateDescription = true
|
||||
newsPostItem = &item
|
||||
|
|
Loading…
Reference in New Issue