<?php
$name = str_replace(['[', ']', ' ', '²', '/'], ['', '', '_', '2', '_'], strtolower($title));
$url_base = ['p' => 'ventas', 'a' => 'list', 'proyecto' => $proyecto->id, 'sort' => $name];
if (get('sort') == $name or (get('sort') == null and $name == 'departamento')) {
	if (get('sort_dir')) {
		$url_base['sort_dir'] = get('sort_dir');
	} else {
		$url_base['sort_dir'] = 1;
	}
	$url_base['sort_dir'] *= -1;
}
?>
<a href="{{url('', $url_base)}}">
	{{$title}}
	@if (get('sort') == $name or (get('sort') == null and $name == 'departamento'))
		@if (get('sort_dir') == 1 or get('sort_dir') == null)
		<span class="caret"></span>
		@else
		<span class="dropup">
			<span class="caret"></span>
		</span>
		@endif
	@endif
</a>
