Project

General

Profile

Actions

Bug #15757

open

Incorrect dashboard column spacing when using five columns

Added by Steve Wheeler 24 days ago. Updated 1 day ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Dashboard
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
25.01
Release Notes:
Default
Affected Version:
2.7.x
Affected Architecture:

Description

Setting the dashboard to use 5 columns incorrectly shows spacing for 6 comlumns though the 6th cannot be used.

For example:

Tested: 2.7.2, 2.8-dev, 24.03 and 24.08-dev


Files

Actions #1

Updated by Christopher Cope 20 days ago

  • Status changed from New to Confirmed

I'm also seeing this on

24.08-DEVELOPMENT (amd64)
built on Fri Oct 4 2:31:00 UTC 2024
FreeBSD 15.0-CURRENT

Setting it to 4 works as expected, as does 6.

Actions #2

Updated by Jim Pingle 15 days ago

  • Subject changed from 5 column dashboard spacing incorrect. to Incorrect dashboard column spacing when using five columns
  • Plus Target Version changed from 24.08 to 24.11
Actions #3

Updated by Jim Pingle 15 days ago

  • Plus Target Version changed from 24.11 to 25.01
Actions #4

Updated by GChuf 6 4 days ago

Issue is due to code in index.php:

<?php
    $columnWidth = (int) (12 / $numColumns);

    for ($currentColumnNumber = 1; $currentColumnNumber <= $numColumns; $currentColumnNumber++) {

        //if col$currentColumnNumber exists
        if (isset($widgetColumns['col'.$currentColumnNumber])) {
            echo '<div class="col-md-' . $columnWidth . '" id="widgets-col' . $currentColumnNumber . '">';
            $columnWidgets = $widgetColumns['col'.$currentColumnNumber];

this uses bootstrap's "col-md" classes, which use width percentages in steps of 1/12 (co-md-2 is 2/12, so 16.67%).
Since (int) 12/5 gives the result of "2", user has the impression that there are 6 evenly spaced columns but only 5 of them are used.

A workaround would be to create a new class with width of 20%, which doesn't exist inside bootstrap's "col-md" classes.

Actions #5

Updated by Miguelprome Miguelprome 1 day ago

  • File 280.gif added
Actions #6

Updated by Christian McDonald 1 day ago

  • File deleted (280.gif)
Actions

Also available in: Atom PDF