<!--
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-->

<form id="replication" class="form-horizontal">
		<div class="from form_set  local">
			<div class="btn-group">
			  <button class="btn local-btn" type="button" value="local">Local</button>
			  <button class="btn remote-btn" type="button" value="remote">Remote</button>
			</div>

			<div class="from_local local_option">
				<select id="from_name" name="source">
					<% _.each( databases, function( db, i ){ %>
					   <option value="<%=db.name%>" <% if(selectedDB == db.name){%>selected<%}%> ><%=db.name%></option>
					<% }); %>
				</select>
			</div>
			<div class="from_to_remote remote_option">
				<input type="text" id="from_url" name="source" size="30" value="http://">
			</div>
		</div>

		<div class="form_set middle">
			<span class="circle "></span>
				<a href="#" title="Switch Target and Source" class="swap">
					<span class="fonticon-swap-arrows"></span>
				</a>
			</span>
		</div>

		<div class="to form_set local">
			<div class="btn-group">
			  <button class="btn local-btn" type="button" value="local">Local</button>
			  <button class="btn remote-btn" type="button" value="remote">Remote</button>
			</div>
			<div class="to_local local_option">
				<input type="text" id="to_name" name="target" size="30" placeholder="database name">
			</div>

			<div class="to_remote remote_option">
				<input type="text" id="to_url" name="target" size="30" value="http://">
			</div>
		</div>


	<div class="actions">
		<div class="control-group">
			<label for="continuous">
				<input type="checkbox" name="continuous" value="true" id="continuous">
				Continuous
			</label>

			<label for="createTarget">
				<input type="checkbox" name="create_target" value="true" id="createTarget">
				Create Target <a href="<%-getDocUrl('replication_doc')%>" target="_blank"><i class="icon-question-sign" rel="tooltip" title="Create the target database"></i></a>
			</label>
		</div>

		<button class="btn btn-success btn-large save" type="submit">Replicate</button>
	</div>
</form>

<div id="replicationStatus"></div>
