atr/templates/phase-view.html (130 lines of code) (raw):

{% extends "layouts/base.html" %} {% block title %} Files in {{ release.short_display_name }} ~ ATR {% endblock title %} {% block description %} View the files in the {{ release.short_display_name }} release. {% endblock description %} {% block content %} <p class="d-flex justify-content-between align-items-center"> {# TODO: Use mappings.py #} {% if phase_key == "draft" %} <a href="{{ as_url(routes.compose.selected, project_name=release.project.name, version_name=release.version) }}" class="atr-back-link">← Back to Compose {{ release.short_display_name }}</a> <span> <strong class="atr-phase-one atr-phase-symbol">①</strong> <span class="atr-phase-one atr-phase-label">COMPOSE</span> <span class="atr-phase-arrow">→</span> <span class="atr-phase-symbol-other">②</span> <span class="atr-phase-arrow">→</span> <span class="atr-phase-symbol-other">③</span> </span> {% elif phase_key == "candidate" %} <a href="{{ as_url(routes.vote.selected, project_name=release.project.name, version_name=release.version) }}" class="atr-back-link">← Back to Vote for {{ release.short_display_name }}</a> <span> <span class="atr-phase-symbol-other">①</span> <span class="atr-phase-arrow">→</span> <strong class="atr-phase-two atr-phase-symbol">②</strong> <span class="atr-phase-two atr-phase-label">VOTE</span> <span class="atr-phase-arrow">→</span> <span class="atr-phase-symbol-other">③</span> </span> {% elif phase_key == "preview" %} <a href="{{ as_url(routes.finish.selected, project_name=release.project.name, version_name=release.version) }}" class="atr-back-link">← Back to Finish {{ release.short_display_name }}</a> <span> <span class="atr-phase-symbol-other">①</span> <span class="atr-phase-arrow">→</span> <span class="atr-phase-symbol-other">②</span> <span class="atr-phase-arrow">→</span> <strong class="atr-phase-three atr-phase-symbol">③</strong> <span class="atr-phase-three atr-phase-label">FINISH</span> </span> {% else %} <a href="{{ as_url(routes.release.releases) }}" class="atr-back-link">← Back to Releases</a> {% endif %} </p> <h1> Files in <strong>{{ release.project.short_display_name }}</strong> <em>{{ release.version }}</em> </h1> <div class="card mb-4"> <div class="card-header d-flex justify-content-between align-items-center"> <h5 class="mb-0">Release information</h5> </div> <div class="card-body"> <div class="row"> <div class="col-md-6"> <p> <strong>Project:</strong> {{ release.project.display_name }} </p> <p> <strong>Label:</strong> {{ release.name }} </p> </div> <div class="col-md-6"> <p> <strong>Created:</strong> {{ release.created.strftime("%Y-%m-%d %H:%M:%S") }} </p> </div> </div> </div> </div> <div class="card mb-4"> <div class="card-header d-flex justify-content-between align-items-center"> <h5 class="mb-0">Files</h5> </div> <div class="card-body"> {% if file_stats|length > 0 %} <div class="table-responsive"> <table class="table table-striped table-hover"> <thead> <tr> <th>Permissions</th> <th>File path</th> <th>Size</th> <th>Modified</th> </tr> </thead> <tbody> {% for stat in file_stats %} <tr> <td>{{ format_permissions(stat.permissions) }}</td> <td> {% if stat.is_file %} {% if phase_key == "draft" %} {% set file_url = as_url(routes.file.selected_path, project_name=release.project.name, version_name=release.version, file_path=stat.path) %} {% elif phase_key == "candidate" %} {% set file_url = as_url(routes.candidate.view_path, project_name=release.project.name, version_name=release.version, file_path=stat.path) %} {% elif phase_key == "preview" %} {% set file_url = as_url(routes.preview.view_path, project_name=release.project.name, version_name=release.version, file_path=stat.path) %} {% elif phase_key == "release" %} {% set file_url = as_url(routes.release.view_path, project_name=release.project.name, version_name=release.version, file_path=stat.path) %} {% else %} {# TODO: Should probably disable the link here #} {% set file_url = "#" %} {% endif %} <a href="{{ file_url }}">{{ stat.path }}</a> {% else %} <strong>{{ stat.path }}/</strong> {% endif %} </td> <td> {% if stat.is_file %} {{ format_file_size(stat.size) }} {% else %} - {% endif %} </td> <td>{{ format_datetime(stat.modified) }}</td> </tr> {% endfor %} </tbody> </table> </div> {% else %} <div class="alert alert-info">This {{ phase }} does not have any files.</div> {% endif %} </div> </div> {% endblock content %}