From 5b7706c77d3aceae5c058fad6ae920181401eaab Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 3 Dec 2021 14:18:48 -0700 Subject: [PATCH] * Etemplate: Add link icon overlay to link list --- api/js/etemplate/et2_widget_link.js | 3 +- api/js/etemplate/et2_widget_link.ts | 3 +- api/src/Etemplate/Widget/Link.php | 6 +++ api/templates/default/etemplate2.css | 24 ++++++++--- pixelegg/css/pixelegg.css | 61 ++++++++++++++++------------ pixelegg/less/layout_overlay.less | 60 ++++++++++++++------------- 6 files changed, 95 insertions(+), 62 deletions(-) diff --git a/api/js/etemplate/et2_widget_link.js b/api/js/etemplate/et2_widget_link.js index ceefd2d839..18ec663915 100644 --- a/api/js/etemplate/et2_widget_link.js +++ b/api/js/etemplate/et2_widget_link.js @@ -1683,7 +1683,8 @@ var et2_link_list = /** @class */ (function (_super) { download_url: _link_data.download_url, name: _link_data.title, mime: _link_data.type, - path: _link_data.icon + path: _link_data.icon, + mode: _link_data.mode }); icon.append(vfs_widget.getDOMNode()); } diff --git a/api/js/etemplate/et2_widget_link.ts b/api/js/etemplate/et2_widget_link.ts index 28cb8869e4..b711b94e18 100644 --- a/api/js/etemplate/et2_widget_link.ts +++ b/api/js/etemplate/et2_widget_link.ts @@ -2074,7 +2074,8 @@ export class et2_link_list extends et2_link_string download_url:_link_data.download_url, name:_link_data.title, mime:_link_data.type, - path:_link_data.icon + path:_link_data.icon, + mode: _link_data.mode }); icon.append(vfs_widget.getDOMNode()); } diff --git a/api/src/Etemplate/Widget/Link.php b/api/src/Etemplate/Widget/Link.php index 82a60d3eeb..021adf1b25 100644 --- a/api/src/Etemplate/Widget/Link.php +++ b/api/src/Etemplate/Widget/Link.php @@ -198,12 +198,18 @@ class Link extends Etemplate\Widget $link['help'] = lang('Delete this file'); $link['title'] = Api\Vfs::decodePath($link['title']); $link['icon'] = Api\Link::vfs_path($link['app2'],$link['id2'],$link['id'],true); + $link['download_url'] = Api\Vfs::download_url($link['icon']); // Make links to directories load in filemanager if($link['type'] == Api\Vfs::DIR_MIME_TYPE) { $link['target'] = 'filemanager'; } + else + { + $stat = Api\Vfs::lstat($link['icon']); + $link['mode'] = $stat['mode']; + } } else { diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css index ac8427568d..163771942d 100644 --- a/api/templates/default/etemplate2.css +++ b/api/templates/default/etemplate2.css @@ -1034,6 +1034,7 @@ ul.et2_link_string { -ms-user-select: none; user-select: none; white-space: normal; + margin-bottom:2px; } .et2_link_list tr { cursor: pointer; @@ -2713,25 +2714,36 @@ span.et2_checkbox_slideSwitch.switchOn > span.slideSwitch_container a { float: left; } .et2_toolbar_more span.et2_checkbox_slideSwitch > input { - display: none; + display: none; } .et2_radiobox { - margin-right: 10px; + margin-right: 10px; } + .et2_radiobox[disabled] { opacity: 0.5; } + +.overlayContainer { + position: absolute; + right: -2px; + bottom: -2px; + vertical-align: bottom; + text-align: right; +} + /** * Do not wrap content of a single widget incl. a label or children of a hbox. * Taking into eg. select-account widget rendered as ul and prefixed with a label * and maintaining some space between widgets. */ -.et2_nowrap{ - white-space: nowrap; +.et2_nowrap { + white-space: nowrap; } -ul.et2_nowrap, div.et2_nowrap{ - display: inline-block; + +ul.et2_nowrap, div.et2_nowrap { + display: inline-block; } .et2_nowrap > *{ padding-left: 5px; diff --git a/pixelegg/css/pixelegg.css b/pixelegg/css/pixelegg.css index 802f207430..de851dacc8 100644 --- a/pixelegg/css/pixelegg.css +++ b/pixelegg/css/pixelegg.css @@ -4173,36 +4173,45 @@ td.message span.message { * @version $Id: layout_table.less 3089 2014-06-11 14:02:57Z pixelegg $ */ /*z.b. Dateimanager overlay*/ -.egwGridView_grid span.iconOverlayContainer { - margin: 2px 5px 2px 2px; - position: relative; - -moz-user-select: none; - -khtml-user-select: none; - user-select: none; - overflow: visible; - display: inline-block; +span.iconOverlayContainer { + margin: 2px 5px 2px 2px; + position: relative; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; + overflow: visible; + display: inline-block; } -.egwGridView_grid span.overlayContainer { - position: absolute; - right: -2px; - bottom: -2px; - vertical-align: bottom; - text-align: right; + +span.overlayContainer { + position: absolute; + right: -2px; + bottom: -2px; + vertical-align: bottom; + text-align: right; } -.egwGridView_grid span.iconContainer { - display: inline-block; - padding: 0; - margin: 0; - text-align: center; + +span.iconContainer { + display: inline-block; + padding: 0; + margin: 0; + text-align: center; } -.egwGridView_grid span.overlayContainer img.overlay { - position: relative; - top: 1px; - margin: 0; - padding: 0; - height: 9px; - width: 11px; + +span.overlayContainer img.overlay { + position: relative; + top: 1px; + margin: 0; + padding: 0; + height: 9px; + width: 11px; } + +.et2_link_list span.overlayContainer img.overlay { + height: 9px !important; + width: 9px !important; +} + /** * EGroupware: Stylite Pixelegg template * diff --git a/pixelegg/less/layout_overlay.less b/pixelegg/less/layout_overlay.less index a0648c47c7..c41d252af6 100644 --- a/pixelegg/less/layout_overlay.less +++ b/pixelegg/less/layout_overlay.less @@ -15,39 +15,43 @@ //############################################################################################################## - /*z.b. Dateimanager overlay*/ +/*z.b. Dateimanager overlay*/ -.egwGridView_grid span.iconOverlayContainer { - margin: 2px 5px 2px 2px; - position: relative; - -moz-user-select: none; - -khtml-user-select: none; - user-select: none; - overflow: visible; - display: inline-block; +span.iconOverlayContainer { + margin: 2px 5px 2px 2px; + position: relative; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; + overflow: visible; + display: inline-block; } -.egwGridView_grid span.overlayContainer { - position: absolute; - right: -2px; - bottom: -2px; - vertical-align: bottom; - text-align: right; +span.overlayContainer { + position: absolute; + right: -2px; + bottom: -2px; + vertical-align: bottom; + text-align: right; } -.egwGridView_grid span.iconContainer { - display: inline-block; - padding: 0; - margin: 0; - text-align: center; +span.iconContainer { + display: inline-block; + padding: 0; + margin: 0; + text-align: center; } -.egwGridView_grid span.overlayContainer img.overlay { - position: relative; - top: 1px; - margin: 0; - padding: 0; - height: 9px; - width: 11px; - +span.overlayContainer img.overlay { + position: relative; + top: 1px; + margin: 0; + padding: 0; + height: 9px; + width: 11px; } + +.et2_link_list span.overlayContainer img.overlay { + height: 9px !important; + width: 9px !important; +} \ No newline at end of file