-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2372 from opensafely-core/repos-multiple-projects
Add a dashboard to track repos with multiple projects
- Loading branch information
Showing
6 changed files
with
257 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* global $ */ | ||
$(() => { | ||
$("table").tablesorter({ | ||
theme: "bootstrap", | ||
widthFixed: true, | ||
sortReset: true, | ||
widgets: ["filter", "columns"], | ||
headers: { | ||
0: { sortInitialOrder: "desc" }, | ||
}, | ||
widgetOptions: { | ||
columns: ["table-info"], | ||
filter_reset: ".reset", | ||
filter_cssFilter: [ | ||
"form-control", | ||
"form-control", | ||
"form-control", | ||
"form-control", | ||
], | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
templates/staff/dashboards/repos_with_multiple_projects.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{% extends "staff/base.html" %} | ||
|
||
{% load static %} | ||
|
||
{% block metatitle %}Repos with Multiple Projects: Staff Area | OpenSAFELY Jobs{% endblock metatitle %} | ||
|
||
{% block breadcrumbs %} | ||
<nav class="breadcrumb-container breadcrumb--danger" aria-label="breadcrumb"> | ||
<div class="container"> | ||
<ol class="breadcrumb rounded-0 mb-0 px-0"> | ||
<li class="breadcrumb-item"> | ||
<a href="{% url 'staff:index' %}">Staff area</a> | ||
</li> | ||
<li class="breadcrumb-item"> | ||
<a href="{% url 'staff:dashboards:index' %}">Dashboards</a> | ||
</li> | ||
<li class="breadcrumb-item active" aria-current="page"> | ||
Repos with multiple projects | ||
</li> | ||
</ol> | ||
</div> | ||
</nav> | ||
{% endblock breadcrumbs %} | ||
|
||
{% block jumbotron %} | ||
<div class="jumbotron jumbotron-fluid jumbotron--danger pt-md-2"> | ||
<div class="container"> | ||
<h1 class="display-4">Repos with multiple projects</h1> | ||
<p class="lead"> | ||
Repos with multiple projects on OpenSAFELY | ||
</p> | ||
|
||
<p>Remaining: {{ repos|length }}</p> | ||
</div> | ||
</div> | ||
{% endblock jumbotron %} | ||
|
||
{% block staff_content %} | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col"> | ||
<button type="button" class="reset btn btn-outline-primary mb-3" data-column="0" data-filter="">Reset filters</button> | ||
<div class="table-responsive"> | ||
<table class="table table-striped table-sm table--repo"> | ||
<thead> | ||
<tr> | ||
<th>Repo</th> | ||
<th>Projects</th> | ||
<th>Workspaces</th> | ||
<th class="text-nowrap">Files released to GitHub</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for repo in repos %} | ||
<tr> | ||
<td><a href="{% url 'staff:repo-detail' repo_url=repo.quoted_url %}">{{ repo.name }}</a></td> | ||
|
||
<td> | ||
<details> | ||
<summary> | ||
<span class="summary--show">Show</span> | ||
<span class="summary--hide">Hide</span> | ||
{{ repo.projects|length }} projects | ||
</summary> | ||
<ul class="mt-1 mb-0 pl-2 ml-2"> | ||
{% for project in repo.projects %} | ||
<li><a href="{{ project.get_staff_url }}">{{ project.name }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</details> | ||
</td> | ||
|
||
<td> | ||
{% if repo.workspaces|length > 1 %} | ||
<details> | ||
<summary> | ||
<span class="summary--show">Show</span> | ||
<span class="summary--hide">Hide</span> | ||
{{ repo.workspaces|length }} workspaces | ||
</summary> | ||
<ul class="mt-1 mb-0 pl-2 ml-2"> | ||
{% for workspace in repo.workspaces %} | ||
<li> | ||
<a href="{{ workspace.get_staff_url }}"> | ||
{{ workspace.name }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</details> | ||
{% else %} | ||
{% for workspace in repo.workspaces %} | ||
<a href="{{ workspace.get_staff_url }}"> | ||
{{ workspace.name }} | ||
</a> | ||
{% endfor %} | ||
{% endif %} | ||
</td> | ||
|
||
{% if repo.has_github_outputs %} | ||
<td class="text-center text-danger font-weight-bold">YES</td> | ||
{% else %} | ||
<td class="text-center text-success">No</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock staff_content %} | ||
|
||
{% block extra_styles %} | ||
<link rel="stylesheet" href="{% static 'vendor/tablesorter/theme.bootstrap_4.min.css' %}"> | ||
{% endblock %} | ||
|
||
{% block extra_js %} | ||
<script src="{% static 'vendor/tablesorter/jquery.tablesorter.min.js' %}"></script> | ||
<script src="{% static 'vendor/tablesorter/jquery.tablesorter.widgets.min.js' %}"></script> | ||
<script src="{% static 'js/repos-with-multiple-projects-tablesorter.js' %}"></script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters