When trying this module, I stumbled upon a problem.
The colors as set in the availability_calendars.css file were not showing
Instead the overall drupal theme colors were used.

I noticed that the css is only using classes and no id's
I have solved this problem by adding an div around the whole calendar

function theme_availability_calendars_node($node, $year = 2008, $month = 01, $monthstodisplay = 12) {

$output .= '

';
$output .= ...........
$output .= '

';

return $output;
}

In the availability_calendars.css file I added the id name before every tag
#availability_calendars

Comments

nicholas.alipaz’s picture

Status: Active » Closed (won't fix)

I have to think this is a theming issue unless others can reproduce it, so I am marking as won't fix until then.

wouterlanda’s picture

i have the same problem. colors are not showing at all. i tried other themes also.
colours were shown when i used the regular version. but after installing the latest development version, the colours disappeared.
any idea?

nicholas.alipaz’s picture

be sure you ran upgrade.php and flushed the caches on drupal as well as your browser. what theme are you using?

wouterlanda’s picture

i ran the upgrade. just emptied the caches... but it still doesn't show the colors.
i'm using forest-floor. but switching to another template (e.g. garland) doesn't do the trick...
i appreciate your help

nicholas.alipaz’s picture

are you overriding the theme function or possibly have something in your css that is overriding it? Also are you confident that you have the most up to date css file in the availability_calendars directory? I suggest deleting the availability_calendars folder and extracting a new one from the dev tarball you downloaded. Just to be sure all files are recent.

BTW, I just did a fresh install with the dev tarball and cannot reproduce this.

nicholas.alipaz’s picture

Category: bug » support
wouterlanda’s picture

i saw i messed some things up with patching the latest updates.
right now I have the dev of 10-10-09 installed and that works fine.
can you tell me which patch i would have to install to be able to add more options (next to available, booked and option).

i also have one other question. i would like to set a background for an option which shows 2 colors (for days which are half booked). One i have the possibility to create more options, i can easily create them for half day bookings (morning, afternoon and morning&afternoon)

your help is appreciated

nicholas.alipaz’s picture

You should be able to use the patch here: #306461-19: Custom availability states and legend

Realize that it is patched against the current CVS dev, not the tarball you downloaded. So you could get an error or two in patching, usually in the .info file since that will be the only thing that differs between cvs and the tarball.

You should be able to add your custom labels through the admin interface once patched. Then use css to make the days look at "half days."

Steps to do:

  1. Download your tarball and extract
  2. Patch the module with the given patch
  3. Enable the module, if not already, then run update.php
  4. Go to administration panel and add your custom labels AM/PM and etc. Note the css classes that are used for your new labels.
  5. Open your theme's stylesheet or a custom stylesheet you might be using and add the css classes with appropriate background images for the half days. It will be necessary to use a background image since there is really no good way to have two colors cut diagonally in a box with css alone.
    Example css:
    .my-label{background:transparent url(image/my-label.png) no-repeat scroll 0 0;}
  6. Flush caches in site and browser and check to see if changes work.

If it does not work then I will be glad to have a look at your site, just give me a link here or via my contact form. Please note that the above patch is not yet officially supported and will likely undergo changes so it may not be a good idea to use on a live website. Unless you are in a bind or something.

wouterlanda’s picture

thanks for all your help, it's working
see http://www.rauscher.nl/bosweg/node/27

do you have any idea how i can create the images for half day bookings?

nicholas.alipaz’s picture

photoshop or any image editor. gimp is free if you don't have one. I suggest an image that is divided into two either diagonally (may not look great), or horizontally. Just be sure to use the same colors you have used in your site.

/*style.css (line 712)*/
.geboekt-am {
background:transparent url(images/geboekt-am.png) no-repeat scroll 0 0;
}
wouterlanda’s picture

one more thing on this item.
i just changed the template. i added the lines for the calendar to the css file. But nothing happend.
I emptied the caches, but that doesn't work either.
The theme I use now is Energetic. But I also tried it with other themes and that didn't work either.

any idea?

nicholas.alipaz’s picture

Assigned: vedeem » Unassigned

be sure you have emptied both your site's cache and your browser's cache.

wouterlanda’s picture

i did...
but just now i found out that i did not copy the images to the correct folder.
this partially was part of the problem. the colors which are images are now being shown correctly. but for the states which just have a color i couldn't get it right. i solved it by creating some pictures...

nicholas.alipaz’s picture

It is my guess that you can't override the colors because your css might not be using the same syntax as the original stylesheet. But glad to hear you got it through images at least.

Actually, looking at your stylesheet I can see you have the following at line 907:

.article table, table.article .article tr, .article th, .article td {
  background-color:Transparent;
}

That is going to override any background color you apply before that, or even after that if the css you specify is not more specific than this statement was.

This example would attempt to change the background color to black, but would not work because of specificity:

.article table, table.article .article tr, .article th, .article td {
  background-color:Transparent;
}
.geboekt-am {
  background-color:#000;
}

However this example would work:

.article table, table.article .article tr, .article th, .article td {
  background-color:Transparent;
}
.article td.geboekt-am {
  background-color:#000;
}

Hope this makes it a bit clearer for you.