jojo/templates/devtest/buttons.tmpl
0ko 5088d3ab12 fix(ui/buttons): implement .disabled class (#10410)
Followup to https://codeberg.org/forgejo/forgejo/pulls/9359. `templates/repo/issue/list.tmpl` had buttons changed which had `.disabled` on them conditionally.

* adjust devtest page to have such buttons
* implement `.disabled` for the newer buttons that does the same thing as the `.ui` buttons do: apply custom opacity, disable pointer events
    * this is the most boring way of implementing this

Reported-by: @Gusted
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10410
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-12-16 14:18:08 +01:00

51 lines
1.1 KiB
Go HTML Template

{{template "base/head" .}}
<div class="page-content devtest ui container">
<h1>Buttons</h1>
<p>
Main types:
<a href="#primary">primary</a>,
<a href="#secondary">secondary</a>,
<a href="#danger">dangerous</a>.
<br>
</p>
<p>
Can optionally contain an icon.
</p>
<h2 id="primary">Primary</h2>
<div class="button-sequence">
<button class="primary button" type="button">
Follow
</button>
<a class="primary disabled button" href="">
{{svg "octicon-person"}}
{{ctx.Locale.Tr "user.follow"}}
</a>
</div>
<h2 id="secondary">Secondary</h2>
<div class="button-sequence">
<button class="secondary button" type="button">
Follow
</button>
<a class="secondary disabled button" href="">
{{svg "octicon-person"}}
{{ctx.Locale.Tr "user.unfollow"}}
</a>
</div>
<h2 id="danger">Dangerous (<code>danger</code>)</h2>
<div class="button-sequence">
<button class="danger button" type="button">
Delete
</button>
<a class="danger disabled button" href="">
{{svg "octicon-trash"}}
Delete
</a>
</div>
</div>
{{template "base/footer" .}}