Skip to content
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

Multiple small quality of life fixes #630

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions apps/accounts/admin_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ class GreenWebAdmin(AdminSite):
# This is a standard authentication form that allows non-staff users
login_form = AuthenticationForm
index_template = "admin_index.html"
site_header = "The Green Web Foundation Administration Site"
index_title = "The Green Web Foundation Administration Site"
site_header = "Green Web Foundation Administration Site"
index_title = "Green Web Foundation Administration Site"
login_template = "auth/login.html"
logout_template = "auth/logout.html"

Expand Down
13 changes: 7 additions & 6 deletions apps/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,31 +225,32 @@ class OrgDetailsForm(forms.ModelForm):
)
website = forms.URLField(
max_length=255,
label="What is your primary website?",
label="What is your organisation's primary website?",
help_text="Add the full URL - please include the https:// part.",
)
description = forms.CharField(
label="How do you describe this organisation?",
label="How do you describe your organisation?",
help_text=(
"Add a single paragraph about your organisation, as you would expect to see"
" in search results."
),
widget=forms.widgets.Textarea,
max_length=1000,
)
authorised_by_org = forms.TypedChoiceField(
label="Do you work for this organisation?",
label="Do you work for the organisation seeking verification?",
help_text=(
"We ask this so we know whether you are speaking on behalf of the"
" organisation or not. It's still ok to submit info if you don't work for"
" organisation seeking verification or not. It's still ok to submit info if you don't work for"
" them, but we need to know, so we don't misrepresent anything."
),
widget=forms.RadioSelect,
choices=(
(
"True",
(
"Yes, I work for the organisation and am authorised to speak on"
" behalf of it"
"Yes, I work for the organisation seeking verification. I am authorised to speak on"
" its behalf."
),
),
(
Expand Down
4 changes: 2 additions & 2 deletions apps/accounts/migrations/0025_add_template_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def add_template_messages(apps, schema_editor):
Thanks for your help in keeping the Green Web Directory up-to-date! We’re experiencing significant growth in the number of checks against the database, currently over 7 million per day and counting, so it does make sense!

With best regards,
The Green Web Foundation Support Team
Green Web Foundation Support Team

[1]: https://www.thegreenwebfoundation.org
[2]: https://admin.thegreenwebfoundation.org
Expand All @@ -48,7 +48,7 @@ def add_template_messages(apps, schema_editor):
Thanks for your help in keeping the Green Web Directory up-to-date! We’re experiencing significant growth in the number of checks against the database, currently over 7 million per day and counting, so it does make sense!

With best regards,
The Green Web Foundation Support Team
Green Web Foundation Support Team

[1] https://www.thegreenwebfoundation.org/

Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/templates/auth/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1 class="text-6xl uppercase text-center pb-4">Log in</h1>
</article>

<div class="hidden md:flex justify-center">
<img width="350px" height="380px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}" alt="The Green Web Foundation logo"/>
<img width="350px" height="380px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}" alt="Green Web Foundation logo"/>
</div>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/templates/auth/password_change.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h1 class="text-6xl uppercase text-center pb-4">Password change</h1>

<div class="hidden md:flex justify-center">
<img width="350px" height="380px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}"
alt="The Green Web Foundation logo" />
alt="Green Web Foundation logo" />
</div>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/templates/auth/password_reset.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1 class="text-6xl uppercase text-center pb-4">Password reset</h1>

<div class="hidden md:flex justify-center">
<img width="350px" height="380px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}"
alt="The Green Web Foundation logo" />
alt="Green Web Foundation logo" />
</div>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/templates/auth/password_reset_confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1 class="text-6xl uppercase text-center pb-4">Password reset</h1>
</article>

<div class="hidden md:flex justify-center">
<img width="350px" height="380px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}" alt="The Green Web Foundation logo"/>
<img width="350px" height="380px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}" alt="Green Web Foundation logo"/>
</div>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/templates/auth/registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="lg:grid grid-cols-2 grid-rows-1 gap-20 height-full">

<div class="hidden lg:flex justify-center">
<img width="350px" height="380px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}" alt="The Green Web Foundation logo"/>
<img width="350px" height="380px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}" alt="Green Web Foundation logo"/>
</div>

<article class="mx-auto w-full lg:min-w-[500px] bg-white border-2 border-dark-gray rounded-3xl h-100-l p-8">
Expand Down
4 changes: 2 additions & 2 deletions apps/accounts/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>

<title>The Green Web Foundation</title>
<title>Green Web Foundation</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
Expand Down Expand Up @@ -57,7 +57,7 @@

<div class="logo">
<a href="{% url 'provider_portal_home' %}">
<img width="200px" height="48px" src="{% static 'img/TGWF-logo.svg' %}" alt="The Green Web Foundation logo"/>
<img width="200px" height="48px" src="{% static 'img/TGWF-logo.svg' %}" alt="Green Web Foundation logo"/>
</a>
</div>

Expand Down
8 changes: 4 additions & 4 deletions apps/accounts/templates/carbon_txt_preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n static %}

{% block title %}
The Green Web Foundation Member portal: Carbon text preview
Green Web Foundation Member portal: Carbon text preview
{% endblock %}


Expand Down Expand Up @@ -91,11 +91,11 @@ <h2>Upstream providers</h2>

{% if preview.upstream %}
<p>
We were able to find the following upstream providers in the green web database
We were able to find the following upstream providers in the Green Web Dataset
</p>
{% else %}
<p>
Sorry, we could not find any of the named upstream providers in the green web database.
Sorry, we could not find any of the named upstream providers in the Green Web Dataset.
</p>
{% endif %}

Expand All @@ -117,7 +117,7 @@ <h3>{{domain}} :

{% if preview.not_registered.providers %}

<p>The following upstream providers are not currently registered in the green web database:</p>
<p>The following upstream providers are not currently registered in the Green Web Dataset:</p>

<ul>
{% for domain, provider in preview.not_registered.providers.items %}
Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/templates/emails/additional-info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ Is it possible to refer us to a valid certificate awarded to yourself or the com
Thanks for your help in keeping the Green Web Directory up-to-date! We’re experiencing significant growth in the number of checks against the database, currently over 7 million per day and counting, so it does make sense!

With best regards,
The Green Web Foundation Support Team
Green Web Foundation Support Team

[1] https://www.thegreenwebfoundation.org/
4 changes: 2 additions & 2 deletions apps/accounts/templates/emails/migration_email.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Dear member of The Green Web Foundation,
Dear member of Green Web Foundation,

Copy link
Member

Choose a reason for hiding this comment

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

would you mind using the lower case the here instead removing it @fershad ? I think it reads funny, as there's only one Green Web Foundation. I've expanded on this here, and referenced it in the controlled vocabulary:

https://docs.google.com/document/d/1ag3WJ01saMP0NO1-WHD0xq0DpC9koTzVnH3I8OUUWU8/edit?tab=t.0#heading=h.ctxl9icrf6iv

Thank you for the contributions that you've made in the past to our hosting database. We are contacting you now because we need you to do something to be able to access the database in the future. After eight years of good service, the administration system behind our database needed an upgrade. The good news is that the upgrade succeeded. However, due to a new password hashing algorithm, we are obliged to ask all members to reset their password.

Expand All @@ -8,4 +8,4 @@ Feel free to contact us at [email protected] at any time if you

Thanks in advance for your help!
With best regards,
The Green Web Foundation team
Green Web Foundation team
2 changes: 1 addition & 1 deletion apps/accounts/templates/emails/pending-removal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For now, we have placed {{ host.name }} on the list of green hosters that need t
Thanks for your help in keeping the Green Web Directory up-to-date! We’re experiencing significant growth in the number of checks against the database, currently over 7 million per day and counting, so it does make sense!

With best regards,
The Green Web Foundation Support Team
Green Web Foundation Support Team

[1] https://www.thegreenwebfoundation.org/
[2] https://admin.thegreenwebfoundation.org/
2 changes: 1 addition & 1 deletion apps/accounts/templates/import_ip_ranges.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n static %}

{% block title %}
The Green Web Foundation Member portal: import ip ranges {{ domain }}
Green Web Foundation Member portal: import ip ranges {{ domain }}
{% endblock %}


Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/templates/provider_portal/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ <h3 class="text-2xl border-b-2 mt-2 pb-3">How can I get verified? </h3>

<section class="prose border-2 rounded-xl p-6 bg-black text-white">
<div class="border-b-2 border-white pb-3 flex items-center">
<img class="inline border-r-2 border-green my-0 pr-4" width="60px" height="60px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}" alt="The Green Web Foundation logo"/>
<img class="inline border-r-2 border-green my-0 pr-4" width="60px" height="60px" src="{% static 'img/GWF-icon-sunburst--green.svg' %}" alt="Green Web Foundation logo"/>
<h3 class="text-2xl inline text-white my-0 ml-4 p-0">Support the mission</h3>
</div>
<p>Green Web Foundation is on a mission to accelerate the transition to a fossil-free internet by 2030.</p>
Expand Down
13 changes: 13 additions & 0 deletions apps/accounts/templates/provider_registration/evidence.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,16 @@ <h1>Submit your evidence</h1>

</form>
{% endblock %}


<script>
// A workaround to limit the file input types to PDF and images.
function limitFileInputType() {
const fileInputs = document.querySelectorAll('input[type="file"]');
fileInputs.forEach((fileInput) => {
fileInput.accept = 'application/pdf, image/*';
});
}

window.addEventListener('load', limitFileInputType);
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% endblock %}

