| 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__field"> |
| 21 | <label class="new-repo__label" for="name">%new_repo_name <span class="new-repo__req">*</span></label> |
| 22 | <div class="new-repo__name-row"> |
| 23 | <span class="new-repo__owner">@app.config.hostname/@ctx.user.username/</span> |
| 24 | <input class="new-repo__name-input" id="name" type='text' name='name' required autofocus maxlength=@max_repo_name_len placeholder="my-awesome-project"> |
| 25 | </div> |
| 26 | </div> |
| 27 | |
| 28 | <div class="new-repo__field"> |
| 29 | <label class="new-repo__label" for="description">%new_repo_description <span class="new-repo__optional">%new_repo_optional</span></label> |
| 30 | <input id="description" type='text' name='description'> |
| 31 | </div> |
| 32 | |
| 33 | <div class="new-repo__field"> |
| 34 | <label class="new-repo__label" for="clone_url">%new_repo_clone_url <span class="new-repo__optional">%new_repo_clone_hint</span></label> |
| 35 | <input id='clone_url' type='text' name='clone_url' placeholder='https://github.com/vlang/gitly'> |
| 36 | </div> |
| 37 | |
| 38 | <div class='new-repo__field new-repo__field--inline' id='import_issues_field' style='display:none'> |
| 39 | <label class="new-repo__checkbox"> |
| 40 | <input type='checkbox' name='import_issues' value='1'> |
| 41 | <span>%new_repo_import_issues</span> |
| 42 | </label> |
| 43 | </div> |
| 44 | |
| 45 | <div class="new-repo__field"> |
| 46 | <p class="new-repo__label">%new_repo_visibility</p> |
| 47 | <label class="new-repo__option"> |
| 48 | <input type="radio" name="repo_visibility" value="public" checked> |
| 49 | <span class="new-repo__option-body"> |
| 50 | <span class="new-repo__option-title">%new_repo_public</span> |
| 51 | <span class="new-repo__option-desc">%new_repo_public_desc</span> |
| 52 | </span> |
| 53 | </label> |
| 54 | <label class="new-repo__option"> |
| 55 | <input type="radio" name="repo_visibility" value="private"> |
| 56 | <span class="new-repo__option-body"> |
| 57 | <span class="new-repo__option-title">%new_repo_private</span> |
| 58 | <span class="new-repo__option-desc">%new_repo_private_desc</span> |
| 59 | </span> |
| 60 | </label> |
| 61 | </div> |
| 62 | |
| 63 | <div class="new-repo__actions"> |
| 64 | <input type='submit' class='new-repo__submit' value='%new_repo_create'> |
| 65 | </div> |
| 66 | </form> |
| 67 | </div> |
| 68 | </div> |
| 69 | |
| 70 | <script> |
| 71 | (function() { |
| 72 | var input = document.getElementById('clone_url'); |
| 73 | var field = document.getElementById('import_issues_field'); |
| 74 | function toggle() { |
| 75 | field.style.display = input.value.toLowerCase().includes('github.com') ? '' : 'none'; |
| 76 | } |
| 77 | input.addEventListener('input', toggle); |
| 78 | toggle(); |
| 79 | })(); |
| 80 | </script> |
| 81 | |
| 82 | @js '/js/block-form.js' |
| 83 | @include 'layout/footer.html' |
| 84 | </body> |
| 85 | </html> |
| 86 | |