[ticket:6] Move js from template to file.
Merge branch 'master' into t6_calendar_ajax
[ticket:6] Fix state message when form contains errors.

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Merge branch 't6_calendar_ajax'