<dtml-var manage_navbar>

<dtml-with "_(manage_options=filtered_manage_options())"
	><dtml-if manage_options
		><dtml-call "REQUEST.set('n_', _.len(manage_options)-1)"
		><dtml-call "REQUEST.set('a_', 0)"
		><dtml-in manage_options mapping
			><dtml-if expr="REQUEST.URL[-(_.len(action)):]==action or
				REQUEST.URL[-17:]=='/manage_workspace' and _['sequence-start']"
				><dtml-call "REQUEST.set('a_', _['sequence-index'])"
			></dtml-if
			><dtml-if "_.has_key('management_view') and management_view==label"
				><dtml-call "REQUEST.set('a_', _['sequence-index'])"
			></dtml-if
		></dtml-in>

		<nav id="tabs" class="navbar navbar-light navbar-expand-md mt-0 mb-0 pb-0" role="navigation">
			<div class="collapse navbar-collapse row" id="tabs_items">
				<ul class="nav nav-tabs">
					<dtml-in manage_options mapping>
						<dtml-let s_item=sequence-item s_index=sequence-index>
							<li class="nav-item">
								<a <dtml-if "s_index==a_"> class="nav-link active"<dtml-else> class="nav-link"</dtml-if
									><dtml-if "s_item.get('action')"> href="&dtml-action;"<dtml-else> href="<dtml-var "REQUEST.URL1" html_quote>"</dtml-if
									><dtml-if "s_item.get('target')"> target="&dtml-target;"</dtml-if>
									><dtml-var "s_item['label']"></a>
							</li>
						</dtml-let>
					</dtml-in>
				</ul>
			</div>
		</nav>
	</dtml-if>

<dtml-comment>
	<dtml-unless MANAGE_TABS_NO_BANNER>
		<!-- IS THIS STILL NEEDED? WHY SHOW NOT BREADCRUMB etc.?
			https://mail.zope.dev/pipermail/zope-checkins/1999-August/001313.html
		-->
	</dtml-unless>
</dtml-comment>

		<nav aria-label="breadcrumb">
		<dtml-let breadcrumb_length="tabs_path_length(REQUEST)">
			<ol class="breadcrumb <dtml-var "'zmi-' + title_or_id().replace(' ','')">"
				data-length="<dtml-var breadcrumb_length>">
				<li class="breadcrumb-item meta_type">
					<dtml-if meta_type>
						<i class="&dtml-zmi_icon;" title="&dtml-meta_type;"></i>
						<dtml-var "breadcrumb_length==1 and 'Root Folder' or meta_type">
					<dtml-else>
						Object
					</dtml-if>
				</li>
				<dtml-in expr="tabs_path_default(REQUEST)" mapping>
					<li class="breadcrumb-item<dtml-if last> active</dtml-if>"
						<dtml-if last>
							aria-current="page"
							title="<dtml-if meta_type>&dtml-meta_type;<dtml-else>Object</dtml-if>"
						</dtml-if>
						><a href="&dtml-url;">
							<dtml-if "_['sequence-index']==0">
								<strong title="Root Folder">&nbsp;/&nbsp;</strong>
							<dtml-else>
								&dtml-title;
							</dtml-if>
						</a>
						<dtml-if "_['sequence-index']!=0 and last==False">
							&nbsp;/&nbsp;
						</dtml-if>
						<dtml-if last>
						    <dtml-if wl_isLocked
						    	><span class="badge badge-warning"
						    		title="This item has been locked by WebDAV"><i class="fa fa-lock"></i></span>
						    </dtml-if>
						</dtml-if>
					</li>
				</dtml-in>
			</ol>
			</dtml-let>
		</nav>


	<dtml-if manage_tabs_message>
			<div class="alert alert-<dtml-var manage_tabs_type missing=success html_quote>" role="alert">
				<dtml-var manage_tabs_message newline_to_br html_quote
				> (<dtml-var ZopeTime fmt="%Y-%m-%d %H:%M">)
			</div>
	</dtml-if>

</dtml-with>
