Convert system_certmanager.php to font awesome icons

Automatically add confirmation dialog to all fa-trash icons
This commit is contained in:
Stephen Beaver 2015-11-05 09:05:52 -05:00
parent c10cb19609
commit 0619c9db22
4 changed files with 16 additions and 20 deletions

View File

@ -327,3 +327,8 @@ form .btn + .btn {
vertical-align: middle;
margin-right: 6px;
}
.fa-trash
{
color: red;
}

View File

@ -268,7 +268,7 @@ display_top_tabs($tab_array);
</td>
<td>
<a class="fa fa-pencil" title="<?=gettext("Edit alias"); ?>" href="firewall_aliases_edit.php?id=<?=$i?>"></a>
<a class="fa fa-trash" title="<?=gettext("Delete alias")?>" href="?act=del&amp;tab=<?=$tab?>&amp;id=<?=$i?>" onclick="return confirm('<?=gettext("Are you sure you want to delete this alias?")?>')"></a>
<a class="fa fa-trash" title="<?=gettext("Delete alias")?>" href="?act=del&amp;tab=<?=$tab?>&amp;id=<?=$i?>"></a>
</td>
</tr>
<?php endif?>

View File

@ -119,16 +119,16 @@ $(function() {
input.change();
});
// Add confirm to all btn-danger buttons
// Add confirm to all btn-danger buttons and fa-trash icons
// Use element title in the confirmation message, or if not available
// the element value
$('.btn-danger').on('click', function(e){
$('.btn-danger, .fa-trash').on('click', function(e){
var msg = $.trim(this.textContent);
if(!msg)
var msg = $.trim(this.value).toLowerCase();
var q = 'Are you sure you wish to '+ msg +'?';
var q = 'Are you Sure you wish to '+ msg +'?';
if ($(this).attr('title') != undefined)
q = $(this).attr('title')+'?';
@ -178,6 +178,7 @@ $(function() {
$('input[type=checkbox][data-toggle="collapse"]:not(:checked)').each(function() {
$( $(this).data('target') ).addClass('collapse');
});
$('input[type=checkbox][data-toggle="disable"]:not(:checked)').each(function() {
$( $(this).data('target') ).prop('disabled', true);
});

View File

@ -583,7 +583,7 @@ if (!($act == "new" || (($_POST['save'] == gettext("Save")) && $input_errors)))
<th><?=gettext("Issuer")?></th>
<th><?=gettext("Distinguished Name")?></th>
<th><?=gettext("In Use")?></th>
<th><?=gettext("Actions")?></th>
<th class="col-sm-2"><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody>
@ -656,24 +656,14 @@ foreach($a_cert as $i => $cert):
<?php endif?>
</td>
<td>
<a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="btn btn-xs btn-default">
<?=gettext("export")?>
</a>
<a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="btn btn-xs btn-default">
<?=gettext("export key")?>
</a>
<a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="btn btn-xs btn-default">
<?=gettext("export p12")?>
</a>
<a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export")?>"></a>
<a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export key")?>"></a>
<a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export P12")?>"> P12</a>
<?php if (!cert_in_use($cert['refid'])): ?>
<a href="system_certmanager.php?act=del&amp;id=<?=$i?>" class="btn btn-xs btn-danger">
<?=gettext("delete")?>
</a>
<a href="system_certmanager.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext("Delete")?>"></a>
<?php endif?>
<?php if ($cert['csr']): ?>
<a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="btn btn-xs btn-default">
<?=gettext("update csr")?>
</a>
<a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="fa fa-refresh" title="<?=gettext("Update csr")?>"></a>
<?php endif?>
</td>
</tr>