Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting of cable length in cable trace #3150

Closed
candlerb opened this issue May 5, 2019 · 2 comments · Fixed by #3158
Closed

Formatting of cable length in cable trace #3150

candlerb opened this issue May 5, 2019 · 2 comments · Fixed by #3158
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user

Comments

@candlerb
Copy link
Contributor

candlerb commented May 5, 2019

Environment

  • Python version: 3.5.2
  • NetBox version: 2.5.12

Steps to Reproduce

This is a minor issue, but the display of cable length units could be improved.

  1. Create cable with length 200, units Centimeters
  2. Trace the cable

Expected Behavior

Length to be shown as "200cm" or "200 Centimeters"

Observed Behavior

image

This is ugly because "200" and "Centimeters" are pressed up against each other; also there is a leading hyphen which looks like a minus.

I would prefer displaying the abbreviated length unit here - e.g. cm, ft etc (*) - in which case having no space is entirely appropriate. Otherwise, insert a space.

Please also omit the hyphen unless there is a field to separate it from. (I guess this is for the cable label? But in this case, the cable is unlabelled)

(*) There's no need to have both long and short versions - I'd be entirely happy if the abbreviations were used everywhere.

CABLE_LENGTH_UNIT_CHOICES = (
    (LENGTH_UNIT_METER, 'm'),
    (LENGTH_UNIT_CENTIMETER, 'cm'),
    (LENGTH_UNIT_FOOT, 'ft'),
    (LENGTH_UNIT_INCH, 'in'),
)
RACK_DIMENSION_UNIT_CHOICES = (
    (LENGTH_UNIT_MILLIMETER, 'mm'),
    (LENGTH_UNIT_INCH, 'in'),
)
@tb-killa
Copy link
Contributor

tb-killa commented May 6, 2019

If you Label the Cable this would be visible on TOP of the trace View.

https://github.com/digitalocean/netbox/blob/develop/netbox/templates/dcim/cable_trace.html#L29

With Label:
image

Without Label:
image

I think this is a simple Bug because the one character is too much:

https://github.com/digitalocean/netbox/blob/develop/netbox/templates/dcim/cable_trace.html#L34

@rogerholten
Copy link

Just want to add that according to SI rules, there should always be a space between number and unit even if the unit is abbreviated. Source: SI Brochure, Section 5.3.3: https://www.bipm.org/en/publications/si-brochure/section5-3.html

@jeremystretch jeremystretch changed the title [Trivial] Formatting of cable length in cable trace Formatting of cable length in cable trace May 6, 2019
@DanSheps DanSheps added status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user labels May 6, 2019
DanSheps added a commit that referenced this issue May 6, 2019
Fixes: #3150- Formatting of cable length in cable trace
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants