Commit Graph

14 Commits

Author SHA1 Message Date
Katie Smith
0d842d3700 Pluralize notification type correctly on usage page
This change makes sure that we display '1 letter' instead of '1 letters',
and '1 text message' instead of '1 text messages' on the usage page.
2018-10-03 15:15:19 +01:00
Rebecca Law
e7f94bd007 Add a template to show letter usage if the service has the letter permission 2017-12-20 16:28:40 +00:00
Rebecca Law
b7db7debc5 Add letters to usage page.
Before this goes live need to only show letters on usage if the service has the permission.
2017-12-19 14:35:10 +00:00
Rebecca Law
43747bd1ea Add letter usage to usage page.
Still need to add the summary info.
2017-12-15 17:28:52 +00:00
Chris Hill-Scott
6445879a36 Fix heading level on all template stats page
It’s the heading for the whole page, should be a `<h1>`.
2017-02-23 16:32:26 +00:00
Chris Hill-Scott
3e89baf117 Mark up ‘pill’ component as being tabs
Currently it’s not possible for a screen reader user to know which
financial year they’re looking at. From the accessibility report:

> The financial year links are contained in a navigation region -
> tabbing or arrowing through only reads out the links, not the main
> information of "2016 to 2017 financial year" - that information is
> vital for understanding the page content.

This problem also applies to other pages which use the `pill` component,
which is effectively tabbed navigation (that reloads the page rather
than showing or hiding content on the page).

There are specific ARIA attributes that can be used to mark up a
navigation as being tabbed. This commit:

- adds those attributes
- makes the selected ‘tab’ visible to screenreaders and keyboard
  focusable
- adds a visual focus indicator to the selected tab
- adds `id`s to the parts of the page that are controlled by the tabs so
  that they are labelled as such

This also means changing the pill component from being a `<nav>` to a
`<ul>` because `tablist` is not a valid `role` for a `nav`.

Mostly follows the example here:
http://accessibility.athena-ict.com/aria/examples/tabpanel2.shtml
2017-02-14 15:18:37 +00:00
Chris Hill-Scott
135ff1ee77 Include service name in page <title>
In pages specific to a service (e.g. dashboard and sub pages) the title
needs to distinguish which service it applies to. This is mainly to give
context to screen reader users who could be managing multiple services.

Implementing this uses template inheritance:

`page_title` includes `per_page_title` includes `service_page_title`

‘GOV.UK Notify’ is inserted into every page title.

Pages that set `service_page_title` get the service name inserted too.
2017-02-14 11:53:53 +00:00
Chris Hill-Scott
2a502753a4 Filter and navigate usage by financial year
Right now we tell people that the usage page is for the current
financial year. This is a lie – it’s for all time.

So this commit calls through to the API to get the stats for (by
default) the current financial year.

We already do this for the monthly breakdown, this just does the same
thing for the yearly totals.

It also adds navigation to show the data for other financial years:
- previous so you can go back and see your usage and verify that the
  bill you’re about to pay is correct
- next so that you can check what your SMS allowance is going to be
  before you actually get into it
2017-02-06 12:25:48 +00:00
Chris Hill-Scott
acdbba694e Use ‘pence’ in full
This matches what we now do on the product page.

From the GOV.UK style guide:
> Write out pence in full: calls will cost 4 pence per minute from a landline.

– https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style#money
2016-12-19 12:40:37 +00:00
Chris Hill-Scott
b760457ba9 Add monthly breakdown of usage
Basically:
- shows all the months from start of given financial year to now or end
  of given financial year (whichever is earliest)
- shows a breakdown of free and paid text messages for each of these
  months

Depends on:
- [x] https://github.com/alphagov/notifications-api/pull/699
2016-10-05 16:11:19 +01:00
Leo Hemsted
aac3112274 mmg rates set to 1.65p
also moved a default parameter to a plain ol' local variable to reduce ambiguity about whether it is overriden by any callers (it's not)
2016-07-06 16:10:19 +01:00
Chris Hill-Scott
b5d5689d5c Make right-aligned big numbers left aligned 2016-05-05 11:01:34 +01:00
Chris Hill-Scott
71f7e144a4 Rename ‘this year’
Make it clear that this section is about what you’ve used, ie your usage

Click ‘breakdown’ to see how the maths is done, and what time period it
covers.
2016-05-03 12:25:01 +01:00
Chris Hill-Scott
00030bc254 Add usage to the dashboard
Takes the number of emails and SMS fragments sent from:
https://github.com/alphagov/notifications-api/pull/273

Using these numbers it’s possible to show:
- how much of your allowance is left
- or how much you have spent

For now the allowance and rates are hard coded.

Only for users that have manage service.
2016-05-03 11:06:12 +01:00