<!-- TODO: make slug edit WordPress style -->
	<dt><label for="set[slug]"><?php 
_e('Slug');
?>
</label></dt>
	<dd><input type="text" name="set[slug]" value="<?php 
echo esc_html($set->slug ? $set->slug : 'default');
?>
" id="set[slug]"></dd>

	<dt><label for="set[project_id]"><?php 
_e('Project');
?>
</label></dt>
	<dd><?php 
echo gp_projects_dropdown('set[project_id]', $set->project_id);
?>
</dd>
</dl>
<?php 
echo gp_js_focus_on('set[locale]');
?>
<script type="text/javascript">
	jQuery(function($){
		$('#copy').click(function() {
			$('#set\\[name\\]').val($('#set\\[locale\\] option:selected').html().replace(/^\S+\s+\S+\s+/, '').replace(/&mdash|—/, ''));
			return false;
		});
	});
</script>
	<dd>
		<input type="text" value="<?php 
echo esc_html($project->source_url_template);
?>
" name="project[source_url_template]" id="project[source_url_template]" style="width: 30em;" />
		<span class="ternary"><?php 
_e('Public URL to a source file in the project. You can use <code>%file%</code> and <code>%line%</code>. Ex. <code>https://trac.example.org/browser/%file%#L%line%</code>');
?>
</span>
	</dd>

	<dt><label for="project[parent_project_id]"><?php 
_e('Parent Project');
?>
</label></dt>
	<dd><?php 
echo gp_projects_dropdown('project[parent_project_id]', $project->parent_project_id);
?>
</dd>

	<dt><label for="project[active]"><?php 
_e('Active');
?>
</label> <input type="checkbox" id="project[active]" name="project[active]" <?php 
gp_checked($project->active);
?>
 /></dt>
</dl>

<?php 
echo gp_js_focus_on('project[name]');
<p><?php 
_e('Here you can mass-create translation sets in this project.
The list of translation sets will be mirrored with the sets of a project you choose.
Usually this is one of the parent projects.', 'glotpress');
?>
</p>
<form action="<?php 
echo esc_url(gp_url_current());
?>
" method="post">
	<dl>
		<dt><label for="project_id"><?php 
_e('Project to take translation sets from:', 'glotpress');
?>
</label></dt>
		<dd><?php 
echo gp_projects_dropdown('project_id', null);
?>
</dd>
	</dl>
	<div id="preview"></div>
	<p><input type="submit" name="submit" value="<?php 
esc_attr_e('Create Translation Sets', 'glotpress');
?>
" id="submit" /></p>
	<?php 
gp_route_nonce_field('mass-create-transation-sets_' . $project->id);
?>
</form>
<?php 
gp_tmpl_footer();
		Usually this is one of the parent projects.');
?>
</p>

		<form action="<?php 
echo esc_url(gp_url_current());
?>
" method="post" class="form-left form-horizontal" role="form">
			<div class="form-group">
				<label for="project_id" class="col-sm-4 col-md-3 control-label"><?php 
_e('Project to take translation sets from:');
?>
</label>
				<div class="col-sm-4">
					<?php 
echo gp_projects_dropdown('project_id', null, array('class' => 'form-control'));
?>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-offset-4 col-md-offset-3 col-sm-8">
					<div id="preview"></div>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-offset-4 col-md-offset-3 col-sm-8">
					<input type="submit" name="submit" value="<?php 
echo esc_attr(__('Create Translation Sets'));
?>
				<div class="col-sm-4">
					<input type="text" id="set[slug]" class="form-control" name="set[slug]" value="<?php 
echo esc_html($set->slug ? $set->slug : 'default');
?>
" />
				</div>
			</div>

			<div class="form-group">
				<label for="set[project_id]" class="col-sm-4 col-md-3 control-label"><?php 
_e('Project');
?>
</label>
				<div class="col-sm-4">
					<?php 
echo gp_projects_dropdown('set[project_id]', $set->project_id, array('class' => 'form-control'));
?>
				</div>
			</div>

			<?php 
echo gp_js_focus_on('set[locale]');
?>

			<script type="text/javascript">
				jQuery(function($){
					$('#copy').click(function() {
						$('#set\\[name\\]').val($('#set\\[locale\\] option:selected').html().replace(/^\S+\s+\S+\s+/, '').replace(/&mdash|—/, ''));
						return false;
					});
				});
" />
						<small><?php 
_e('Public URL to a source file in the project. You can use <code>%file%</code> and <code>%line%</code>. Ex. <code>https://trac.example.org/browser/%file%#L%line%</code>');
?>
</small>
					</div>
				</div>

				<div class="form-group">
					<label for="project[parent_project_id]" class="col-sm-4 col-md-3 control-label"><?php 
_e('Parent Project');
?>
</label>
					<div class="col-sm-4">
						<?php 
echo gp_projects_dropdown('project[parent_project_id]', $project->parent_project_id, array('class' => 'form-control'));
?>
					</div>
				</div>

				<div class="form-group">
					<label for="project[active]" class="col-sm-4 col-md-3 control-label"><?php 
_e('Active');
?>
</label>
					<div class="col-sm-4">
						<input type="checkbox" id="project[active]" name="project[active]" <?php 
gp_checked($project->active);
?>
 />
					</div>
	<!-- TODO: make slug edit WordPress style -->
	<dt><label for="set[slug]"><?php 
_e('Slug', 'glotpress');
?>
</label></dt>
	<dd><input type="text" name="set[slug]" value="<?php 
echo esc_html($set->slug ? $set->slug : 'default');
?>
" id="set[slug]"></dd>

	<dt><label for="set[project_id]"><?php 
_e('Project', 'glotpress');
?>
</label></dt>
	<dd><?php 
echo gp_projects_dropdown('set[project_id]', $set->project_id, null, null, true);
?>
</dd>
</dl>
<?php 
echo gp_js_focus_on('set[locale]') . "\n";
?>
<script type="text/javascript">
	jQuery('#copy').click(function() {
		var text = jQuery('#set\\[locale\\] option:selected').html().replace(/^\S+\s+\S+\s+/, '').replace(/&mdash|—/, '');
		jQuery('#set\\[name\\]').val(text);
		return false;
	});
</script>