forgejo/templates/devtest/buttons.tmpl
0ko 5088d3ab12
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
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" .}}