feat(postcard): finished default layout with logo header, footer and site name

- default.htm ports WinterCMS's default layout: wrapper, header row with
  the Branding logo (or the site name), the inner-body card and a
  copyright footer; its text wrapper ends with the footer
- built-in header and footer partials (logo/body/url, body)
- layouts get siteName (Branding site name, else the display name of
  mail.from) and year; Brand.SiteName and migration
  202611130002_mail_brand_site_name
- cabana Branding form gets site_name (trimmed, max 255), mapped into the
  Branding preview draft; en/pl copy; img.logo brand CSS
- 35-06 Task 1 (G-35-8)
This commit is contained in:
Jakub Zych
2026-11-13 20:52:52 +01:00
parent fdc2094ffc
commit 093529d45c
24 changed files with 266 additions and 30 deletions

View File

@@ -90,6 +90,14 @@ img {
font-weight: bold;
text-decoration: none;
}
img.logo {
border: 0;
display: inline-block;
height: auto;
max-height: 60px;
max-width: 200px;
vertical-align: middle;
}
/* Body */
.body {
background-color: {{ .ContentBg }};

View File

@@ -1,14 +1,37 @@
name = "Default"
==
{{ .Content }}
{{ $copy := printf "© %v" .year }}{{ with .siteName }}{{ $copy = printf "%s %s" $copy . }}{{ end }}{{ partial "footer" "body" $copy }}
==
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">{{ .brandCss }}{{ .css }}</style>
</head>
<body>
<div class="content-body">{{ .Content }}</div>
<table class="wrapper layout-default" width="100%" cellpadding="0" cellspacing="0">
{{ if or .logoUrl .siteName }}{{ partial "header" "logo" .logoUrl "body" .siteName }}{{ end }}
<tr>
<td align="center">
<table class="content" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="body" width="100%" cellpadding="0" cellspacing="0">
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0">
<tr>
<td class="content-cell">
{{ .Content }}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
{{ $copy := printf "© %v" .year }}{{ with .siteName }}{{ $copy = printf "%s %s" $copy . }}{{ end }}{{ partial "footer" "body" $copy }}
</table>
</body>
</html>

View File

@@ -0,0 +1,16 @@
name = "Footer"
==
-------------------
{{ .body }}
==
<tr>
<td>
<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0">
<tr>
<td class="content-cell" align="center">
{{ markdown .body }}
</td>
</tr>
</table>
</td>
</tr>

View File

@@ -0,0 +1,9 @@
name = "Header"
==
{{ .body }}
==
<tr>
<td class="header">
{{ if .url }}<a href="{{ .url }}">{{ if .logo }}<img src="{{ .logo }}" class="logo" alt="{{ .body }}" />{{ else }}{{ .body }}{{ end }}</a>{{ else if .logo }}<img src="{{ .logo }}" class="logo" alt="{{ .body }}" />{{ else }}<span>{{ .body }}</span>{{ end }}
</td>
</tr>