Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-22002

Confluence renders attachments with long filenames with an ellipsis rather than a presenting the information to the browser and using css to limit the fieldwidth

      Changed from new feature to bug- Original text of description:

      We would like the ability to set attachment macro's column width. Currently "name" column is too short. It doesn't display medium-sized file names very well.
      It will be very helpful to provide a way to limit the "comment" column' width too.

      This presents a usability problem with larger filenames. We probably shorted filenames in this way in the past because of the absence of browser support for the css3 property: text-overflow.

      Most modern browsers now support this property.

      Fix

      There are 2 modules affected by this bug. The attachments macro and the view attachments page (Tools > Attachments).

      To fix the attachments macro, download the version 3.6.7 or newer from the Atlassian Marketplace.

      For most users, that fix should be sufficient and you can stop here. If, however, you also need to fix the view attachments page, you'll have to edit confluence/includes/css/attachments.css and add the following CSS code:

      #viewAttachmentsDiv table.attachments {
          border-bottom: 1px solid #ccc;
          table-layout: fixed;
      }
      
      table.attachments .filename-column {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
      }
      
      @media screen and (min-width: 1600px) {
          table.attachments th.filesize-column {
              width: 80px;
          }
      
          table.attachments th.filedate-column {
              width: 180px;
          }
      
          table.attachments th.filecreator-column {
              width: 180px;
          }
      
          table.attachments th.comment,
          table.attachments th.labels {
              width: 200px;
          }
      
          table.attachments th.actions-column {
              width: 180px;
          }
      }
      

      You will need to delete confluence/includes/css/attachments-min.css for these changes to take effect.

      Then edit confluence/pages/includes/attachments-table.vm and change:

      <th>#sortLink("size", "${sortPathPrefixHtml}size" $action.getText('file.size'))</th>
      <th>$action.getText('creator.name')</th>
      <th>#sortLink("createddate" "${sortPathPrefixHtml}createddate" $action.getText('columnheading.creation.date'))</th>
      

      to this:

      <th class="filesize-column">#sortLink("size", "${sortPathPrefixHtml}size" $action.getText('file.size'))</th>
      <th class="filecreator-column">$action.getText('creator.name')</th>
      <th class="filedate-column">#sortLink("createddate" "${sortPathPrefixHtml}createddate" $action.getText('columnheading.creation.date'))</th>
      

      and this:

      #if ($showActions == "true")
          <th> </th>
      #end
      

      to this:

       #if ($showActions == "true")
          <th class="actions-column">&nbsp;</th>
      #end
      

      Finally (and most importantly), change this:

      $generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 35))
      

      to this:

      $generalUtil.htmlEncode($attachment.fileName)
      

        1. labels are hidden.png
          labels are hidden.png
          48 kB
        2. NotResolved.jpg
          NotResolved.jpg
          116 kB
        3. Partially_Solved.jpg
          Partially_Solved.jpg
          202 kB
        4. Partially_Solved.jpg
          Partially_Solved.jpg
          210 kB
        5. Unable to read documents....jpg
          Unable to read documents....jpg
          55 kB

            [CONFSERVER-22002] Confluence renders attachments with long filenames with an ellipsis rather than a presenting the information to the browser and using css to limit the fieldwidth

            Katherine Yabut made changes -
            Workflow Original: JAC Bug Workflow v3 [ 2902310 ] New: CONFSERVER Bug Workflow v4 [ 2996922 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2799558 ] New: JAC Bug Workflow v3 [ 2902310 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow [ 2730030 ] New: JAC Bug Workflow v2 [ 2799558 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2389056 ] New: JAC Bug Workflow [ 2730030 ]
            Alex Yakovlev (Inactive) made changes -
            Labels Original: affects-server bugfix editor editor-macros loyalty macros-attachments-macro New: affects-server editor editor-macros loyalty macros-attachments-macro
            Alex Yakovlev (Inactive) made changes -
            Labels Original: affects-server bugfix editor editor-macros macros-attachments-macro New: affects-server bugfix editor editor-macros loyalty macros-attachments-macro
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 2266320 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2389056 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2209958 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 2266320 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2195671 ] New: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2209958 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 1918163 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2195671 ]

              nbhawnani Niraj Bhawnani
              e4a15a8c6b83 Aviaso
              Affected customers:
              46 This affects my team
              Watchers:
              44 Start watching this issue

                Created:
                Updated:
                Resolved: