Browser view with utility methods that can be used in templates.
Several methods in this view assume that the current survey can be found as an attribute on the request. This is normally setup by the euphorie.client.survey.SurveyPublishTraverser traverser.
Return the URL to the current online about page. If we are in a survey the help page will be located there. Otherwise the country will be used as parent.
Return a list of items to be shown in the appendix.
Check if the current user is authenticated.
Return the absolute URL for the client.
Return the absolute URL for country page.
Return the URL to the current online help page. If we are in a survey the help page will be located there. Otherwise the country will be used as parent.
Check if there is an active survey session.
Check if the current request is from an iPhone or similar device (such as an iPod touch).
Return the title to use for the current sector. If the current context is not in a sector return the agency name instead.
Return the URL for the current survey.
Return the absolute URL for the session overview.
Determine if a HTML fragment contains text.
Switch Plone to another language. If no language is given via the lang parameter the language is taken from a language request parameter. If a dialect was chosen but is not available the main language is used instead. If the main language is also unavailable switch back to English.
Determine the relative path between two items in the ZODB.
Determine a colour that contrasts with a given colour. The resulting colour pair can be used as foreground and background, guaranteeing readable text.
The match colour is determined by flipping the luminisoty to 10% or 90%, while keeping the hue and saturation stable. The only exception are yellowish colours, for those the luminosity is always set to 10%.
Check if a (RGB) colour is a bright colour.