Hi
Has anyone edited the availability calendar template so that it a) shows the dates and not just a 1 b) doesn't take up so much screen real estate and c) not easy to understand.
Thanks
Availability Calendar looks like crap
Re: Availability Calendar looks like crap
Sorry,
I can't help you right now cause I'm a newbie, but I am intrested in your template can you post it please ?
Mybe I can help you later
I can't help you right now cause I'm a newbie, but I am intrested in your template can you post it please ?
Mybe I can help you later
Re: Availability Calendar looks like crap
That is the default template. Here it is fixed:
Code: Select all
{* calendar view template *}
{if isset($grid)}
<div class="availability_calendar">
<div>
<p style="float: left; width: 24%;"><a href="{$prevmonth_url}">{$mod->Lang('prev')}</a></p>
<p style="float: left; text-align: center; width: 50%;"><strong>{$dispdate|cms_date_format:"%B %Y"}</strong></p>
<p style="float: right; text-align: right; width: 24%;"><a href="{$nextmonth_url}">{$mod->Lang('next')}</a></p>
</div>
<div style="width: 100%; overflow: auto;clear:right">
<table class="availability_calendar_table">
<thead>
{section name='day' loop=$grid max=1}
<tr>
{section name='rsrc' loop=$grid[day]}
{if $smarty.section.rsrc.index == 0}
{* first cell *}
<th style="text-align: center;" width="2%">{$grid[day][rsrc]|cms_date_format:"%m/%y"}</th>
{else}
<th style="text-align: center;"><a href="{$grid[day][rsrc]->url}" title="{$mod->Lang('view_rsrc_details',$mod->GetResourceType())}">{$grid[day][rsrc]->label}</a></th>
{/if}
{/section}
</tr>
{/section}
</thead>
<tbody>
{section name='day' loop=$grid start=1}
<tr>
{section name='rsrc' loop=$grid[day]}
{if $smarty.section.rsrc.index == 0 }
{* day column *}
<td style="text-align: right; background-color: #ccc;">
<a href="{$grid[day][rsrc]->url}" title="{$mod->lang('view_day')}">{$smarty.section.day.iteration}</a>
</td>
{else}
{assign var='label' value=$grid[day][rsrc]->label}
{if $grid[day][rsrc]->status == 'closed'}
{assign var='label' value=$mod->Lang('closed')}
{/if}
<td style="text-align: center; background-color: {$grid[day][rsrc]->bg}; color: {$grid[day][rsrc]->fg};">
{if isset($grid[day][rsrc]->url)}
<a href="{$grid[day][rsrc]->url}" title="{$mod->Lang('create_reservation')}">{$label}</a>
{else}
{$label}
{/if}
</td>
{/if}
{/section}
</tr>
{/section}
</tbody>
</table>
</div>
{if isset($legend)}
<fieldset class="availability_calendar_legend">
<legend>{$mod->Lang('legend')}: </legend>
<table>
{foreach from=$legend key='name' item='item'}
<tr>
<td>{$name}:</td>
<td style="background-color: {$item->bg}; color: {$item->fg};">
{$item->label}
</td>
</tr>
{/foreach}
</table>
</fieldset>
{/if}
{* availability_calendar *}</div>
{/if}
Re: Availability Calendar looks like crap
Partial responce:
a) shows the dates and not just a 1
edit the {* day column*} section of the {* calendar view template *} to look like this:
{* day column *}
url}" title="{$mod->lang('view_day')}">{$grid[day][rsrc]->time|cms_date_format:"%d/%m/%y"}
b) doesn't take up so much screen real estate
Always in {* calendar view template *} play with width: XX%, sample:
{if isset($grid)}
{$mod->Lang('prev')}
{$dispdate|cms_date_format:"%Y"}
{$mod->Lang('next')}
c) need some CSS background I don't have
still continue to try...
a) shows the dates and not just a 1
edit the {* day column*} section of the {* calendar view template *} to look like this:
{* day column *}
url}" title="{$mod->lang('view_day')}">{$grid[day][rsrc]->time|cms_date_format:"%d/%m/%y"}
b) doesn't take up so much screen real estate
Always in {* calendar view template *} play with width: XX%, sample:
{if isset($grid)}
{$mod->Lang('prev')}
{$dispdate|cms_date_format:"%Y"}
{$mod->Lang('next')}
c) need some CSS background I don't have
still continue to try...