2024-06-19 01:08:05 +04:00
|
|
|
package web
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
import "net/http"
|
|
|
|
|
|
|
|
import "git.arav.su/Arav/dwelling-home/pkg/util"
|
2024-09-14 18:36:08 +04:00
|
|
|
import "github.com/invopop/ctxi18n/i18n"
|
2024-06-19 01:08:05 +04:00
|
|
|
|
|
|
|
templ Article(title, description, body, urlName string, date time.Time, r *http.Request) {
|
2024-09-14 18:36:08 +04:00
|
|
|
@base(title + " - " + i18n.T(ctx, "base.section.stuff"), description, "", "/stuff/article/"+urlName, r, articleHead()) {
|
2024-06-19 01:08:05 +04:00
|
|
|
<article>
|
|
|
|
<header>
|
|
|
|
<h2>{ title }</h2>
|
|
|
|
<div class="menu">
|
2024-09-14 18:36:08 +04:00
|
|
|
<a href="/stuff#articles">{ i18n.T(ctx, "article.go-back") }</a>
|
2024-06-19 01:08:05 +04:00
|
|
|
{{ dctz := util.ToClientTimezone(date, r) }}
|
|
|
|
<time datetime={ dctz.Format("2006-01-02") }>{ dctz.Format("02 January 2006") }</time>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
@templ.Raw(body)
|
|
|
|
</article>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
templ articleHead() {
|
|
|
|
<link rel="stylesheet" href="/assets/css/articles.css"/>
|
|
|
|
}
|