Skip to content

Commit 89ace10

Browse files
authored
Fix calendar display with Redmine 5.1 (#270)
1 parent bc5965a commit 89ace10

File tree

3 files changed

+126
-2
lines changed

3 files changed

+126
-2
lines changed

src/sass/components/_calendar.scss

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Calendar
33
// --------------------------------------------------
44

5-
65
table.cal {
76
width: 100%;
87
margin-bottom: $line-height-computed;
@@ -59,9 +58,91 @@ table.cal {
5958
}
6059
}
6160

61+
ul.cal {
62+
display: grid;
63+
grid-template-columns: 2rem repeat(7, 1fr);
64+
width: 100%;
65+
margin: 0;
66+
padding: 0;
67+
border-spacing: 0;
68+
list-style: none;
69+
border: 1px solid $table-border-color;
70+
border-radius: 3px;
71+
72+
li {
73+
&.calhead {
74+
padding: 4px;
75+
background-color: $table-bg-active;
76+
font-weight: bold;
77+
text-align: center;
78+
}
79+
80+
&.week-number {
81+
padding: 4px;
82+
border: none;
83+
background-color: $table-bg-active;
84+
font-size: 1em;
85+
text-align: center;
86+
87+
span.label-week {
88+
display: none;
89+
}
90+
}
91+
92+
&.calbody {
93+
min-height: calc(1.2em * 6);
94+
padding: 2px;
95+
border: 1px solid $table-border-color;
96+
border-right: 0;
97+
border-bottom: 0;
98+
font-size: 1em;
99+
line-height: 1.6;
100+
vertical-align: top;
101+
102+
p.day-num {
103+
font-size: 1.1em;
104+
text-align: right;
105+
106+
.abbr-day {
107+
display: none;
108+
}
109+
}
110+
111+
.day-letter {
112+
display: none;
113+
}
114+
115+
&.odd {
116+
p.day-num {
117+
color: $gray-600;
118+
}
119+
}
120+
121+
&.today {
122+
background: $highlight-bg;
123+
124+
p.day-num {
125+
font-weight: $font-weight-bold;
126+
}
127+
}
128+
129+
.icon {
130+
padding-top: 2px;
131+
padding-bottom: 3px;
132+
}
133+
134+
&.nwday:not(.odd) {
135+
background-color: $table-bg-accent;
136+
}
137+
}
138+
}
139+
}
140+
62141
table.cal .starting a,
142+
ul.cal .starting a,
63143
p.cal.legend .starting,
64144
table.cal .ending a,
145+
ul.cal .ending a,
65146
p.cal.legend .ending {
66147
@extend %fa-icon;
67148

@@ -73,6 +154,7 @@ p.cal.legend .ending {
73154
}
74155

75156
table.cal .ending a,
157+
ul.cal .ending a,
76158
p.cal.legend .ending {
77159
&::before {
78160
content: $fa-var-caret-left;
@@ -81,6 +163,7 @@ p.cal.legend .ending {
81163
}
82164

83165
table.cal .starting.ending a,
166+
ul.cal .starting.ending a,
84167
p.cal.legend .starting.ending {
85168
&::before {
86169
content: $fa-var-square;

src/sass/components/_responsive.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,47 @@ body {
433433
background-position: 8px center !important; // stylelint-disable-line declaration-no-important
434434
}
435435
}
436+
437+
/* Calendar */
438+
ul.cal {
439+
display: block;
440+
441+
.calhead {
442+
display: none;
443+
}
444+
445+
.calbody {
446+
min-height: calc(1.2em * 3);
447+
}
448+
449+
.calbody .day-letter {
450+
display: inline;
451+
}
452+
453+
.week-number {
454+
border: none;
455+
background-color: $table-bg-active;
456+
font-weight: bold;
457+
text-align: left;
458+
459+
span.label-week {
460+
display: inline;
461+
}
462+
}
463+
464+
.week-number .label-week {
465+
display: inline;
466+
}
467+
468+
.calbody p.day-num {
469+
font-size: 1.1em;
470+
text-align: left;
471+
472+
.abbr-day {
473+
display: inline;
474+
}
475+
}
476+
}
436477
}
437478

438479
// Tweaks for smartphones, touchscreens

stylesheets/application.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)