| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | @include 'layout/head.html' |
| 5 | @css '/css/ci.css' |
| 6 | </head> |
| 7 | <body> |
| 8 | @include 'layout/header.html' |
| 9 | |
| 10 | <div class="content"> |
| 11 | @include 'layout/repo_menu.html' |
| 12 | |
| 13 | <h1>CI / CD</h1> |
| 14 | |
| 15 | @if ci_service_error |
| 16 | <div class="ci-error"> |
| 17 | <b>CI service unavailable.</b> The CI service is not running or cannot be reached. |
| 18 | </div> |
| 19 | @end |
| 20 | |
| 21 | @if ci_runs.len == 0 |
| 22 | @if !ci_service_error |
| 23 | <div class="ci-empty"> |
| 24 | @if has_ci_file |
| 25 | <p>No CI runs yet. Push a commit to trigger a CI run.</p> |
| 26 | @else |
| 27 | <p>No CI runs yet. Add a <code>.gitly-ci.yml</code> file to your repository to enable CI.</p> |
| 28 | @if repo.user_id == ctx.user.id |
| 29 | <a class="ci-create-btn" href="/@repo.user_name/@repo.name/new-ci-file">Create .gitly-ci.yml</a> |
| 30 | @end |
| 31 | @end |
| 32 | </div> |
| 33 | @end |
| 34 | @else |
| 35 | <div class="ci-runs"> |
| 36 | <div class="ci-runs-header"> |
| 37 | <span class="ci-col-status">Status</span> |
| 38 | <span class="ci-col-branch">Branch</span> |
| 39 | <span class="ci-col-commit">Commit</span> |
| 40 | <span class="ci-col-time">Time</span> |
| 41 | </div> |
| 42 | @for ci_run in ci_runs |
| 43 | <a class="ci-run-row" href="/@repo.user_name/@repo.name/ci/@ci_run.ci_run_id"> |
| 44 | <span class="ci-col-status"> |
| 45 | <span class="ci-status-badge @{ci_run.status.css_class()}"> |
| 46 | @{ci_run.status.icon()} @{ci_run.status.str()} |
| 47 | </span> |
| 48 | </span> |
| 49 | <span class="ci-col-branch"> |
| 50 | @ci_run.branch |
| 51 | </span> |
| 52 | <span class="ci-col-commit"> |
| 53 | <code>@ci_run.commit_hash</code> |
| 54 | </span> |
| 55 | <span class="ci-col-time"> |
| 56 | @{ci_run.relative_time()} |
| 57 | </span> |
| 58 | </a> |
| 59 | @end |
| 60 | </div> |
| 61 | @end |
| 62 | </div> |
| 63 | |
| 64 | @include 'layout/footer.html' |
| 65 | </body> |
| 66 | </html> |
| 67 | |