{% block "title" %}
<title>The Green Web Foundation - Verification Request - Network Footprint</title>
<title>Green Web Foundation - Verification Request - Network Footprint</title>
{% endblock %}


Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/templates/try_out.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n static %}

{% block title %}
The Green Web Foundation Member portal: check result for {{ domain }}
Green Web Foundation Member portal: check result for {{ domain }}
{% endblock %}


Expand Down
13 changes: 6 additions & 7 deletions apps/greencheck/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The Green Web Foundation Public APIs
# Green Web Foundation Public APIs

Since 2006, we have been building the world’s largest database tracking which parts of the internet run on renewable power, and when they switched. That's a lot of data, and we believe strongly in making it freely available for use in projects, reporting, and academic research. To make this possible, we have created a set of public APIs.

Expand All @@ -8,7 +8,7 @@ In this document, you will find:

- [List of available APIs](#available-apis)
- [Links to API documentation](#api-documentation)
- [Source code for The Green Web Foundation's public APIs](#source-code)
- [Source code for the Green Web Foundation's public APIs](#source-code)
- [Links to the data behind the APIs](#green-domains-dataset)

## Available APIs
Expand All @@ -17,17 +17,17 @@ We make available the following public APIs:

- **IP to CO2 Intensity**: Query a public IP address, and receive information about that IPs location (country) as well as annual average grid intensity data.
- **Greencheck**: Query a website domain, and receive information whether that site is hosted on a certified green web host.
- **Directory**: Query The Green Web Foundation's database of certified green hosting providers.
- **Directory**: Query the Green Web Foundation's Dataset of certified green hosting providers.
- **IP Range**: Query the known IP ranges and their associated providers.
- **AS Network**: Query the known AS Networks and their associated providers.

## API documentation

All API endpoints are documented using the Open API specification at https://api.thegreenwebfoundation.org/api-docs/
All API endpoints are documented using the Open API specification at <https://api.thegreenwebfoundation.org/api-docs/>

### New documentation portal

We are gradually moving all documentation for our developer-facing code and APIs to https://developers.thegreenwebfoundation.org/. This website provides a more approachable, user friendly experience for people new to our open-source tooling.
We are gradually moving all documentation for our developer-facing code and APIs to <https://developers.thegreenwebfoundation.org/>. This website provides a more approachable, user friendly experience for people new to our open-source tooling.

Currently the following APIs are documented there:

Expand All @@ -44,5 +44,4 @@ Views (endpoint routes) are all declared in [/api/views.py](/apps/greencheck/api

The Green Domains Dataset powers the Greencheck API. It is a browseable daily snapshot all the green domains tracked in the Green Web Foundation database, along with who they are hosted by, and when they were last updated. You can also download a snapshot or full dump of the data should you need to.

https://datasets.thegreenwebfoundation.org/

<https://datasets.thegreenwebfoundation.org/>
2 changes: 1 addition & 1 deletion apps/greencheck/carbon_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CarbonTxtParser:
"""
A parser for reading carbon.txt files and turning them into domain objects
we can use for updating information about provider organisations in
the green web database.
the Green Web Dataset.
"""

def _create_provider(self, provider_dict: dict, provider_set: Set) -> List:
Expand Down
2 changes: 1 addition & 1 deletion apps/greencheck/swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

schema_view = get_schema_view(
openapi.Info(
title="Welcome to The Green Web Foundation Partner API ",
title="Welcome to Green Web Foundation Partner API ",
Copy link
Member

Choose a reason for hiding this comment

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

Same here as above. Can we please keep the lower case 'the' here, like we do in other places where we refer to the Green Web Foundation in the middle of a sentence?

description=(
"Use this API to update information about the digital "
"infrastructure you are using, services you provide to "
Expand Down
Loading
Loading