<xf:macro id="item"
	arg-report="!">

	<xf:css src="structured_list.less" />

	<div class="structItem structItem--report {{ ($report.canView($report) && $report.isAssignedTo()) ? 'is-highlighted' : '' }}">
		<div class="structItem-cell structItem-cell--icon">
			<div class="structItem-iconContainer">
				<xf:avatar user="$report.User" size="s" />
			</div>
		</div>
		<div class="structItem-cell structItem-cell--main" data-xf-init="touch-proxy">
			<a href="{{ link('reports', $report) }}" class="structItem-title" data-tp-primary="on">
				<xf:if is="$report.canView($report)">
					{$report.title}
				<xf:else />
					{{ phrase('unknown_content') }}
				</xf:if>
			</a>

			<div class="structItem-minor">
				<ul class="structItem-extraInfo">
					<li>
						{{ $report.getReportState() }}
						<xf:if is="$report.assigned_user_id && $report.canView($report)">
							{$report.AssignedUser.username|parens}
						</xf:if>
					</li>
				</ul>

				<ul class="structItem-parts">
					<li><xf:username user="$report.User" defaultname="{{ phrase('unknown_member') }}" /></li>
					<li class="structItem-startDate"><a href="{{ link('reports', $report) }}" rel="nofollow"><xf:date time="{$report.first_report_date}" /></a></li>
				</ul>
			</div>
		</div>
		<div class="structItem-cell structItem-cell--meta">
			<dl class="pairs pairs--justified">
				<dt>{{ phrase('reports') }}</dt>
				<dd>{$report.report_count|number}</dd>
			</dl>
			<dl class="pairs pairs--justified structItem-minor">
				<dt>{{ phrase('comments') }}</dt>
				<dd>{$report.comment_count|number}</dd>
			</dl>
		</div>
		<div class="structItem-cell structItem-cell--latest">
			<a href="{{ link('reports', $report) }}" rel="nofollow"><xf:date time="{$report.last_modified_date}" class="structItem-latestDate" /></a>
			<div class="structItem-minor">
				<xf:if is="$report.canView($report)">
					<xf:username user="{$report.last_modified_cache}" />
				<xf:else />
					{{ phrase('n_a') }}
				</xf:if>
			</div>
		</div>
	</div>
</xf:macro>

<xf:macro id="search_menu">
	<div class="menu" data-menu="menu" aria-hidden="true">
		<xf:form action="{{ link('reports/search') }}" class="menu-content">
			<div class="menu-row">
				{{ phrase('find_reports_for_member:') }}
				<xf:textbox name="username" ac="single" maxlength="{{ max_length($xf.visitor, 'username') }}" />
			</div>
			<div class="menu-footer">
				<span class="menu-footer-controls"><xf:button type="submit" class="button--primary" icon="search" /></span>
			</div>
		</xf:form>
	</div>
</xf:macro>