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

! Some updates to the calendar template and css #529

Merged
merged 2 commits into from Jun 17, 2013
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions themes/default/Calendar.template.php
Expand Up @@ -29,11 +29,11 @@ function template_main()
<div id="main_grid">
', $context['view_week'] ? template_show_week_grid('main') : template_show_month_grid('main');

template_button_strip($context['calendar_buttons'], 'right');

// Show some controls to allow easy calendar navigation.
echo '
<form id="calendar_navigation" action="', $scripturl, '?action=calendar" method="post" accept-charset="UTF-8">
<form id="calendar_navigation" action="', $scripturl, '?action=calendar" method="post" accept-charset="UTF-8">';
template_button_strip($context['calendar_buttons'], 'right');
echo '
<select name="month">';

// Show a select box with all the months.
Expand Down Expand Up @@ -207,15 +207,15 @@ function template_show_month_grid($grid_name)
{
echo '
<div class="cat_bar">
<h3 class="catbg centertext" style="font-size: ', $calendar_data['size'] == 'large' ? 'large' : 'small', ';">';
<h3 class="catbg">';

if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'])
echo '
<span class="floatleft"><a href="', $calendar_data['previous_calendar']['href'], '">&#171;</a></span>';
<a href="', $calendar_data['previous_calendar']['href'], '" class="floatleft">&#171;</a>';

if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'])
echo '
<span class="floatright"><a href="', $calendar_data['next_calendar']['href'], '">&#187;</a></span>';
<a href="', $calendar_data['next_calendar']['href'], '" class="floatright">&#187;</a>';

if ($calendar_data['show_next_prev'])
echo '
Expand Down Expand Up @@ -245,7 +245,7 @@ function template_show_month_grid($grid_name)
foreach ($calendar_data['week_days'] as $day)
{
echo '
<th class="days" scope="col" ', $calendar_data['size'] == 'small' ? 'style="font-size: x-small;"' : '', '>', !empty($calendar_data['short_day_titles']) ? (Util::substr($txt['days'][$day], 0, 1)) : $txt['days'][$day], '</th>';
<th class="days" scope="col">', !empty($calendar_data['short_day_titles']) ? (Util::substr($txt['days'][$day], 0, 1)) : $txt['days'][$day], '</th>';
}
echo '
</tr>';
Expand All @@ -271,7 +271,7 @@ function template_show_month_grid($grid_name)
{
// If this is today, make it a different color and show a border.
echo '
<td style="height: ', $calendar_data['size'] == 'small' ? '20' : '100', 'px; padding: 2px;', $calendar_data['size'] == 'small' ? 'font-size: x-small;' : '', '" class="', $day['is_today'] ? 'calendar_today' : 'windowbg', ' days">';
<td class="', $day['is_today'] ? 'calendar_today' : 'windowbg', ' days">';

// Skip it if it should be blank - it's not a day if it has no number.
if (!empty($day['day']))
Expand All @@ -286,18 +286,18 @@ function template_show_month_grid($grid_name)

// Is this the first day of the week? (and are we showing week numbers?)
if ($day['is_first_day'] && $calendar_data['size'] != 'small')
echo '<span class="smalltext"> - <a href="', $scripturl, '?action=calendar;viewweek;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '">', $txt['calendar_week'], ' ', $week['number'], '</a></span>';
echo ' - <a href="', $scripturl, '?action=calendar;viewweek;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '">', $txt['calendar_week'], ' ', $week['number'], '</a>';

// Are there any holidays?
if (!empty($day['holidays']))
echo '
<div class="smalltext holiday">', $txt['calendar_prompt'], ' ', implode(', ', $day['holidays']), '</div>';
<div class="holiday">', $txt['calendar_prompt'], ' ', implode(', ', $day['holidays']), '</div>';

// Show any birthdays...
if (!empty($day['birthdays']))
{
echo '
<div class="smalltext">
<div>
<span class="birthday">', $txt['birthdays'], '</span>';

/* Each of the birthdays has:
Expand Down Expand Up @@ -327,7 +327,7 @@ function template_show_month_grid($grid_name)
if (!empty($day['events']))
{
echo '
<div class="smalltext lefttext">
<div class="lefttext">
<span class="event">', $txt['events'], '</span><br />';

/* The events are made up of:
Expand Down
151 changes: 64 additions & 87 deletions themes/default/css/index.css
Expand Up @@ -3430,111 +3430,103 @@ tr.windowbg2 .stats_day {

/* Styles for the calendar section.
------------------------------------------------- */
/* @todo - Needs sorting - remove inline css in template. */
/* Removed css and redundant tags/classes from template. */
/* Parrots are stoked. Fred happy too. */
#calendar {
overflow: hidden;
}

/* Used to indicate the current day in the grid. */
.calendar_today {
background: #fff;
border: 1px solid #bbb;
box-shadow: 0 2px 5px #eee inset;
}
#month_grid {
padding: 0 15px 0 0;
width: 215px;
text-align: center;
float: left;
}
#month_grid .cat_bar {
border-radius: 5px 5px 0 0;
margin: 0 1px 0 0;
padding: 0 0 0 0;
}
#month_grid h3 a {
padding: 0 6px 0 6px;
}
#month_grid table {
width: 100%;
margin-bottom: 12px;
}
#main_grid {
position: relative;
overflow: hidden;
}
#main_grid table {
width: 100%;
margin-bottom: 2px;
padding-bottom: 4px;
}
#main_grid .cat_bar {
border-radius: 5px 5px 0 0;
margin: 0 1px;
#month_grid .catbg {
font-size: 1.1em;
text-align: center;
}
#main_grid h3.catbg {
padding: 8px 6px 4px 6px;
#main_grid .catbg {
font-size: 1.5em;
text-align: center;
}
#main_grid h3.catbg span {
#main_grid .catbg .floatleft, #main_grid .catbg .floatright {
display: block;
font-size: 1.5em;
margin: -3px 4px 0 4px;
margin: -3px 0 0 0;
}
#main_grid table th.days {
.calendar_table {
width: 100%;
font-size: 0.9em;
text-align: center;
background: #e4e4e4;
}
.calendar_table th, .calendar_table td {
padding: 2px 0;
background: #fff;
}
#month_grid .calendar_table {
margin-bottom: 12px;
border-top: 1px solid #ddd;
border-spacing: 1px;
background: #ddd;
}
#main_grid .titlebg2, #month_grid .titlebg2 {
background: none;
font-size: 0.889em;
}
#main_grid .titlebg2 {
font-size: 1.1em;
}
#main_grid .days {
width: 14%;
padding: 4px 0;
padding: 4px;
}
#main_grid table td.weeks {
text-align: center;
#main_grid .windowbg.days {
height: 100px;
}
/* Used to indicate the current day. */
#main_grid .calendar_today, #month_grid .calendar_today {
border: 1px solid #aaa;
background: #ebffd8;
}
#main_grid .weeks {
font-weight: bold;
font-size: 1.8em;
}
#main_grid table td.weeks a:hover {
#main_grid .weeks a:hover {
text-decoration: none;
}
#main_grid table td.days {
#main_grid .days {
vertical-align: top;
text-align: center;
}
#main_grid .weekly {
text-align: center;
font-size: 1.4em;
}
/* @todo - Buggy CSS with divider between months. Sort when doing other stuff. */
#main_grid ul.weeklist, #main_grid ul.weeklist li {
margin: 0 0 8px 0;
padding: 0;
float: left;
width: 100%;
overflow: hidden;
.weeklist {
border-bottom: 2px solid #e4e4e4;
}
#main_grid ul.weeklist li {
margin: 0 1px 0 1px;
border-top: 2px solid #fff;
.weeklist>li {
overflow: hidden;
border: 2px solid #e4e4e4;
border-bottom: none;
}
#main_grid .weeklist h4 {
text-align: center;
.weeklist h4 {
float: left;
width: 10em;
width: 140px;
font-size: 1.2em;
padding: 15px 0;
padding: 10px;
border-right: 2px solid #e4e4e4;
}
#main_grid .weeklist h4 a:hover {
.weeklist h4 a:hover {
text-decoration: none;
border-bottom: 1px solid #555;
}
/* Use the old one true layout trick here. */
#main_grid .weeklist .windowbg2 {
margin: 0 0 -95px 12em;
.weeklist .windowbg2, .weeklist .calendar_today {
margin: 0 0 -95px 160px;
padding: 8px 8px 100px 8px;
border-radius: 0;
border-left: 2px solid #fff;
}
#main_grid .weeklist .calendar_today {
margin: 0 0 -95px 12em;
padding: 8px 8px 100px 8px;
border-left: none;
background: #fff;
}
.modify_event {
color: red;
Expand All @@ -3544,30 +3536,15 @@ tr.windowbg2 .stats_day {
}
/* Add a background that fits with the calendar. */
#calendar_navigation {
margin: -6px 1px 0 1px;
padding: 12px 0;
text-align: center;
float: left;
width: 100%;
background: #e7eaef;
border: 2px solid #e4e4e4;
border-top: none;
}
/* Cheat and match this to the submit button. */
#main_grid .buttonlist {
position: absolute;
bottom: 12px;
right: 12px;
}
#main_grid .buttonlist a {
background: #cde7ff;
border: 1px solid #aaa;
border-radius: 3px;
}
#main_grid .buttonlist a:hover {
background: #dceeff;
color: #555;
}
.calendar_table {
border-spacing: 1px;
#calendar_navigation .buttonlist {
margin: -5px 0;
padding: 0 6px;
}

/* Styles for the memberlist section.
Expand Down