feat(cabana): mail layouts and partials screens with reset, drift and custom layouts
- Layouts and partials controllers with catalog scoping, reset action and File version diff - Custom layout create/delete with in-use refusal; meta.deletable and customized/outdated row states - List schema golden fixtures updated for the two new row-state message keys Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{{- /* The File version tab (mailFileVersionView): the line diff of the override against the file, then the file itself. */ -}}
|
||||
{{- with .Data -}}
|
||||
{{- if .CustomLayout }}<p class="text-muted">{{ trans "backend::lang.mail.info_custom_layout" }}</p>{{ end -}}
|
||||
{{- if .Show -}}
|
||||
{{- if .Customized -}}
|
||||
{{- if .Identical }}<p>{{ trans "backend::lang.mail.file_identical" }}</p>
|
||||
{{- else if .Diff }}<p><strong>{{ trans "backend::lang.mail.file_changes" }}</strong></p><p class="text-muted">{{ trans "backend::lang.mail.file_legend" }}</p><pre class="summer-diff">{{ range .Diff }}<span class="{{ .Class }}">{{ .Text }}</span>{{ end }}</pre>{{ end -}}
|
||||
{{- else }}<p class="text-muted">{{ trans "backend::lang.mail.file_not_customized" }}</p>{{ end -}}
|
||||
<p><strong>{{ trans "backend::lang.mail.file_content" }}</strong></p><pre class="summer-diff">{{ range .Content }}<span class="summer-diff__ctx">{{ . }}</span>{{ end }}</pre>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- /* Lines at the top of a mail form (mailInfoView): description, file or custom code, status, sample variables, partial call, drift callout. */ -}}
|
||||
{{- with .Data -}}
|
||||
{{- if .Description }}<p>{{ .Description }}</p>{{ end -}}
|
||||
{{- if .File }}<p class="text-muted">{{ range .File }}{{ if .Code }}<code class="font-mono">{{ .Text }}</code>{{ else }}{{ .Text }}{{ end }}{{ end }}</p>{{ end -}}
|
||||
{{- if .CustomCode }}<p class="text-muted">{{ trans "backend::lang.mail.info_custom_layout" }} <code class="font-mono">{{ .CustomCode }}</code></p>{{ end -}}
|
||||
{{- if .Status }}<p><strong>{{ trans .Status }}</strong></p>{{ end -}}
|
||||
{{- if .Template }}{{ if .Variables }}<p>{{ trans "backend::lang.mail.info_variables" }} {{ range $i, $name := .Variables }}{{ if $i }}, {{ end }}<code class="font-mono">{{ $name }}</code>{{ end }}</p>{{ else }}<p>{{ trans "backend::lang.mail.info_no_samples" }}</p>{{ end }}{{ end -}}
|
||||
{{- if .Usage }}<p>{{ trans "backend::lang.mail.info_partial_usage" }} <code class="font-mono">{{ .Usage }}</code></p>{{ end -}}
|
||||
{{- if .Outdated }}<div class="summer-callout summer-callout--warning" role="status"><p class="summer-callout__title">{{ trans "backend::lang.mail.drift_title" }}</p><p class="summer-callout__text">{{ trans "backend::lang.mail.drift_text" }}</p></div>{{ end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,6 @@
|
||||
scopes:
|
||||
status:
|
||||
label: backend::lang.mail.filter_status
|
||||
modelClass: System\Models\MailLayout
|
||||
nameFrom: code
|
||||
scope: filterStatus
|
||||
@@ -0,0 +1,21 @@
|
||||
name: backend::lang.mail.layout.name
|
||||
form: ~/plugins/summercms/cabana/models/maillayout/fields.yaml
|
||||
modelClass: System\Models\MailLayout
|
||||
defaultRedirect: summercms/cabana/maillayouts
|
||||
|
||||
create:
|
||||
redirect: summercms/cabana/maillayouts/update/:id
|
||||
redirectClose: summercms/cabana/maillayouts
|
||||
|
||||
update:
|
||||
redirect: summercms/cabana/maillayouts/update/:id
|
||||
redirectClose: summercms/cabana/maillayouts
|
||||
|
||||
recordActions: [reset]
|
||||
|
||||
messages:
|
||||
create: backend::lang.mail.layout.new
|
||||
update: backend::lang.mail.layout.name
|
||||
saved: backend::lang.messages.form.saved
|
||||
deleteConfirm: backend::lang.mail.layout.delete_confirm
|
||||
deleted: backend::lang.messages.form.deleted
|
||||
@@ -0,0 +1,22 @@
|
||||
list: ~/plugins/summercms/cabana/models/maillayout/columns.yaml
|
||||
modelClass: System\Models\MailLayout
|
||||
title: backend::lang.mail.layout.list_title
|
||||
recordUrl: summercms/cabana/maillayouts/update/:id
|
||||
noRecordsMessage: backend::lang.mail.layout.list_empty
|
||||
recordsPerPage: 20
|
||||
showCheckboxes: false
|
||||
filter: config_filter.yaml
|
||||
defaultSort:
|
||||
column: name
|
||||
direction: asc
|
||||
|
||||
toolbar:
|
||||
buttons: [create]
|
||||
search:
|
||||
prompt: backend::lang.list.search_prompt
|
||||
|
||||
messages:
|
||||
create: backend::lang.mail.layout.new
|
||||
empty: backend::lang.mail.layout.list_empty
|
||||
rowStateCustomized: backend::lang.mail.state_customized
|
||||
rowStateOutdated: backend::lang.mail.state_outdated
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- /* The File version tab (mailFileVersionView): the line diff of the override against the file, then the file itself. */ -}}
|
||||
{{- with .Data -}}
|
||||
{{- if .CustomLayout }}<p class="text-muted">{{ trans "backend::lang.mail.info_custom_layout" }}</p>{{ end -}}
|
||||
{{- if .Show -}}
|
||||
{{- if .Customized -}}
|
||||
{{- if .Identical }}<p>{{ trans "backend::lang.mail.file_identical" }}</p>
|
||||
{{- else if .Diff }}<p><strong>{{ trans "backend::lang.mail.file_changes" }}</strong></p><p class="text-muted">{{ trans "backend::lang.mail.file_legend" }}</p><pre class="summer-diff">{{ range .Diff }}<span class="{{ .Class }}">{{ .Text }}</span>{{ end }}</pre>{{ end -}}
|
||||
{{- else }}<p class="text-muted">{{ trans "backend::lang.mail.file_not_customized" }}</p>{{ end -}}
|
||||
<p><strong>{{ trans "backend::lang.mail.file_content" }}</strong></p><pre class="summer-diff">{{ range .Content }}<span class="summer-diff__ctx">{{ . }}</span>{{ end }}</pre>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- /* Lines at the top of a mail form (mailInfoView): description, file or custom code, status, sample variables, partial call, drift callout. */ -}}
|
||||
{{- with .Data -}}
|
||||
{{- if .Description }}<p>{{ .Description }}</p>{{ end -}}
|
||||
{{- if .File }}<p class="text-muted">{{ range .File }}{{ if .Code }}<code class="font-mono">{{ .Text }}</code>{{ else }}{{ .Text }}{{ end }}{{ end }}</p>{{ end -}}
|
||||
{{- if .CustomCode }}<p class="text-muted">{{ trans "backend::lang.mail.info_custom_layout" }} <code class="font-mono">{{ .CustomCode }}</code></p>{{ end -}}
|
||||
{{- if .Status }}<p><strong>{{ trans .Status }}</strong></p>{{ end -}}
|
||||
{{- if .Template }}{{ if .Variables }}<p>{{ trans "backend::lang.mail.info_variables" }} {{ range $i, $name := .Variables }}{{ if $i }}, {{ end }}<code class="font-mono">{{ $name }}</code>{{ end }}</p>{{ else }}<p>{{ trans "backend::lang.mail.info_no_samples" }}</p>{{ end }}{{ end -}}
|
||||
{{- if .Usage }}<p>{{ trans "backend::lang.mail.info_partial_usage" }} <code class="font-mono">{{ .Usage }}</code></p>{{ end -}}
|
||||
{{- if .Outdated }}<div class="summer-callout summer-callout--warning" role="status"><p class="summer-callout__title">{{ trans "backend::lang.mail.drift_title" }}</p><p class="summer-callout__text">{{ trans "backend::lang.mail.drift_text" }}</p></div>{{ end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,6 @@
|
||||
scopes:
|
||||
status:
|
||||
label: backend::lang.mail.filter_status
|
||||
modelClass: System\Models\MailPartial
|
||||
nameFrom: code
|
||||
scope: filterStatus
|
||||
@@ -0,0 +1,14 @@
|
||||
name: backend::lang.mail.partial.name
|
||||
form: ~/plugins/summercms/cabana/models/mailpartial/fields.yaml
|
||||
modelClass: System\Models\MailPartial
|
||||
defaultRedirect: summercms/cabana/mailpartials
|
||||
|
||||
update:
|
||||
redirect: summercms/cabana/mailpartials/update/:id
|
||||
redirectClose: summercms/cabana/mailpartials
|
||||
|
||||
recordActions: [reset]
|
||||
|
||||
messages:
|
||||
update: backend::lang.mail.partial.name
|
||||
saved: backend::lang.messages.form.saved
|
||||
@@ -0,0 +1,21 @@
|
||||
list: ~/plugins/summercms/cabana/models/mailpartial/columns.yaml
|
||||
modelClass: System\Models\MailPartial
|
||||
title: backend::lang.mail.partial.list_title
|
||||
recordUrl: summercms/cabana/mailpartials/update/:id
|
||||
noRecordsMessage: backend::lang.mail.partial.list_empty
|
||||
recordsPerPage: 20
|
||||
showCheckboxes: false
|
||||
filter: config_filter.yaml
|
||||
defaultSort:
|
||||
column: code
|
||||
direction: asc
|
||||
|
||||
toolbar:
|
||||
buttons: []
|
||||
search:
|
||||
prompt: backend::lang.list.search_prompt
|
||||
|
||||
messages:
|
||||
empty: backend::lang.mail.partial.list_empty
|
||||
rowStateCustomized: backend::lang.mail.state_customized
|
||||
rowStateOutdated: backend::lang.mail.state_outdated
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- /* The File version tab (mailFileVersionView): the line diff of the override against the file, then the file itself. */ -}}
|
||||
{{- with .Data -}}
|
||||
{{- if .CustomLayout }}<p class="text-muted">{{ trans "backend::lang.mail.info_custom_layout" }}</p>{{ end -}}
|
||||
{{- if .Show -}}
|
||||
{{- if .Customized -}}
|
||||
{{- if .Identical }}<p>{{ trans "backend::lang.mail.file_identical" }}</p>
|
||||
{{- else if .Diff }}<p><strong>{{ trans "backend::lang.mail.file_changes" }}</strong></p><p class="text-muted">{{ trans "backend::lang.mail.file_legend" }}</p><pre class="summer-diff">{{ range .Diff }}<span class="{{ .Class }}">{{ .Text }}</span>{{ end }}</pre>{{ end -}}
|
||||
{{- else }}<p class="text-muted">{{ trans "backend::lang.mail.file_not_customized" }}</p>{{ end -}}
|
||||
<p><strong>{{ trans "backend::lang.mail.file_content" }}</strong></p><pre class="summer-diff">{{ range .Content }}<span class="summer-diff__ctx">{{ . }}</span>{{ end }}</pre>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- /* Lines at the top of a mail form (mailInfoView): description, file or custom code, status, sample variables, partial call, drift callout. */ -}}
|
||||
{{- with .Data -}}
|
||||
{{- if .Description }}<p>{{ .Description }}</p>{{ end -}}
|
||||
{{- if .File }}<p class="text-muted">{{ range .File }}{{ if .Code }}<code class="font-mono">{{ .Text }}</code>{{ else }}{{ .Text }}{{ end }}{{ end }}</p>{{ end -}}
|
||||
{{- if .CustomCode }}<p class="text-muted">{{ trans "backend::lang.mail.info_custom_layout" }} <code class="font-mono">{{ .CustomCode }}</code></p>{{ end -}}
|
||||
{{- if .Status }}<p><strong>{{ trans .Status }}</strong></p>{{ end -}}
|
||||
{{- if .Template }}{{ if .Variables }}<p>{{ trans "backend::lang.mail.info_variables" }} {{ range $i, $name := .Variables }}{{ if $i }}, {{ end }}<code class="font-mono">{{ $name }}</code>{{ end }}</p>{{ else }}<p>{{ trans "backend::lang.mail.info_no_samples" }}</p>{{ end }}{{ end -}}
|
||||
{{- if .Usage }}<p>{{ trans "backend::lang.mail.info_partial_usage" }} <code class="font-mono">{{ .Usage }}</code></p>{{ end -}}
|
||||
{{- if .Outdated }}<div class="summer-callout summer-callout--warning" role="status"><p class="summer-callout__title">{{ trans "backend::lang.mail.drift_title" }}</p><p class="summer-callout__text">{{ trans "backend::lang.mail.drift_text" }}</p></div>{{ end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,11 @@
|
||||
scopes:
|
||||
locale:
|
||||
label: backend::lang.mail.template.locale
|
||||
modelClass: System\Models\MailTemplate
|
||||
nameFrom: code
|
||||
scope: filterLocale
|
||||
status:
|
||||
label: backend::lang.mail.filter_status
|
||||
modelClass: System\Models\MailTemplate
|
||||
nameFrom: code
|
||||
scope: filterStatus
|
||||
@@ -7,6 +7,8 @@ update:
|
||||
redirect: summercms/cabana/mailtemplates/update/:id
|
||||
redirectClose: summercms/cabana/mailtemplates
|
||||
|
||||
recordActions: [reset]
|
||||
|
||||
messages:
|
||||
update: backend::lang.mail.template.name
|
||||
saved: backend::lang.messages.form.saved
|
||||
|
||||
@@ -5,6 +5,7 @@ recordUrl: summercms/cabana/mailtemplates/update/:id
|
||||
noRecordsMessage: backend::lang.mail.template.list_empty
|
||||
recordsPerPage: 20
|
||||
showCheckboxes: false
|
||||
filter: config_filter.yaml
|
||||
defaultSort:
|
||||
column: code
|
||||
direction: asc
|
||||
@@ -16,3 +17,5 @@ toolbar:
|
||||
|
||||
messages:
|
||||
empty: backend::lang.mail.template.list_empty
|
||||
rowStateCustomized: backend::lang.mail.state_customized
|
||||
rowStateOutdated: backend::lang.mail.state_outdated
|
||||
|
||||
Reference in New Issue
Block a user