From 79ebb9078986c881fc3d0cd3d9b76e2d8131f739 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 23 Mar 2015 01:00:15 -0400 Subject: [PATCH] Closes #176 restyle attachments to be more responsive While keeping the same features :grinning: --- admin/admin_ticket.php | 57 ++++++++++++++++++---------------------- css/hesk_newStyle.php | 19 ++++++-------- css/hesk_newStyleRTL.php | 19 ++++++-------- language/en/text.php | 6 ++++- 4 files changed, 47 insertions(+), 54 deletions(-) diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index ab0cc452..c9c0225e 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -1355,41 +1355,33 @@ function hesk_listAttachments($attachments='', $reply=0, $white=1) return false; } - /* Style and mousover/mousout */ - $tmp = $white ? 'White' : 'Blue'; - $style = 'class="option'.$tmp.'OFF" onmouseover="this.className=\'option'.$tmp.'ON\'" onmouseout="this.className=\'option'.$tmp.'OFF\'"'; - /* List attachments */ - echo '

'.$hesklang['attachments'].':
'; + echo '

'.$hesklang['attachments'].':


'; $att=explode(',',substr($attachments, 0, -1)); - $columnNumber = 0; - echo '
'; + echo '
'; + echo ''; + echo ''; + echo ''; foreach ($att as $myatt) { - $columnNumber++; - if ($columnNumber > 4) - { - echo '
'; - $columnNumber = 1; - } - list($att_id, $att_name) = explode('#', $myatt); - - echo '
'; + list($att_id, $att_name) = explode('#', $myatt); $fileparts = pathinfo($att_name); $fontAwesomeIcon = hesk_getFontAwesomeIconForFileExtension($fileparts['extension']); echo ' -
-
'; +
+ + + + '; - echo ''; } - echo ''; + echo '
 '.$hesklang['file_name'].''.$hesklang['action'].'
'; //-- File is an image if ($fontAwesomeIcon == 'fa fa-file-image-o') { //-- Get the actual image location and display a thumbnail. It will be linked to a modal to view a larger size. $path = hesk_getSavedNameUrlForAttachment($att_id); if ($path == '') { - echo ''; + echo ''; } else { - echo ''.$hesklang['image'].''; + echo ' + '.$hesklang['image'].' + '; echo ' +

'.$att_name.'

+
'; /* Can edit and delete tickets? */ if ($can_edit && $can_delete) { echo ' '; } - echo ' - -
-


'.$att_name.'

- '; - echo ' - + echo ' + + '; + echo ' +
'; return true; } // End hesk_listAttachments() diff --git a/css/hesk_newStyle.php b/css/hesk_newStyle.php index 8a4cd72a..ce577fcc 100644 --- a/css/hesk_newStyle.php +++ b/css/hesk_newStyle.php @@ -376,20 +376,17 @@ button.dropdown-submit { border:none; } -.file-attachment { - min-height: 100px; - max-height: 100px; - text-align: center; -} - -.file-attachment > i { - padding-top: 10px; +.attachment-table > tbody > tr > td > i { color: #ddd; text-shadow: 2px 2px #ccc; } -.attachment-image { - margin: -15px; - display:inline-block; +.attachment-table > tbody > tr > td { + vertical-align: middle; +} + +.attachment-table > tbody > tr > td > span > img { + max-height: 80px; + max-width: 80px; cursor: pointer; } diff --git a/css/hesk_newStyleRTL.php b/css/hesk_newStyleRTL.php index 20fa2763..8d265463 100644 --- a/css/hesk_newStyleRTL.php +++ b/css/hesk_newStyleRTL.php @@ -370,20 +370,17 @@ button.dropdown-submit { border:none; } -.file-attachment { -min-height: 100px; -max-height: 100px; -text-align: center; -} - -.file-attachment > i { -padding-top: 10px; +.attachment-table > tbody > tr > td > i { color: #ddd; text-shadow: 2px 2px #ccc; } -.attachment-image { -margin: -15px; -display:inline-block; +.attachment-table > tbody > tr > td { +vertical-align: middle; +} + +.attachment-table > tbody > tr > td > span > img { +max-height: 80px; +max-width: 80px; cursor: pointer; } \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index 686dc347..cf5de85e 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -21,11 +21,15 @@ $hesklang['_COLLATE']='utf8_unicode_ci'; // This is the email break line that will be used in email piping $hesklang['EMAIL_HR']='------ Reply above this line ------'; -// ADDED OR MODIFIED IN Mods for HESK 2.2.0 +// ADDED OR MODIFIED IN Mods for HESK 2.1.1 $hesklang['new_article_default_type'] = 'Default Type for New Articles'; $hesklang['new_article_default_type_help'] = 'Choose the default type for new knowledgebase articles.'; $hesklang['kb_draft3'] = 'The article is saved but not yet published. It can only be read by staff who has permission to manage knowledgebase articles.'; // This is exactly the same as kb_draft2 with all HTML removed +$hesklang['file_name'] = 'File Name'; +$hesklang['action'] = 'Action'; +$hesklang['click_to_preview'] = 'Click to preview'; +$hesklang['attachment_removed'] = 'This attachment has been removed and cannot be viewed / downloaded'; // ADDED OR MODIFIED IN Mods for HESK 2.1.0 $hesklang['e_mfh_settings'] = 'You will not be able to save your settings unless this file is writable by the script (CHMOD to 666)!';