PWA: FAB-Button auf Panel 1 entfernt, Lösch-Button für Produktzeilen
- FAB (Plus-Button unten rechts) nur noch auf Panel 0 (STZ-Liste) sichtbar,
Panel 1 hat bereits den Inline-Button "+ Leistung hinzufügen"
- Lösch-Button (🗑️) für verbaute Produkte (order/added) im Product-Card-Header
mit Bestätigungsdialog hinzugefügt
- Cache-Busting auf v=2.7
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
292db5d40c
commit
3c9add6864
3 changed files with 26 additions and 14 deletions
|
|
@ -459,6 +459,12 @@ body {
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
.product-card-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
.product-name {
|
.product-name {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
|
||||||
30
js/pwa.js
30
js/pwa.js
|
|
@ -628,27 +628,18 @@
|
||||||
|
|
||||||
updateFab: function() {
|
updateFab: function() {
|
||||||
var $fab = $('#fab-add');
|
var $fab = $('#fab-add');
|
||||||
var stz = this.data.stz;
|
|
||||||
var isDraft = stz && stz.status == 0;
|
|
||||||
|
|
||||||
// FAB auf Panel 0 (neuen STZ anlegen) und Panel 1 (Leistung hinzufuegen, nur Draft)
|
// FAB nur auf Panel 0 (neuen STZ anlegen) - Panel 1 hat eigenen Inline-Button
|
||||||
if (this.state.activePanel === 0 && this.state.canWrite) {
|
if (this.state.activePanel === 0 && this.state.canWrite) {
|
||||||
$fab.removeClass('hidden');
|
$fab.removeClass('hidden');
|
||||||
} else if (this.state.activePanel === 1 && isDraft && this.state.canEditStz) {
|
|
||||||
$fab.removeClass('hidden');
|
|
||||||
} else {
|
} else {
|
||||||
$fab.addClass('hidden');
|
$fab.addClass('hidden');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleFabClick: function() {
|
handleFabClick: function() {
|
||||||
switch (this.state.activePanel) {
|
if (this.state.activePanel === 0) {
|
||||||
case 0:
|
this.showCreateStzDialog();
|
||||||
this.showCreateStzDialog();
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
this.showAddLeistungDialog();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -938,6 +929,16 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Produkt loeschen
|
||||||
|
$panel.find('.btn-delete-product').on('click', function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
var id = $(this).data('id');
|
||||||
|
var origin = $(this).data('origin');
|
||||||
|
self.showConfirm('Produkt löschen?', 'Dieses Produkt wirklich vom Stundenzettel entfernen?', 'Löschen').then(function(ok) {
|
||||||
|
if (ok) self.deleteLine(id, origin);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Produkt hinzufuegen
|
// Produkt hinzufuegen
|
||||||
$panel.find('#btn-add-product-inline').on('click', function() {
|
$panel.find('#btn-add-product-inline').on('click', function() {
|
||||||
self.showAddProductDialog();
|
self.showAddProductDialog();
|
||||||
|
|
@ -1264,7 +1265,12 @@
|
||||||
html += '<div class="product-desc">' + self.escHtml(p.description) + '</div>';
|
html += '<div class="product-desc">' + self.escHtml(p.description) + '</div>';
|
||||||
}
|
}
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
html += '<div class="product-card-actions">';
|
||||||
html += '<span class="badge badge-' + p.origin + '">' + self.getOriginLabel(p.origin) + '</span>';
|
html += '<span class="badge badge-' + p.origin + '">' + self.getOriginLabel(p.origin) + '</span>';
|
||||||
|
if (isDraft && canWrite) {
|
||||||
|
html += '<button class="btn btn-danger btn-small btn-delete-product" data-id="' + p.id + '" data-origin="' + p.origin + '">🗑</button>';
|
||||||
|
}
|
||||||
|
html += '</div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div class="product-qty-row">';
|
html += '<div class="product-qty-row">';
|
||||||
|
|
|
||||||
4
pwa.php
4
pwa.php
|
|
@ -38,7 +38,7 @@ $themeColor = getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#4390dc');
|
||||||
<link rel="manifest" href="manifest.json">
|
<link rel="manifest" href="manifest.json">
|
||||||
<link rel="icon" type="image/png" sizes="192x192" href="img/icon-192.png">
|
<link rel="icon" type="image/png" sizes="192x192" href="img/icon-192.png">
|
||||||
<link rel="apple-touch-icon" href="img/icon-192.png">
|
<link rel="apple-touch-icon" href="img/icon-192.png">
|
||||||
<link rel="stylesheet" href="css/pwa.css?v=2.6">
|
<link rel="stylesheet" href="css/pwa.css?v=2.7">
|
||||||
<style>:root { --primary: <?php echo htmlspecialchars($themeColor); ?>; }</style>
|
<style>:root { --primary: <?php echo htmlspecialchars($themeColor); ?>; }</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -160,7 +160,7 @@ $themeColor = getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#4390dc');
|
||||||
authUrl: '<?php echo dol_buildpath('/stundenzettel/ajax/pwa_auth.php', 1); ?>'
|
authUrl: '<?php echo dol_buildpath('/stundenzettel/ajax/pwa_auth.php', 1); ?>'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<script src="js/pwa.js?v=2.6"></script>
|
<script src="js/pwa.js?v=2.7"></script>
|
||||||
|
|
||||||
<!-- Service Worker Registration -->
|
<!-- Service Worker Registration -->
|
||||||
<script>
|
<script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue