Skip to content

Commit 9e542d2

Browse files
authored
Change empty links to buttons (hestiacp#3172)
* Change all anchors with href="#" to buttons * Move function to the correct place * Use button instead * Build CSS * Add type="button" * Use button in update banner
1 parent 7d46ba8 commit 9e542d2

18 files changed

+50
-36
lines changed

web/css/src/themes/default.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
border: 0;
226226
padding-left: 5px;
227227
padding-right: 5px;
228+
background: none;
228229

229230
& .fas {
230231
color: #c36;
@@ -239,14 +240,16 @@
239240
.top-bar-notification-delete-all {
240241
display: block;
241242
background-color: transparent;
242-
border: 0;
243-
color: inherit;
244-
width: 100%;
245243
text-align: center;
244+
border: 0;
246245
padding: 10px 15px;
246+
width: 100%;
247+
background: none;
248+
color: var(--color-text-link);
247249

248250
&:hover {
249251
background-color: rgb(0 0 0 / 5%);
252+
color: var(--color-text-link-hover);
250253
}
251254

252255
& .fas {
@@ -613,7 +616,9 @@
613616
.toolbar-sorting-toggle {
614617
color: var(--color-text);
615618
display: block;
619+
border: 0;
616620
padding-bottom: 5px;
621+
background: none;
617622
text-transform: uppercase;
618623

619624
&:hover {
@@ -1556,8 +1561,10 @@
15561561
font-weight: 600;
15571562
border-radius: var(--border-radius-base);
15581563
margin-left: -3px;
1564+
border: 0;
15591565
padding-left: 3px;
15601566
padding-right: 3px;
1567+
background-color: transparent;
15611568

15621569
&:hover {
15631570
text-decoration: none;
@@ -2625,7 +2632,10 @@
26252632
position: fixed;
26262633
bottom: 0;
26272634

2628-
& a {
2635+
& button {
2636+
border: 0;
2637+
padding: 0;
2638+
background-color: transparent;
26292639
color: #fff;
26302640
font-weight: 500;
26312641

web/css/themes/default.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/templates/footer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
<p x-data="{ open: true }" x-cloak x-show="open" class="updates-banner">
99
<strong>New updates are available!</strong> To upgrade your server now, run
1010
<code>apt update && apt upgrade</code> from a shell session.
11-
(<a href="#" x-on:click="open = false"><strong>hide</strong></a>)
11+
(<button type="button" x-on:click="open = false">
12+
<strong>hide</strong>
13+
</button>)
1214
</p>
1315
<?php } ?>
1416
<div title="<?= _("Confirmation") ?>" class="dialog js-confirm-dialog-redirect">

web/templates/pages/edit_web.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ class="<?= $v_status ?>"
239239
<span class="values-list-value"><?= $v_ssl_issuer ?></span>
240240
</li>
241241
<p x-cloak x-show="letsEncryptEnabled" id="letsinfo">
242-
<a x-on:click="showCertificates = !showCertificates" href="#" class="form-link"><?= _("Show Certificate") ?></a>
242+
<button x-on:click="showCertificates = !showCertificates" type="button" class="form-link">
243+
<?= _("Show Certificate") ?>
244+
</button>
243245
</p>
244246
</ul>
245247
<?php } ?>
@@ -390,7 +392,7 @@ class="<?= $v_status ?>"
390392
<div class="js-ftp-account js-ftp-account-nrm" name="v_add_domain_ftp" style="display:<?php if (empty($v_ftp_user)) { echo 'none';} else {echo 'block';}?> ;">
391393
<div class="u-mb10">
392394
<?= _("FTP") ?> #<span class="ftp-user-number"><?=$i + 1; ?></span>
393-
<a class="form-link form-link-danger" href="#" onclick="App.Actions.WEB.remove_ftp_user(this)"><?= _("delete") ?></a>
395+
<button type="button" class="form-link form-link-danger" onclick="App.Actions.WEB.remove_ftp_user(this)"><?= _("delete") ?></button>
394396
<input type="hidden" class="v-ftp-user-deleted" name="v_ftp_user[<?=$i ?>][delete]" value="0">
395397
<input type="hidden" class="v-ftp-user-is-new" name="v_ftp_user[<?=$i ?>][is_new]" value="<?=htmlentities($ftp_user['is_new']) ?>">
396398
</div>

web/templates/pages/list_access_keys.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
</div>
88
<div class="toolbar-right">
99
<div class="toolbar-sorting">
10-
<a href="#" class="toolbar-sorting-toggle" title="<?= _("Sort items") ?>">
10+
<button class="toolbar-sorting-toggle" type="button" title="<?= _("Sort items") ?>">
1111
<?= _("sort by") ?>: <b><?= _("Date") ?> <i class="fas fa-arrow-down-a-z"></i></b>
12-
</a>
12+
</button>
1313
<ul class="toolbar-sorting-menu animate__animated animate__fadeIn u-hidden">
1414
<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?= _("Date") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>
1515
<li entity="sort-key"><span class="name"><?= _("Access Key") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>

web/templates/pages/list_cron.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
</div>
1414
<div class="toolbar-right">
1515
<div class="toolbar-sorting">
16-
<a href="#" class="toolbar-sorting-toggle" title="<?= _("Sort items") ?>">
16+
<button class="toolbar-sorting-toggle" type="button" title="<?= _("Sort items") ?>">
1717
<?= _("sort by") ?>:
1818
<b>
1919
<?php if ($_SESSION['userSortOrder'] === 'name') { $label = _('Name'); } else { $label = _('Date'); } ?>
2020
<?=$label;?> <i class="fas fa-arrow-down-a-z"></i>
2121
</b>
22-
</a>
22+
</button>
2323
<ul class="toolbar-sorting-menu animate__animated animate__fadeIn u-hidden">
2424
<li entity="sort-name"><span class="name <?php if ($_SESSION['userSortOrder'] === 'name') { echo 'active'; } ?>"><?= _("Command") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>
2525
<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?= _("Date") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>

web/templates/pages/list_db.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
</div>
3939
<div class="toolbar-right">
4040
<div class="toolbar-sorting">
41-
<a href="#" class="toolbar-sorting-toggle" title="<?= _("Sort items") ?>">
41+
<button class="toolbar-sorting-toggle" type="button" title="<?= _("Sort items") ?>">
4242
<?= _("sort by") ?>:
4343
<b>
4444
<?php if ($_SESSION['userSortOrder'] === 'name') { $label = _('Name'); } else { $label = _('Date'); } ?>
4545
<?=$label;?> <i class="fas fa-arrow-down-a-z"></i>
4646
</b>
47-
</a>
47+
</button>
4848
<ul class="toolbar-sorting-menu animate__animated animate__fadeIn u-hidden">
4949
<li entity="sort-charset"><span class="name"><?= _("Charset") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>
5050
<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?= _("Date") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>

web/templates/pages/list_dns.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
</div>
99
<div class="toolbar-right">
1010
<div class="toolbar-sorting">
11-
<a href="#" class="toolbar-sorting-toggle" title="<?= _("Sort items") ?>">
11+
<button class="toolbar-sorting-toggle" type="button" title="<?= _("Sort items") ?>">
1212
<?= _("sort by") ?>:
1313
<b>
1414
<?php if ($_SESSION['userSortOrder'] === 'name') { $label = _('Name'); } else { $label = _('Date'); } ?>
1515
<?=$label;?> <i class="fas fa-arrow-down-a-z"></i>
1616
</b>
17-
</a>
17+
</button>
1818
<ul class="toolbar-sorting-menu animate__animated animate__fadeIn u-hidden">
1919
<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?= _("Date") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>
2020
<li entity="sort-expire" sort_as_int="1"><span class="name"><?= _("Expire") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>

web/templates/pages/list_dns_public.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
</div>
1111
<div class="toolbar-right">
1212
<div class="toolbar-sorting">
13-
<a href="#" class="toolbar-sorting-toggle" title="<?= _("Sort items") ?>">
13+
<button class="toolbar-sorting-toggle" type="button" title="<?= _("Sort items") ?>">
1414
<?= _("sort by") ?>:
1515
<b>
1616
<?php if ($_SESSION['userSortOrder'] === 'name') { $label = _('Name'); } else { $label = _('Date'); } ?>
1717
<?=$label;?> <i class="fas fa-arrow-down-a-z"></i>
1818
</b>
19-
</a>
19+
</button>
2020
<ul class="toolbar-sorting-menu animate__animated animate__fadeIn u-hidden">
2121
<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?= _("Date") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>
2222
<li entity="sort-expire" sort_as_int="1"><span class="name"><?= _("Expire") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>

web/templates/pages/list_dns_rec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
</div>
1111
<div class="toolbar-right">
1212
<div class="toolbar-sorting">
13-
<a href="#" class="toolbar-sorting-toggle" title="<?= _("Sort items") ?>">
13+
<button class="toolbar-sorting-toggle" type="button" title="<?= _("Sort items") ?>">
1414
<?= _("sort by") ?>:
1515
<b>
1616
<?php if ($_SESSION['userSortOrder'] === 'name') { $label = _('Record'); } else { $label = _('Date'); } ?>
1717
<?=$label;?> <i class="fas fa-arrow-down-a-z"></i>
1818
</b>
19-
</a>
19+
</button>
2020
<ul class="toolbar-sorting-menu animate__animated animate__fadeIn u-hidden">
2121
<li entity="sort-date" sort_as_int="1"><span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?= _("Date") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>
2222
<li entity="sort-value"><span class="name"><?= _("IP or Value") ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span></li>

0 commit comments

Comments
 (0)