update
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<?= $this->section('content') ?>
|
||||
<?php $fmt = static fn ($v) => number_format((float) $v, 2, ',', ' ') . ' zł'; ?>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<div class="d-flex flex-column flex-sm-row justify-content-between align-items-sm-center gap-2 mb-3">
|
||||
<h1 class="h4 mb-0">Wyceny</h1>
|
||||
<a href="<?= site_url('investments/valuations/new') ?>" class="btn btn-primary">+ Nowa wycena</a>
|
||||
</div>
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0 align-middle">
|
||||
<table class="table table-hover mb-0 align-middle valuation-history">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Data</th>
|
||||
@@ -44,11 +44,11 @@
|
||||
<?php if (empty($valuations)): ?>
|
||||
<tr><td colspan="4" class="text-center text-muted py-4">Brak wycen.</td></tr>
|
||||
<?php else: foreach ($valuations as $v): ?>
|
||||
<tr>
|
||||
<td><?= esc($v['date']) ?></td>
|
||||
<td><?= esc($v['instrument_name'] ?? '—') ?></td>
|
||||
<td class="text-end"><?= $fmt($v['value']) ?></td>
|
||||
<td class="text-end">
|
||||
<tr class="valuation-row">
|
||||
<td data-label="Data"><?= esc($v['date']) ?></td>
|
||||
<td data-label="Instrument"><?= esc($v['instrument_name'] ?? '—') ?></td>
|
||||
<td data-label="Wartość" class="text-end"><?= $fmt($v['value']) ?></td>
|
||||
<td data-label="Akcje" class="text-end valuation-actions">
|
||||
<a href="<?= site_url('investments/valuations/' . $v['id'] . '/edit') ?>" class="btn btn-sm btn-outline-secondary">Edytuj</a>
|
||||
<a href="<?= site_url('investments/valuations/' . $v['id'] . '/delete') ?>" class="btn btn-sm btn-outline-danger"
|
||||
onclick="return confirm('Usunąć wycenę?')">Usuń</a>
|
||||
@@ -59,4 +59,33 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@media (max-width: 767.98px) {
|
||||
.valuation-history thead { display: none; }
|
||||
.valuation-history, .valuation-history tbody,
|
||||
.valuation-history .valuation-row, .valuation-history .valuation-row td {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.valuation-history .valuation-row { padding: .75rem; border-bottom: 1px solid var(--bs-border-color); }
|
||||
.valuation-history .valuation-row td {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: .3rem 0;
|
||||
border: 0;
|
||||
text-align: right !important;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.valuation-history .valuation-row td::before {
|
||||
content: attr(data-label);
|
||||
flex: 0 0 auto;
|
||||
color: var(--bs-secondary-color);
|
||||
font-size: .875em;
|
||||
text-align: left;
|
||||
}
|
||||
.valuation-history .valuation-actions { align-items: center; flex-wrap: wrap; }
|
||||
}
|
||||
</style>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
Reference in New Issue
Block a user