Skip to content

Commit

Permalink
Fix #159 wrapping long text in issue attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrliptontea committed Mar 15, 2020
1 parent a2b49b6 commit a0d274f
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 57 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ If you need to customize styles for [Redmine Backlogs][redmine_backlogs] remembe

## Changelog

Latest (master):

* Fixed #159: wrapping long text in issue attributes.
* Fixed a "timeline" positioning in issue notes/changes.

v2.9.1 (2020-02-22):

* Merged fix #155: $.load function removed from jQuery.
Expand Down
146 changes: 90 additions & 56 deletions src/sass/components/_issue.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
margin-bottom: $line-height-computed;
}

> hr {
> hr,
.attribute > hr {
@if $clean-issues {
margin: $issue-padding 0;
} @else {
Expand Down Expand Up @@ -126,7 +127,42 @@
}
}

.attributes {
@if $color-status {
.attributes td.status,
.attributes .attribute.status .value {
display: inline-block;
width: auto;
min-width: 1em;
margin-top: $issue-attribute-padding-v;
padding: 1px $table-cell-padding;
border-radius: $border-radius-base;
background-color: $status-default-bg;
color: $status-default-color;
font-size: $font-size-small;
font-weight: $font-weight-bold;
text-align: center;
text-transform: uppercase;
}

@each $status, $status-colors in $status-colors-map {
&.#{$status} {
.attributes td.status,
.attributes .attribute.status .value {
background-color: map-get($status-colors, background);
color: map-get($status-colors, color);
}
}
}
}

@if $priority-icon {
.attributes td.priority,
.attribute.priority .value {
@include priority-icon-base;
}
}

table.attributes {
width: 100%;

th,
Expand All @@ -149,67 +185,66 @@

@media screen and (min-width: $screen-md-min) {
> tbody > tr {
> th,
> th {
width: $label-width;
}

> td {
width: 25%;
min-width: $label-width;
}
}
}
}

@media screen and (min-width: $screen-lg-min) {
width: auto;
div.attributes {
@if $css-grid-layout {
display: grid;
grid-gap: 0 $padding-side;
grid-template-columns: auto;

> tbody > tr {
> th {
width: 14em;
@media screen and (min-width: $screen-lg-min) {
grid-template-columns: repeat(2, minmax(auto, max-content));

.attribute .value {
min-width: $label-width;
}
}

> td {
width: auto;
min-width: 16em;
.splitcontent {
display: contents;

&::after {
content: none;
}
}
}
}

@if $color-status {
.attributes td.status,
.attribute.status .value {
display: inline-block;
width: auto;
min-width: 1em;
margin-top: $issue-attribute-padding-v;
padding: 1px $table-cell-padding;
border-radius: $border-radius-base;
background-color: $status-default-bg;
color: $status-default-color;
font-size: $font-size-small;
font-weight: $font-weight-bold;
text-align: center;
text-transform: uppercase;
}
.splitcontentleft {
width: auto;
padding-right: 0;
padding-left: 0;
float: none;
}
} @else {
@media screen and (min-width: $screen-lg-min) {
.splitcontentleft {
width: auto;
}

@each $status, $status-colors in $status-colors-map {
&.#{$status} {
.attributes td.status,
.attribute.status .value {
background-color: map-get($status-colors, background);
color: map-get($status-colors, color);
.attribute .value {
min-width: $label-width;
}
}
}
}

@if $priority-icon {
.attributes td.priority,
.attribute.priority .value {
@include priority-icon-base;
}
}
.splitcontent {
.attribute {
padding-left: $label-width;

.splitcontentleft {
@media screen and (min-width: $screen-lg-min) {
width: auto;
.label {
width: $label-width;
margin-left: -$label-width;
}
}
}

Expand All @@ -222,21 +257,20 @@
}

.label {
width: 25%;
box-sizing: border-box;
float: left;
color: $gray-700;

@media screen and (min-width: $screen-lg-min) {
width: 14em;
}
}

.value {
color: $gray-950;

@media screen and (min-width: $screen-lg-min) {
width: auto;
min-width: 14em + 16em;
&:empty::after {
content: "-";
}

*:last-child {
margin-bottom: 0;
}
}
}
Expand Down Expand Up @@ -423,7 +457,7 @@ div.thumbnails {

.journal {
position: relative;
margin-bottom: $line-height-computed + 2px * 2;
margin-bottom: $line-height-computed;

@if $use-gravatars {
margin-left: $bubble-gravatar-size + $bubble-gravatar-space;
Expand All @@ -434,10 +468,10 @@ div.thumbnails {
display: block;
position: absolute;
z-index: -1;
top: -($line-height-computed + 2px);
top: -($line-height-computed - 1px);
left: 22px;
width: 4px;
height: $line-height-computed;
height: $line-height-computed - 2px;
background-color: darken($body-bg, 5%);
}

Expand Down
2 changes: 1 addition & 1 deletion stylesheets/application.css

Large diffs are not rendered by default.

0 comments on commit a0d274f

Please sign in to comment.