| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | @include 'layout/head.html' |
| 5 | </head> |
| 6 | <body> |
| 7 | @include 'layout/header.html' |
| 8 | |
| 9 | <div class="content"> |
| 10 | <div class="new-repo"> |
| 11 | <div class="new-repo__header"> |
| 12 | <h1>%new_repo_title</h1> |
| 13 | </div> |
| 14 | |
| 15 | @if ctx.form_error != '' |
| 16 | <div class='form-error'>@ctx.form_error</div> |
| 17 | @end |
| 18 | |
| 19 | <form class="new-repo__form" method='post'> |
| 20 | <div class="new-repo__owner-row"> |
| 21 | <div class="new-repo__field new-repo__field--owner"> |
| 22 | <label class="new-repo__label" for="owner">%new_repo_owner <span class="new-repo__req">*</span></label> |
| 23 | <select id="owner" class="new-repo__owner-select" name="owner"> |
| 24 | @if selected_owner == ctx.user.username |
| 25 | <option value="@ctx.user.username" selected>@ctx.user.username</option> |
| 26 | @else |
| 27 | <option value="@ctx.user.username">@ctx.user.username</option> |
| 28 | @end |
| 29 | @for org in orgs |
| 30 | @if selected_owner == org.name |
| 31 | <option value="@org.name" selected>@org.name</option> |
| 32 | @else |
| 33 | <option value="@org.name">@org.name</option> |
| 34 | @end |
| 35 | @end |
| 36 | </select> |
| 37 | </div> |
| 38 | <div class="new-repo__owner-slash">/</div> |
| 39 | <div class="new-repo__field new-repo__field--name"> |
| 40 | <label class="new-repo__label" for="name">%new_repo_name <span class="new-repo__req">*</span></label> |
| 41 | <input class="new-repo__name-input new-repo__name-input--standalone" id="name" type='text' name='name' required autofocus maxlength=@max_repo_name_len placeholder="my-awesome-project"> |
| 42 | </div> |
| 43 | </div> |
| 44 | |
| 45 | <div class="new-repo__field"> |
| 46 | <label class="new-repo__label" for="description">%new_repo_description <span class="new-repo__optional">%new_repo_optional</span></label> |
| 47 | <input id="description" type='text' name='description'> |
| 48 | </div> |
| 49 | |
| 50 | <div class="new-repo__field"> |
| 51 | <label class="new-repo__label" for="clone_url">%new_repo_clone_url <span class="new-repo__optional">%new_repo_clone_hint</span></label> |
| 52 | <input id='clone_url' type='text' name='clone_url' placeholder='https://github.com/vlang/gitly'> |
| 53 | </div> |
| 54 | |
| 55 | <div class='new-repo__field new-repo__field--inline' id='import_issues_field' style='display:none'> |
| 56 | <label class="new-repo__checkbox"> |
| 57 | <input type='checkbox' name='import_issues' value='1'> |
| 58 | <span>%new_repo_import_issues</span> |
| 59 | </label> |
| 60 | </div> |
| 61 | |
| 62 | <div class="new-repo__field"> |
| 63 | <p class="new-repo__label">%new_repo_visibility</p> |
| 64 | <label class="new-repo__option"> |
| 65 | <input type="radio" name="repo_visibility" value="public" checked> |
| 66 | <span class="new-repo__option-body"> |
| 67 | <span class="new-repo__option-title">%new_repo_public</span> |
| 68 | <span class="new-repo__option-desc">%new_repo_public_desc</span> |
| 69 | </span> |
| 70 | </label> |
| 71 | <label class="new-repo__option"> |
| 72 | <input type="radio" name="repo_visibility" value="private"> |
| 73 | <span class="new-repo__option-body"> |
| 74 | <span class="new-repo__option-title">%new_repo_private</span> |
| 75 | <span class="new-repo__option-desc">%new_repo_private_desc</span> |
| 76 | </span> |
| 77 | </label> |
| 78 | </div> |
| 79 | |
| 80 | <div class="new-repo__actions"> |
| 81 | <input type='submit' class='new-repo__submit' value='%new_repo_create'> |
| 82 | </div> |
| 83 | </form> |
| 84 | </div> |
| 85 | </div> |
| 86 | |
| 87 | <script> |
| 88 | (function() { |
| 89 | var input = document.getElementById('clone_url'); |
| 90 | var field = document.getElementById('import_issues_field'); |
| 91 | function toggle() { |
| 92 | field.style.display = input.value.toLowerCase().includes('github.com') ? '' : 'none'; |
| 93 | } |
| 94 | input.addEventListener('input', toggle); |
| 95 | toggle(); |
| 96 | })(); |
| 97 | </script> |
| 98 | |
| 99 | @js '/js/block-form.js' |
| 100 | @include 'layout/footer.html' |
| 101 | </body> |
| 102 | </html> |
| 103 | |