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) }}
|
2024-09-17 03:15:26 +04:00
|
|
|
<time datetime={ dctz.Format("2006-01-02") }>{ dctz.Format("02.01.2006") }</time>
|
2024-06-19 01:08:05 +04:00
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
@templ.Raw(body)
|
|
|
|
</article>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
templ articleHead() {
|
|
|
|
<link rel="stylesheet" href="/assets/css/articles.css"/>
|
|
|
|
}
|