
<article id="mainBody" class="container">
	<section class="container-fluid">
		<div class="row-fluid">
		<!--SIDEBAR AREA-->
		<aside id="sidebar" class="span4 well">
    	    <div class="filter-contain row-fluid">
    	    	<div class="row-fluid">
		    		<h2 class="nav-header span4">Filters</h2>
		    		<a class="span7" id="clear-all">Clear all <i class="icon-remove icon"></i></a>
			    	<ul id="current-all-filters" class="current-filters" data-category="all"></ul>
			    	<ul id="current-attribute-filters" class="current-filters span12" data-category="attribute"></ul>
			    	<ul id="current-creator-filters" class="current-filters span12" data-category="creator"></ul>
					<ul id="current-id-filters" class="current-filters" data-category="id"></ul>
					<ul id="current-taxon-filters" class="current-filters" data-category="taxon"></ul>
					<ul id="current-spatial-filters" class="current-filters" data-category="spatial"></ul>
				</div>
				<div class="input-append filter-contain">
					<input class="span10 filter" type="text" placeholder="Filter by anything" id="all_input" data-category="all">
					<button class="filter btn" id="all_btn" data-category="all"><i class="icon icon-search"></i></button>
			    </div>
			    
			    <div class="input-append filter-contain">
					<h3 class="nav-header"><i class="icon icon-table"></i><label>Data Attributes</label></h3>
					<input class="span10 filter" type="text" placeholder="Variable or column name" id="attribute_input" data-category="attribute">
					<button class="filter btn" id="attribute_btn" data-category="attribute"><i class="icon icon-search"></i></button>
			    </div>
				
				<% if(searchModelRef.filterIsAvailable("documents")){ %>
				   <div class="filter-contain" id="includes-files" data-category="documents">
						<label>
							<img src="img/data-table.png" class="icon" />
							<span class="tooltip-this" data-trigger="hover" data-title="Check this to only view datasets that include downloadable data files" data-placement="top">
								Data files
							</span>
						</label>
						<div class="filter-input-contain clear" id="includes-files-buttonset">
							<label for="includes_data">
								<i class="icon icon-check"></i>
								<i class="icon icon-check-empty"></i>
								Only results with data
							</label>
							<input class="filter" type="checkbox" id="includes_data" data-category="documents" name="includes_data" <% if (searchModelRef.filterIsAvailable("documents") && documents){ print("checked"); } %> />
							<i class="icon icon-question-sign more-info tooltip-this" data-trigger="hover" data-title="Checking this option will only return packages that include data files. Leaving this unchecked may return packages that only include metadata." data-placement="top"></i>	
						</div>
						<div class="clear"></div>
					</div>
				<% } %>
				
				<div class="input-append filter-contain">
					<h3 class="nav-header"><i class="icon icon-user"></i><label>Created by</label></h3>
					<input class="span10 filter" type="text" placeholder="First or last name" id="creator_input" data-category="creator">
					<button class="filter btn" id="creator_btn" data-category="creator"><i class="icon icon-search"></i></button>
			    </div>
	
				
				<div id="filter-year" class="filter-contain" data-category="year">
					<h3 class="nav-header"><i class="icon icon-calendar"></i><label>Year</label></h3>
					<input class="span1 left filter"  type="checkbox" id="data_year" name="data-coverage-year" data-category="dataYear" <% if (dataYear){ print("checked"); } %> />
					<label class="left year-tooltip popover-this" for="data_year" id="data-year-label" data-trigger="hover" data-content="Only show results with data collected within the year range" data-placement="right">
						<i class="icon icon-check"></i>
						<i class="icon icon-check-empty"></i>
						Data covers
					</label>					
					<div class="clear"></div>
					<input class="span1 left filter"  type="checkbox" id="publish_year" name="publish-year" data-category="pubYear" <% if (pubYear){ print("checked"); } %> />
					<label class="left year-tooltip popover-this" for="publish_year" data-trigger="hover" data-content="Only show results that were published within the year range" data-placement="right" >
						<i class="icon icon-check"></i>
						<i class="icon icon-check-empty"></i>
						Published between
					</label>
					<div class="clear"></div>
					<input class="span3"  type="number" id="min_year" value="<%=yearMin%>" />
					<input class="span3"  type="number" id="max_year" value="<%=yearMax%>" />
					<div class="clear"></div>
					<div id="year-range"></div>
					<div class="clear"></div>
				</div>
				
				<div class="input-append filter-contain">
					<h3 class="nav-header"><i class="icon icon-bullseye"></i><label>Identifier</label></h3>
					<input class="span10 filter" type="text" placeholder="Find datasets by DOI or ID" id="id_input" data-category="id">
					<button class="filter btn" id="id_btn" data-category="id"><i class="icon icon-search"></i></button>
				</div>
				
				<div class="input-append filter-contain">
					<h3 class="nav-header"><i class="icon icon-sitemap"></i><label>Taxon</label></h3>
					<input class="span10 filter" type="text" placeholder="Phylum, class, order..." id="taxon_input" data-category="taxon">
					<button class="filter btn" id="taxon_btn" data-category="taxon"><i class="icon icon-search"></i></button>
				</div>
				
				<div class="input-append filter-contain">
					<h3 class="nav-header"><i class="icon icon-map-marker span1"></i><label>Location</label></h3>
					<input class="filter span10" type="text" placeholder="Location" id="spatial_input" data-category="spatial">
					<button class="filter btn" id="spatial_btn" data-category="spatial"><i class="icon icon-search"></i></button>
				</div>
				
			</div>
			
		</aside>
		
		<!--CONTENT AREA-->
		<div id="content" class="span8">
			<div id="results-view" class="container-fluid">
				<div id="results-header" class="row-fluid result-header">
									
					<!-- count stats -->
					<div class="result-header-count span7" id="statcounts">0 to 0 of 0</div>
					
					<!-- sort order -->
					<div class="span3 text-right">
						<select id=sortOrder>
							<option <% if (sortOrder == "dateUploaded+desc") { print('selected="selected"'); } %> value="dateUploaded+desc">Most recent</option>
							<option <% if (sortOrder == "read_count_i+desc") { print('selected="selected"'); } %> value="read_count_i+desc">Popularity</option>
							<option <% if (sortOrder == "id+asc") { print('selected="selected"'); } %> value="id+asc">Identifier (a-z)</option>
							<option <% if (sortOrder == "titlestr+asc") { print('selected="selected"'); } %> value="titlestr+asc">Title (a-z)</option>
							<option <% if (sortOrder == "authorSurNameSort+asc") { print('selected="selected"'); } %> value="authorSurNameSort+asc">Author (a-z)</option>
						</select>
					</div>
					
					<!-- 
					<div class="result-header-menu span1">
						<div class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i
								class="icon icon-cog"></i> <b class="caret"></b></a>
							<ul class="dropdown-menu">
								<li><a href="#">Settings...</a></li>
							</ul>
						</div>
					</div>
					-->
					
				</div>
				
				<!-- search results here -->
				<div id="results" class="search-results"></div>
				
				<!-- pager -->
				<div id="resultspager" class="row-fluid pagination pagination-centered">
					<ul>
						<li><a id="results_prev_bottom">Prev</a></li>
						<li><a id="results_next_bottom">Next</a></li>
					</ul>
				</div>
			</div>
			<div id="metadata-view" class="container-fluid"></div>
		</div>
		</div>
	</section>
</article>

