'Display the project on a Simile Timeline
http://www.simile-widgets.org/wiki/Reference_Documentation_for_Timeline
Currently this just displays a Google Calendar
@ToDo: Add Milestones
@ToDo: Filters for different \'layers\'
@ToDo: export milestones/tasks as .ics'

@staticmethod
def project_timeline(r, **attr):

    if ((r.representation == 'html') and (r.name == 'project')):
        appname = current.request.application
        response = current.response
        s3 = response.s3
        calendar = r.record.calendar
        s3.scripts.append(('/%s/static/scripts/simile/timeline/timeline-api.js' % appname))
        s3.js_global.append(('S3.timeline.calendar="%s"' % calendar))
        if s3.debug:
            s3.scripts.append(('/%s/static/scripts/S3/s3.timeline.js' % appname))
        else:
            s3.scripts.append(('/%s/static/scripts/S3/s3.timeline.min.js' % appname))
        item = DIV(_id='s3timeline', _class='s3-timeline')
        output = dict(item=item)
        output['title'] = current.T('Project    Calendar')
        if ('rheader' in attr):
            rheader = attr['rheader'](r)
            if rheader:
                output['rheader'] = rheader
        response.view = 'timeline.html'
        return output
    else:
        raise HTTP(405, current.ERROR.BAD_METHOD)
