#!/bin/sh -ef

. /usr/share/alterator/build/backend3.sh

alt_template()
{
	echo '('
	case "$in__objects" in
		/)
				echo ' template "form"'
				echo ' translate "alterator-ovz"'
				echo ' url "ovz-profile-list.html"'
				[ "$in_orig_action" = "new" -a -n "$in_name" ] &&
				    printf ' redirect "/ovz-profile/profiles/%s"' "$in_name"
				;;
		*)
				echo ' template "form"'
				echo ' translate "alterator-ovz"'
				echo ' url "ovz-profile-object.html"'
				echo ' redirect #f'
				;;
	esac
	echo ')'
}

on_message()
{
	case "$in_action" in
		#information for renderer
		template)
			alt_template
			;;
		*)
			echo '#f'
			;;
	esac
}

message_loop
