feat(ads): add a link-formatting help aside to the banner message editor
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 48s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m7s

On the campaign detail page, beside the "Add message" form, a static aside
explains the message markdown: plain text is escaped, `[text](url)` becomes a
link, and only http(s)/root-relative targets are linkified (others show as
plain text). New .form-help (flex row) + .help (muted aside) console styles;
wraps below the form on a narrow viewport.
This commit is contained in:
Ilia Denisov
2026-06-15 23:35:52 +02:00
parent cb4a31a860
commit 53c6e34c13
2 changed files with 25 additions and 0 deletions
@@ -39,11 +39,20 @@
</div>
{{else}}<p class="note">no messages yet</p>{{end}}
<h3>Add message</h3>
<div class="form-help">
<form class="form col" method="post" action="/_gm/banners/{{.ID}}/messages">
<label>English <input type="text" name="body_en" maxlength="500" required></label>
<label>Russian <input type="text" name="body_ru" maxlength="500" required></label>
<div><button type="submit">Add message</button></div>
</form>
<aside class="help">
<h4>Formatting</h4>
<p>Plain text is shown as-is (any HTML is escaped).</p>
<p>Add a link with markdown — <code>[visible text](https://example.com)</code> — which renders as the linked <em>visible text</em>.</p>
<p>Only <code>https://</code>, <code>http://</code> and root-relative <code>/path</code> targets become links; any other scheme (e.g. <code>javascript:</code>, <code>ftp:</code>) is dropped and shown as plain text.</p>
<p>Keep it short: an over-long line scrolls in the strip. The same formatting applies when editing a message above.</p>
</aside>
</div>
</section>
{{end}}
{{- end}}