<h3>${_('Parent')}</h3>
${h.form(url('edit_repo_advanced_fork', repo_name=c.repo_info.repo_name))}
<div class="form">
       ${h.select('id_fork_of','',c.repos_list)}
       ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('Set'),class_="btn btn-default btn-sm")}
       <div class="text-muted">
       ${_('''Manually set this repository as a fork of another from the list.''')}
       </div>
</div>
${h.end_form()}

<script>
    'use strict';
    $(document).ready(function(){
        $("#id_fork_of").select2({
            'dropdownAutoWidth': true
        });
    });
</script>

<h3>${_('Public Journal Visibility')}</h3>
${h.form(url('edit_repo_advanced_journal', repo_name=c.repo_info.repo_name))}
<div class="form">
  <div>
  %if c.in_public_journal:
    <button class="btn btn-default btn-sm" type="submit">
        <i class="icon-minus"></i>
        ${_('Remove from public journal')}
    </button>
  %else:
    <button class="btn btn-default btn-sm" type="submit">
        <i class="icon-plus"></i>
        ${_('Add to Public Journal')}
    </button>
  %endif
  </div>
 <div class="text-muted">
 ${_('All actions done in this repository will be visible to everyone in the public journal.')}
 </div>
</div>
${h.end_form()}

<h3>${_('Delete')}</h3>
${h.form(url('delete_repo', repo_name=c.repo_name))}
<div class="form">
    <button class="btn btn-danger btn-sm" type="submit"
            onclick="return confirm('${_('Confirm to delete this repository: %s') % c.repo_name}');">
        <i class="icon-trashcan"></i>
        ${_('Delete this Repository')}
    </button>
    %if c.repo_info.forks.count():
        ${ungettext('This repository has %s fork', 'This repository has %s forks', c.repo_info.forks.count()) % c.repo_info.forks.count()}
        <label>
            <input type="radio" name="forks" value="detach_forks" checked="checked"/>
            ${_('Detach forks')}
        </label>
        <label>
            <input type="radio" name="forks" value="delete_forks" />
            ${_('Delete forks')}
        </label>
    %endif
    <div class="text-muted">
        ${_('The deleted repository will be moved away and hidden until the administrator expires it. The administrator can both permanently delete it or restore it.')}
    </div>
</div>
${h.end_form()}
