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

Fix calendar display with Redmine 5.1 #270

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 84 additions & 1 deletion src/sass/components/_calendar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Calendar
// --------------------------------------------------


table.cal {
width: 100%;
margin-bottom: $line-height-computed;
Expand Down Expand Up @@ -59,9 +58,91 @@ table.cal {
}
}

ul.cal {
display: grid;
grid-template-columns: 2rem repeat(7, 1fr);
width: 100%;
margin: 0;
padding: 0;
border-spacing: 0;
list-style: none;
border: 1px solid $table-border-color;
border-radius: 3px;

li {
&.calhead {
padding: 4px;
background-color: $table-bg-active;
font-weight: bold;
text-align: center;
}

&.week-number {
padding: 4px;
border: none;
background-color: $table-bg-active;
font-size: 1em;
text-align: center;

span.label-week {
display: none;
}
}

&.calbody {
min-height: calc(1.2em * 6);
padding: 2px;
border: 1px solid $table-border-color;
border-right: 0;
border-bottom: 0;
font-size: 1em;
line-height: 1.6;
vertical-align: top;

p.day-num {
font-size: 1.1em;
text-align: right;

.abbr-day {
display: none;
}
}

.day-letter {
display: none;
}

&.odd {
p.day-num {
color: $gray-600;
}
}

&.today {
background: $highlight-bg;

p.day-num {
font-weight: $font-weight-bold;
}
}

.icon {
padding-top: 2px;
padding-bottom: 3px;
}

&.nwday:not(.odd) {
background-color: $table-bg-accent;
}
}
}
}

table.cal .starting a,
ul.cal .starting a,
p.cal.legend .starting,
table.cal .ending a,
ul.cal .ending a,
p.cal.legend .ending {
@extend %fa-icon;

Expand All @@ -73,6 +154,7 @@ p.cal.legend .ending {
}

table.cal .ending a,
ul.cal .ending a,
p.cal.legend .ending {
&::before {
content: $fa-var-caret-left;
Expand All @@ -81,6 +163,7 @@ p.cal.legend .ending {
}

table.cal .starting.ending a,
ul.cal .starting.ending a,
p.cal.legend .starting.ending {
&::before {
content: $fa-var-square;
Expand Down
41 changes: 41 additions & 0 deletions src/sass/components/_responsive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,47 @@ body {
background-position: 8px center !important; // stylelint-disable-line declaration-no-important
}
}

/* Calendar */
ul.cal {
display: block;

.calhead {
display: none;
}

.calbody {
min-height: calc(1.2em * 3);
}

.calbody .day-letter {
display: inline;
}

.week-number {
border: none;
background-color: $table-bg-active;
font-weight: bold;
text-align: left;

span.label-week {
display: inline;
}
}

.week-number .label-week {
display: inline;
}

.calbody p.day-num {
font-size: 1.1em;
text-align: left;

.abbr-day {
display: inline;
}
}
}
}

// Tweaks for smartphones, touchscreens
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/application.css

Large diffs are not rendered by default.