Updated user menu and shortcuts bar in main layout
authorThierry Florac <thierry.florac@onf.fr>
Mon, 18 Jan 2016 18:41:23 +0100
changeset 117 00bfb7b29d9e
parent 116 89efe1933eb5
child 118 391ad752903e
Updated user menu and shortcuts bar in main layout
src/pyams_skin/templates/layout.pt
--- a/src/pyams_skin/templates/layout.pt	Mon Jan 18 18:40:52 2016 +0100
+++ b/src/pyams_skin/templates/layout.pt	Mon Jan 18 18:41:23 2016 +0100
@@ -63,63 +63,63 @@
 			</div>
 			<!-- end collapse menu -->
 
-			<!-- logout button -->
-			<div id="logout" class="btn-header pull-right" tal:condition="userid">
-				<span>
-					<a href="logout.html" title="Logout" class="hint" i18n:attributes="title"
-					   data-ams-hint-gravity="ne"><i class="fa fa-sign-out"></i></a>
+			<!-- User avatar and user menus -->
+			<div id="user-menu" class="btn-header pull-right margin-left-10">
+				<span class="btn btn-sm btn-success" data-toggle="dropdown">
+					<tal:var define="profile extension:public_profile(request)">
+						<tal:if condition="profile.avatar">
+							<img tal:define="src extension:absolute_url(profile.avatar)"
+								 tal:attributes="src string:${src}/++thumb++square:32x32.png" />
+						</tal:if>
+						<tal:if condition="not:profile.avatar">
+							<i class="fa fa-user img hint" data-ams-hint-gravity="ne"
+							   title="Update your profile to select an avatar..." i18n:attributes="title"></i>
+						</tal:if>
+						<i class="fa fa-caret-down pull-right padding-y-5"></i>
+					</tal:var>
 				</span>
+				<tal:var content="structure provider:pyams.user_menus" />
 			</div>
-			<!-- end logout button -->
-
-			<!-- User info -->
-			<div id="login-info" class="login-info">
+			<!-- end user avatar -->
 
-				<!-- User login name and status -->
-				<span>
-					<span id="activity" class="activity-dropdown" tal:condition="userid">
-						<tal:var define="profile extension:public_profile(request)">
-							<tal:if condition="profile.avatar">
-								<img tal:define="src extension:absolute_url(profile.avatar)"
-									 tal:attributes="src string:${src}/++thumb++square:24x24.png" />
-							</tal:if>
-							<i tal:condition="not:profile.avatar" class="fa fa-user"></i>
-						</tal:var>
-						<b class="badge hidden">0</b>
+			<tal:var define="shortcuts provider:pyams.shortcuts;
+							 display_shortcuts shortcuts and static.include_user_shortcuts"
+					 condition="display_shortcuts">
+				<!-- user shortcuts -->
+				<div class="btn-header pull-right" tal:condition="static.include_menus">
+					<span>
+						<a href="#" title="My shortcuts" id="show-shortcuts" class="hint" i18n:attributes="title"
+						   data-ams-hint-gravity="ne"><i class="fa fa-bookmark-o"></i></a>
 					</span>
+				</div>
+				<div id="shortcuts">
+					<tal:var content="structure shortcuts" />
+					<div tal:condition="static.version_location == 'shortcuts'" class="version">
+						<tal:var content="static.application_name" /> - version <tal:var content="static.version" />
+					</div>
+				</div>
+				<!-- end user shortcuts -->
+			</tal:var>
 
-					<tal:if condition="static.include_user_activity">
-						<tal:var define="activity provider:pyams.activity"
-								 condition="activity">
+			<tal:if condition="static.include_user_activity">
+				<tal:var define="activity provider:pyams.activity"
+						 condition="activity">
+					<!-- user notifications button -->
+					<div id="user-activity" class="btn-header pull-right" tal:condition="static.include_menus">
+						<span>
+							<a href="#" title="Notifications" class="hint" i18n:attributes="title"
+							   data-ams-hint-gravity="ne"><i class="fa fa-bell"></i></a>
+							<b class="badge bg-color-danger txt-color-white">8</b>
 							<!-- AJAX-dropdown -->
 							<div class="ajax-dropdown"
 								 tal:content="structure activity">
 							</div>
 							<!-- end AJAX-dropdown -->
-						</tal:var>
-					</tal:if>
-
-					<tal:var define="shortcuts provider:pyams.shortcuts;
-									 display_shortcuts shortcuts and static.include_user_shortcuts">
-						<a class="btn btn-sm btn-success" href="#" id="show-shortcut" tal:condition="userid">
-							<span class="login-name" tal:content="request.principal.title">Auth login</span>&nbsp;
-							<i class="fa fa-caret-down" tal:condition="display_shortcuts"></i>
-						</a>
-						<tal:if condition="not:userid">
-							<a class="btn btn-sm btn-primary txt-color-white"
-							   data-toggle="modal" data-ams-url="login-dialog.html">Login</a>
-						</tal:if>
-						<div id="shortcut" tal:condition="display_shortcuts">
-							<tal:var content="structure shortcuts" />
-							<div tal:condition="static.version_location == 'shortcuts'" class="version">
-								<tal:var content="static.application_name" /> - version <tal:var content="static.version" />
-							</div>
-						</div>
-					</tal:var>
-				</span>
-
-			</div>
-			<!-- end user info -->
+						</span>
+					</div>
+					<!-- end user notifications -->
+				</tal:var>
+			</tal:if>
 
 			<tal:if condition="static.include_mobile_search">
 				<!-- search mobile button (this is hidden till mobile view port) -->
@@ -172,7 +172,7 @@
 			</span>
 			<!-- breadcrumb -->
 			<ol class="breadcrumb">
-				<li>Home</li>
+				<tal:var content="structure provider:pyams.breadcrumbs" />
 			</ol>
 		</div>
 		<!-- end ribbon -->