diff view/layout/usermenu.tt @ 14:d997ff96acf1

sync
author sergey
date Mon, 19 May 2014 18:34:16 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/view/layout/usermenu.tt	Mon May 19 18:34:16 2014 +0400
@@ -0,0 +1,17 @@
+[%
+	IF user.isNobody;
+		usermenu = [
+			{ title = 'Login', href= app.location.user.login(ref = location) }
+		];
+	ELSE;
+		usermenu = [
+			{ title = user.name },
+			{ title = 'Settings', href = app.location.user },
+			{ title = 'Logout', href = app.location.user.logout }
+		];
+		IF session.Satisfy(adminRole);
+			usermenu.push({title = 'Admin', href = app.location.admin });
+		END;
+	END;
+	render('menu', items = usermenu, class = 'menu-bar float-right', id = 'user-menu');
+%]
\ No newline at end of file