-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a dashboard to track repos with multiple projects #2372
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to know whether a repo has github outputs here? Does it change anything about the data tidying process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, but we store it in the database so I figured hey why not!