@(form: Form[Target], user: User)

@import templates.inputText

@implicitField = @{ helper.FieldConstructor(templates.ratio5to7FieldConstructor.f) }

@main("", user) {
	<div class="page-header">
    	<h1>
    		<a href="@routes.TargetController.index()">Targets</a> >
			<a href="@routes.TargetController.view(new Long(form("id").value))#crawlpolicy">@form("title").value</a> >
			@if(form("secretId").value == null) {Add} else {Change} Login Credentials
		</h1>
	</div>
	
	@warningmessage(flash)
	@helper.form(action = routes.LoginCredentialsController.save(new Long(form("id").value))) {
		<div>
			<input type="hidden" name="id" value="@form("id").value">
			@inputText(form("loginPageUrl"), true, '_label -> "Login Page URL")
			@inputText(form("logoutUrl"), true, '_label -> "Logout URL")
			<br>
			@if(form("secretId").value != null) {
				Username and Password are stored for this Watched Target, but not displayed. Use the fields below to overwrite.
			}
			@inputText(form("username"), true, '_label -> "Username", 'autocomplete -> "off")
			@inputText(form("password"), true, '_label -> "Password", 'autocomplete -> "off")
			
			<input type="submit" class="btn btn-primary" value="Save">
		</div>
	}
}
