Commit 1f54afa5 authored by Dries's avatar Dries

- Patch #15655 by Goba: allow blank days in the calendar to be styled using CSS, and tidied up the calendar's CSS.
parent 8d723826
...@@ -135,8 +135,8 @@ td.menu-disabled { ...@@ -135,8 +135,8 @@ td.menu-disabled {
margin-bottom: 1em; margin-bottom: 1em;
} }
tr.light .form-item, tr.dark .form-item { tr.light .form-item, tr.dark .form-item {
margin-top: 0em; margin-top: 0;
margin-bottom: 0em; margin-bottom: 0;
white-space: nowrap; white-space: nowrap;
} }
.form-item input.error, .form-item textarea.error { .form-item input.error, .form-item textarea.error {
...@@ -305,6 +305,7 @@ tr.light .form-item, tr.dark .form-item { ...@@ -305,6 +305,7 @@ tr.light .form-item, tr.dark .form-item {
.calendar table { .calendar table {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
border: 1px solid #000;
} }
.calendar td, .calendar th { .calendar td, .calendar th {
text-align: center; text-align: center;
...@@ -313,11 +314,14 @@ tr.light .form-item, tr.dark .form-item { ...@@ -313,11 +314,14 @@ tr.light .form-item, tr.dark .form-item {
margin: 0; margin: 0;
font-size: 0.8em; font-size: 0.8em;
} }
.calendar td.day-blank {
border: 0;
}
.tips { .tips {
margin-top: 0px; margin-top: 0;
margin-bottom: 0px; margin-bottom: 0;
padding-top: 0px; padding-top: 0;
padding-bottom: 0px; padding-bottom: 0;
font-size: 0.9em; font-size: 0.9em;
} }
#forum .description { #forum .description {
...@@ -366,7 +370,7 @@ tr.light .form-item, tr.dark .form-item { ...@@ -366,7 +370,7 @@ tr.light .form-item, tr.dark .form-item {
} }
.profile { .profile {
clear: both; clear: both;
margin: 1em 0em 1em 0em; margin: 1em 0 1em 0;
} }
.profile .picture { .profile .picture {
float: right; float: right;
...@@ -450,7 +454,7 @@ tr.watchdog-error .active { ...@@ -450,7 +454,7 @@ tr.watchdog-error .active {
/* Tab navigation */ /* Tab navigation */
ul.primary { ul.primary {
border-collapse: collapse; border-collapse: collapse;
padding: 0em 0em 0em 1em; padding: 0 0 0 1em;
white-space: nowrap; white-space: nowrap;
list-style: none; list-style: none;
margin: 5px; margin: 5px;
...@@ -468,7 +472,7 @@ ul.primary li a { ...@@ -468,7 +472,7 @@ ul.primary li a {
border-style: solid solid none solid; border-style: solid solid none solid;
height: auto; height: auto;
margin-right: 0.5em; margin-right: 0.5em;
padding: 0em 1em; padding: 0 1em;
text-decoration: none; text-decoration: none;
} }
ul.primary li.active a { ul.primary li.active a {
......
...@@ -119,10 +119,10 @@ function archive_calendar($original = 0) { ...@@ -119,10 +119,10 @@ function archive_calendar($original = 0) {
// Loop through all the days of the month: // Loop through all the days of the month:
while ($nday <= $last) { while ($nday <= $last) {
// Set up blank days for first week of the month: // Set up blank days for first week of the month (allowing individual blank day styling):
if ($first != $weekstart) { if ($first != $weekstart) {
$blankdays = ($first - $weekstart + 7) % 7; $blankdays = ($first - $weekstart + 7) % 7;
$output .= " <tr class=\"row-week\"><td class=\"day-blank\" colspan=\"$blankdays\">&nbsp;</td>\n"; $output .= " <tr class=\"row-week\">" . str_repeat("<td class=\"day-blank\">&nbsp;</td>\n", $blankdays);
$first = $weekstart; $first = $weekstart;
} }
// Start every week on a new line: // Start every week on a new line:
...@@ -164,10 +164,10 @@ function archive_calendar($original = 0) { ...@@ -164,10 +164,10 @@ function archive_calendar($original = 0) {
$nday++; $nday++;
} }
// Complete the calendar: // Complete the calendar (allowing individual blank day styling):
if ($sday != $weekstart) { if ($sday != $weekstart) {
$end = (7 - $sday + $weekstart) % 7; $end = (7 - $sday + $weekstart) % 7;
$output .= " <td class=\"day-blank\" colspan=\"$end\">&nbsp;</td>\n </tr>\n"; $output .= str_repeat("<td class=\"day-blank\">&nbsp;</td>\n", $end) . "</tr>\n";
} }
$output .= "</table></div>\n\n"; $output .= "</table></div>\n\n";
......
...@@ -119,10 +119,10 @@ function archive_calendar($original = 0) { ...@@ -119,10 +119,10 @@ function archive_calendar($original = 0) {
// Loop through all the days of the month: // Loop through all the days of the month:
while ($nday <= $last) { while ($nday <= $last) {
// Set up blank days for first week of the month: // Set up blank days for first week of the month (allowing individual blank day styling):
if ($first != $weekstart) { if ($first != $weekstart) {
$blankdays = ($first - $weekstart + 7) % 7; $blankdays = ($first - $weekstart + 7) % 7;
$output .= " <tr class=\"row-week\"><td class=\"day-blank\" colspan=\"$blankdays\">&nbsp;</td>\n"; $output .= " <tr class=\"row-week\">" . str_repeat("<td class=\"day-blank\">&nbsp;</td>\n", $blankdays);
$first = $weekstart; $first = $weekstart;
} }
// Start every week on a new line: // Start every week on a new line:
...@@ -164,10 +164,10 @@ function archive_calendar($original = 0) { ...@@ -164,10 +164,10 @@ function archive_calendar($original = 0) {
$nday++; $nday++;
} }
// Complete the calendar: // Complete the calendar (allowing individual blank day styling):
if ($sday != $weekstart) { if ($sday != $weekstart) {
$end = (7 - $sday + $weekstart) % 7; $end = (7 - $sday + $weekstart) % 7;
$output .= " <td class=\"day-blank\" colspan=\"$end\">&nbsp;</td>\n </tr>\n"; $output .= str_repeat("<td class=\"day-blank\">&nbsp;</td>\n", $end) . "</tr>\n";
} }
$output .= "</table></div>\n\n"; $output .= "</table></div>\n\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment