Add data null checks to CoffeeScript files

Due to asset pipelining all JavaScript code is executed everywhere even
though required gon data is missing. This leads to errors. I considered
to require one JavaScript file per view, but after all one should keep
the number of HTTP requests down. Hence, I simply introduced null checks
for the respective data.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>