diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2024-08-23 13:53:46 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2024-08-23 13:53:46 +0000 |
| commit | 5a6c53a15188a9a46816167df202d0358b163445 (patch) | |
| tree | 1cca4cdc88db310cdb29e746e8a98fc214eb31ec | |
| parent | 9fe431fa6deafd65a0af38f77a7352374d557e6f (diff) | |
- Feature: Sortierung der Zubehörprodukte im Produktbacken
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8428 0d5edaf7-2b12-4e95-93f4-047927463d4b
| -rw-r--r-- | views/mods/mod_relatedproducts/list.phtml | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/views/mods/mod_relatedproducts/list.phtml b/views/mods/mod_relatedproducts/list.phtml index b6c808e..d4db6c6 100644 --- a/views/mods/mod_relatedproducts/list.phtml +++ b/views/mods/mod_relatedproducts/list.phtml @@ -9,15 +9,38 @@ <?php if (sizeof($this->view['wpsg_mod_relatedproducts']['data']) <= 0) { ?>
<p><?php echo __('Noch keine Produkte zugeordnet', 'wpsg'); ?></p>
<?php } else { ?>
-<?php foreach ($this->view['wpsg_mod_relatedproducts']['data'] as $p) { ?>
- <span id="wpsg_rp_<?php echo $p['id']; ?>">
- <?php echo wpsg_drawForm_Select('wpsg_mod_relatedproduct['.$p['id'].']', '<a href="'.wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$p['product_id'], 'wpsg-product-edit-'.$p['product_id']).'">'.$p['name'].'</p>', $this->view['wpsg_mod_relatedproducts']['arTemplates'], $p['template'], array('icon' => 'wpsg_icon_remove glyphicon glyphicon-trash')); ?>
- </span>
- <div class="wpsg_clear"></div>
-<?php } ?>
+ <div id="wpsg_mod_relatedproduct_list">
+ <?php foreach ($this->view['wpsg_mod_relatedproducts']['data'] as $p) { ?>
+ <div class="order_item">
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-bar-expand" viewBox="0 0 16 16">
+ <path fill-rule="evenodd" d="M3.646 10.146a.5.5 0 0 1 .708 0L8 13.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708m0-4.292a.5.5 0 0 0 .708 0L8 2.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708M1 8a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13A.5.5 0 0 1 1 8"/>
+ </svg>
+ <span id="wpsg_rp_<?php echo $p['id']; ?>">
+ <?php echo wpsg_drawForm_Select('wpsg_mod_relatedproduct['.$p['id'].']', '<a href="'.wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$p['product_id'], 'wpsg-product-edit-'.$p['product_id']).'">'.$p['name'].'</a>', $this->view['wpsg_mod_relatedproducts']['arTemplates'], $p['template'], array('icon' => 'wpsg_icon_remove glyphicon glyphicon-trash')); ?>
+ </span>
+ </div>
+ <?php } ?>
+ </div>
<?php } ?>
-<script type="text/javascript">
+<style>
+
+ #wpsg_mod_relatedproduct_list { display:flex; flex-direction:column; gap:5px;
+ & > .order_item { display:block; position:relative; cursor:pointer !important;
+ & > svg { display:none; width:16px; height:16px; left:0; top:50%; transform:translateY(-50%); position:absolute; cursor:pointer !important; }
+ &:hover > svg { display:block; }
+ .form-group { margin-top:0; margin-bottom:0;
+ & > * { cursor:pointer;
+ a { display:inline; }
+ }
+ & > label { display:flex; justify-content:flex-end; }
+ }
+ }
+ }
+
+</style>
+
+<script>
jQuery('#relatedproducts_list a.wpsg_icon_remove').on('click', function() {
@@ -39,5 +62,13 @@ return false;
} );
+
+ jQuery(document).ready(function() {
+
+ jQuery("#wpsg_mod_relatedproduct_list").sortable({
+
+ }).disableSelection();
+
+ });
</script>
\ No newline at end of file |
