Skip to content

Fix small accessibility issues from #57 #58

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# django-postgres-metrics

[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/django-postgres-metrics/django-postgres-metrics/Test%20&%20Deploy/main?style=for-the-badge)](https://github.com/django-postgres-metrics/django-postgres-metrics/actions?query=branch%3Amain+event%3Apush)
[![Codecov branch](https://img.shields.io/codecov/c/gh/django-postgres-metrics/django-postgres-metrics/main?style=for-the-badge)](https://app.codecov.io/gh/django-postgres-metrics/django-postgres-metrics/branch/main)
[![GitHub Build Status](https://img.shields.io/github/workflow/status/django-postgres-metrics/django-postgres-metrics/Test%20&%20Deploy/main?style=for-the-badge)](https://github.com/django-postgres-metrics/django-postgres-metrics/actions?query=branch%3Amain+event%3Apush)
[![Codecov coverage](https://img.shields.io/codecov/c/gh/django-postgres-metrics/django-postgres-metrics/main?style=for-the-badge)](https://app.codecov.io/gh/django-postgres-metrics/django-postgres-metrics/branch/main)
[![Read the Docs](https://img.shields.io/readthedocs/django-postgres-metrics?style=for-the-badge)](https://django-postgres-metrics.readthedocs.io/)
[![Version](https://img.shields.io/pypi/v/django-postgres-metrics?label=Version&style=for-the-badge)](https://pypi.org/project/django-postgres-metrics/)
![License](https://img.shields.io/pypi/l/django-postgres-metrics?style=for-the-badge)
![Python Versions](https://img.shields.io/pypi/pyversions/django-postgres-metrics?label=Python&style=for-the-badge)
![Django Versions](https://img.shields.io/pypi/djversions/django-postgres-metrics?color=%230C4B33&label=Django&style=for-the-badge)
![License: BSD](https://img.shields.io/pypi/l/django-postgres-metrics?style=for-the-badge)
[![Python Versions: see setup.py](https://img.shields.io/pypi/pyversions/django-postgres-metrics?label=Python&style=for-the-badge)](https://github.com/django-postgres-metrics/django-postgres-metrics/blob/main/setup.py)
[![Django Versions: see setup.py](https://img.shields.io/pypi/djversions/django-postgres-metrics?color=%230C4B33&label=Django&style=for-the-badge)](https://github.com/django-postgres-metrics/django-postgres-metrics/blob/main/setup.py)

A Django application that exposes a bunch of PostgreSQL database metrics.

Expand Down Expand Up @@ -78,12 +78,12 @@ urlpatterns = [
```

This is what a metric could look like:
![Metric example](https://github.com/django-postgres-metrics/django-postgres-metrics/blob/main/docs/source/_static/screenshot.png)
![Screenshot of the Detailed Index Usage metric, with help text, and a table with rows for each index](https://github.com/django-postgres-metrics/django-postgres-metrics/blob/main/docs/source/_static/screenshot.png)

## Security

If you found or if you think you found a security issue please get in touch via
`info+django-postgres-metrics *AT* markusholtermann *DOT* eu`.
`info+django-postgres-metrics *at* markusholtermann *dot* eu`.

I'm working about this in my free time. I don't have time to monitor the email 24/7. But you
should normally receive a response within a week. If I haven't got back to you within
Expand Down
3 changes: 2 additions & 1 deletion docs/source/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ metrics.
This is what a metric could look like:

.. figure:: _static/screenshot.png
:alt: Metric example
:target: _static/screenshot.png
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note I didn’t test this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:alt: Screenshot of the Detailed Index Usage metric, with help text, and a table with rows for each index


Designing Your Own Metric
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Welcome to django-postgres-metrics's documentation!


Indices and tables
==================
------------------

* :ref:`genindex`
* :ref:`modindex`
Expand Down
2 changes: 1 addition & 1 deletion postgres_metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ class TableSize(Metric):
The "size of * fork" refers to the "main" data fork, the Free Space Map
(fsm), Visibility Map (vm), and the initialization fork.

See also the PostgreSQL documentation on on the physical storage:
See also the PostgreSQL documentation on the physical storage:
https://www.postgresql.org/docs/current/storage.html
"""

Expand Down
2 changes: 1 addition & 1 deletion postgres_metrics/templates/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{% url "postgres-metrics:show" name=metric.slug as metric_url %}
<tr>
<th scope="row"><a href="{{ metric_url }}" title="{{ metric.label }}">{{ metric.label }}</a></th>
<td><a href="{{ metric_url }}" class="viewlink" title="{{ metric.label }}">{% trans 'Show' %}</a></td>
<td><a href="{{ metric_url }}" class="viewlink" title="{{ metric.label }}" aria-label="{% trans 'Show' %} - {{ metric.label }}">{% trans 'Show' %}</a></td>
</tr>
{% endfor %}
</tbody>
Expand Down
5 changes: 2 additions & 3 deletions postgres_metrics/templates/postgres_metrics/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:index' %}#postgres-metrics">{% trans 'PostgreSQL Metrics' %}</a>
&rsaquo; {{ metric.label }}
&rsaquo; <span aria-current="page">{{ metric.label }}</span>
</div>
{% endblock %}

{% block coltype %}flex{% endblock %}

{% block content %}
<h1>{{ metric.label }}</h1>
<div id="content-main">
{% if metric.description %}
<div id="toolbar">
Expand All @@ -37,7 +36,7 @@ <h2>{% trans 'PostgreSQL Metrics' %}</h2>
{% for iter_metric in postgres_metrics %}
{% url "postgres-metrics:show" name=iter_metric.slug as metric_url %}
<li{% if metric.slug == iter_metric.slug %} class="selected"{% endif %}>
<a href="{{ metric_url }}" title="{{ iter_metric.label }}">{{ iter_metric.label }}</a>
<a href="{{ metric_url }}" title="{{ iter_metric.label }}" {% if metric.slug == iter_metric.slug %}aria-current="page"{% endif %}>{{ iter_metric.label }}</a>
</li>
{% endfor %}
</ul>
Expand Down
1 change: 1 addition & 0 deletions postgres_metrics/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def metrics_view(request, name):
request,
"postgres_metrics/table.html",
{
"title": metric.label,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably the most important of all of those fixes, making sure the page <title> is set correctly.

"metric": metric,
"results": metric.get_data(),
"opts": {"app_label": "postgres_metrics", "model_name": metric.slug},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_detail_view_sidebar(self):
)
self.assertInHTML(
'<li class="selected"><a href="/postgres-metrics/index-size/" '
'title="Index Size">Index Size</a></li>',
'title="Index Size" aria-current="page">Index Size</a></li>',
result.content.decode(),
)

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy