-
Notifications
You must be signed in to change notification settings - Fork 28
Add detailed public metrics view for published projects #2557
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
Merged
lukepayyapilli
merged 4 commits into
MIT-LCP:dev
from
lukepayyapilli:feature/project-metrics-detail
Jan 20, 2026
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c3d7275
Add detailed public metrics view for published projects
lukepayyapilli ffb8555
Address PR feedback: move view counting logic to PublishedProject model
lukepayyapilli cfe8a94
Move imports to top of file in publishedproject.py
lukepayyapilli 41e8926
Change views over time to count unique viewers per month
lukepayyapilli 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
83 changes: 83 additions & 0 deletions
83
physionet-django/project/templates/project/published_project_metrics.html
This file contains hidden or 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,83 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% load static %} | ||
|
|
||
| {% block title %} | ||
| Metrics for {{ project }} | ||
| {% endblock %} | ||
|
|
||
| {% block content %} | ||
| <div class="container"> | ||
| <h1>Metrics</h1> | ||
| <p class="text-muted">{{ project.title }} (v{{ project.version }})</p> | ||
| <hr> | ||
|
|
||
| <div class="row"> | ||
| <div class="col-md-6"> | ||
| <div class="card text-center mb-4"> | ||
| <h5 class="card-header">Project Views</h5> | ||
| <div class="card-body"> | ||
| <div class="d-flex justify-content-around mb-2"> | ||
| <div> | ||
| <h3 class="mb-0">{{ project_views_count }}</h3> | ||
| <small class="text-muted">Current Version</small> | ||
| </div> | ||
| <div> | ||
| <h3 class="mb-0">{{ all_versions_views_count }}</h3> | ||
| <small class="text-muted">All Versions</small> | ||
| </div> | ||
| </div> | ||
| <small class="text-muted"><em>Project Views by Unique Registered Users</em></small> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| {% if views_by_version|length > 1 %} | ||
| <h3>Views by Version</h3> | ||
| <div class="table-responsive mb-4"> | ||
| <table class="table table-bordered"> | ||
| <thead> | ||
| <tr> | ||
| <th>Version</th> | ||
| <th>Project Views</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| {% for item in views_by_version %} | ||
| <tr> | ||
| <td>{{ item.version }}</td> | ||
| <td>{{ item.count }}</td> | ||
| </tr> | ||
| {% endfor %} | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% if views_over_time %} | ||
| <h3>Views Over Time</h3> | ||
| <div class="table-responsive mb-4"> | ||
| <table class="table table-bordered"> | ||
| <thead> | ||
| <tr> | ||
| <th>Month</th> | ||
| <th>Unique Viewers</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| {% for item in views_over_time %} | ||
| <tr> | ||
| <td>{{ item.month|date:"F Y" }}</td> | ||
| <td>{{ item.count }}</td> | ||
| </tr> | ||
| {% endfor %} | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| <hr> | ||
| <p><a href="{% url 'published_project' project.slug project.version %}">Back to {{ project }}</a></p> | ||
| </div> | ||
| {% endblock %} |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.