<%inherit file="base.html" />
<%!
	import headphones
	from headphones.helpers import checked
%>

<%def name="body()">
	<div id="nav-sub-container">
		<ul id="nav-sub">
			<li><a class="active" href="manage">Manage</a></li>
			<li><a href="manageAlbums">Albums</a></li>
			<li><a href="manageArtists">Artists</a></li>
			%if not headphones.ADD_ARTISTS:
			<li><a href="manageNew">New Artists</a></li>
			%endif
		</ul>
	</div>
	<div id="config_wrapper">
		<div>
			<h1>Scan Music Library</h1>
			<table class="configtable">
				<tr>
					<form action="musicScan" method="GET">
							%if headphones.MUSIC_DIR:
								<td>						
									<h2>Local Music Directory:</h2>
									<small>
										You can put in any directory, and it will scan for audio files in that folder
										(including all subdirectories)<br />
										For example: '/Users/name/Music'
									</small>
								</td>
									<td><input type="text" value="${headphones.MUSIC_DIR}" name="path" size="60" /></td>
							%else:
								<td>
									<h2>Local Music Directory:</h2>
									<small>
										You can put in any directory, and it will scan for audio files in that folder
										(including all subdirectories)<br />
										For example: '/Users/name/Music'
									</small>
								</td>
									<td><input type="text" placeholder="Music Directory" onfocus="if (this.value==this.defaultValue) this.value='';" name="path" size="60" /></td>
							%endif
				</tr>
				<tr>
					<td colspan="2">
						<input class="styled" type="checkbox" name="libraryscan" value="1" ${checked(headphones.LIBRARYSCAN)} /> <label for="libraryscan">Automatically scan library</label>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<input class="styled" type="checkbox" name="autoadd" value="1" ${checked(headphones.ADD_ARTISTS)} /> <label for="autoadd">Automatically add new artists</label>
					</td>
				</tr>
				<tr>
					<td>
						
					</td>
				</tr>
			</table>
				<input type="submit" /> <small><span class="wsr Alert"></span> This process runs in the background.</small>
			</form>
		</div>
		<div id="Import">
			<table>
				<tr>
					<td colspan="2"><h2>Import Last.FM Artists</h2></td>
				</tr>
				<tr>
					<td>
						<label for="username">Username:</label>
					</td>
					<td>
						<form action="importLastFM" method="GET" align="left">
							<%
								if headphones.LASTFM_USERNAME:
									lastfmvalue = headphones.LASTFM_USERNAME
								else:
									lastfmvalue = 'Last.fm Username'
							%>
							<input type="text" value="${lastfmvalue}" name="username" size="18" />
							<input type="submit" />
						</form>
					</td>
				</tr>
			</table>
		</div>
		<!--Hidden
		<div id="Search">
			<h2>Force Search</h2>
			<table class="configtable">
				<tr>
					<td>
						<h3><a href="forceSearch">Force Check for Wanted Albums</a></h3>
						<h3><a href="forceUpdate">Force Update Active Artists</a></h3>
						<h3><a href="forcePostProcess">Force Post-Process Albums in Download Folder</a></h3>
						<h3><a href="checkGithub">Check for Headphones Updates</a></h3>
					</td>
				</tr>
			</table>
		</div>
		-->
	</div>
</%def>
