mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 22:32:33 +03:00
feat: add post text slice if too big on threads list
This commit is contained in:
parent
b550c8c16d
commit
16d5fa039e
@ -35,7 +35,14 @@
|
|||||||
{{ if ne $Post.Title "" }}
|
{{ if ne $Post.Title "" }}
|
||||||
<h5 class="card-title">{{$Post.Title}}</h5>
|
<h5 class="card-title">{{$Post.Title}}</h5>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $textLength := len $Post.Text }}
|
||||||
|
{{ if gt $textLength 300 }}
|
||||||
|
<p class="card-text">{{ slice $Post.Text 0 300 }} ...</p>
|
||||||
|
{{ else }}
|
||||||
<p class="card-text">{{$Post.Text}}</p>
|
<p class="card-text">{{$Post.Text}}</p>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
<a href="/{{$Post.ID}}" class="btn btn-outline-primary">Open</a>
|
<a href="/{{$Post.ID}}" class="btn btn-outline-primary">Open</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user