Skip to content

Commit

Permalink
Merge pull request #529 from thegreenwebfoundation/hs-editing-provide…
Browse files Browse the repository at this point in the history
…r-front-end

Hs editing provider front end
  • Loading branch information
hanopcan committed Nov 7, 2023
2 parents 99f046e + 3cac34d commit 82f9dfd
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 42 deletions.
1 change: 1 addition & 0 deletions apps/accounts/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ <h1 class="text-5xl">Django + Tailwind = ❤️</h1>
<div class="container mx-auto px-2 sm:px-4 md:p-0 prose">
<div class="p-6 bg-white border-2 rounded-xl">
<h3 class="text-xl uppercase">Need help?</h3>
<p>Common questions and their answers - <a href="https://www.thegreenwebfoundation.org/support/" target="_blank" rel="noopener noreferrer">browse our FAQs</a>.</p>
<p>Our friendly support team are on hand to clarify anything you're not sure about.</p>
<p class="mt-4 mb-6"><a href="https://www.thegreenwebfoundation.org/support-form/" class="btn btn-white" target="_blank" rel="noopener noreferrer">Contact our support team</a></p>
{% comment %}
Expand Down
119 changes: 82 additions & 37 deletions apps/accounts/templates/provider_portal/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,106 @@

<article>
<div class="prose mx-auto mt-8">
<h1 class="text-center">Provider portal</h1>

<p>Do you want to become part of the Green Web Dataset as a verified green hosting provider?
Do you want to keep your submitted information up-to-date? Get started here.</p>
<h1 class="text-center leading-10">
<span class="text-xl">Welcome to our</span><br>
Provider portal</h1>

<p class="mt-8"><a href="{% url 'before-starting' %}" class="btn">Submit a new verification request</a></p>

{% if object_list.providers %}
<h3 class="text-xl pt-10">Your verified providers</h3>
{% if request.user.is_admin %}
<p>You belong to the admin group, which gives you permission to manage all providers in the database.
Below is a list of those providers for which a permission has been granted explicitly for you, rather than based on the group membership.
</p>
{% endif %}
<h2 class="border-0 my-3 pb-0">Providers overview</h2>

{% for provider in object_list.providers %}
<p>
<a href="{% url 'greenweb_admin:accounts_hostingprovider_change' provider.id %}">{{ provider }}</a>
</p>
{% if provider.request and provider.request.approved_at %}
<p>Last updated: {{ provider.request.approved_at }}</p>
{% endif %}
{% flag "edit_provider" %}
{% get_obj_perms request.user for provider as "provider_perms" %}
{% if "manage_provider" in provider_perms %}
<p>
<a href="{% url 'provider_edit' provider.id %}" class="btn btn-white" target="_blank" rel="noopener noreferrer">Update listing</a>
</p>
{% for request in object_list.requests %}
<h3 class="text-xl pt-8" id="pending">Pending verification</h3>

<a class="no-underline drop-shadow-lg hover:drop-shadow-none" href="{{ request.get_absolute_url }}">
<div class="verification_request">
{% if request.status|lower == "more info required" %}
<div class="alert__warning hover:bg-neutral-100">
{% endif %}

<p class="mb-0"><span class="verification_request__name text-black font-bold underline">{{ request.name }}</span> <span class="text-black">|</span> <b class="">{{ request.status | upper }}</b></p>
<p class="verification_request__date mt-0 text-neutral-500 text-sm">Submitted: {{ request.modified }}</p>

{% if request.status|lower == "more info required" %}
</div>
{% endif %}
{% endflag %}
</div>
</a>

{% empty %}

{% endfor %}

<h3 class="text-xl pt-10">Your verified providers</h3>

{% if request.user.is_admin %}
<div class="alert__warning">
<p>You belong to the admin group, which gives you permission to manage all providers in the database.
Below is a list of those providers for which a permission has been granted explicitly for you, rather than based on the group membership.</p>
</div>
{% endif %}

<p class="text-neutral-500 mt-8">Looking for the <a href="{% url 'greenweb_admin:index' %}" class="text-neutral-500">old style admin screens</a>?</p>

<h3 class="text-xl pt-10">Your submitted verification requests</h3>
<p>Verified providers appear in our
<a target="_blank" rel="noopener noreferrer" href="https://www.thegreenwebfoundation.org/tools/green-web-dataset/">Green Web Dataset</a> and
<a target="_blank" rel="noopener noreferrer" href="https://www.thegreenwebfoundation.org/tools/directory/">Green Web Directory</a>.</p>

{% for request in object_list.requests %}
<p><a href="{{ request.get_absolute_url }}">{{ request.name }} | <b>{{ request.status | upper }}</b></a></p>

{% empty %}
<p>You haven't submitted any verification requests yet. <a href="{% url 'before-starting' %}">Get started.</a>
{% if object_list.providers %}

{% endfor %}
<p>We ask you to ensure the listings below are kept up to date, and request you review your submitted evidence every 12 months.</p>

<div class="provider_listings">
{% for provider in object_list.providers %}
<div class="provider_listing odd:bg-neutral-100 even:bg-neutral-200 p-3 md:flex md:items-center border-green border-t-2 last-of-type:border-b-2">

<div class="md:w-1/2">
<p class="my-0">
<a class="font-bold" href="{% url 'greenweb_admin:accounts_hostingprovider_change' provider.id %}">{{ provider }}</a>
</p>

{% if provider.request and provider.request.approved_at %}
<p class="my-0 text-sm">Last updated: {{ provider.request.approved_at }}</p>
{% endif %}
</div>

<div class="md:w-1/2 text-right">

{% flag "edit_provider" %}
{% get_obj_perms request.user for provider as "provider_perms" %}

{% if "manage_provider" in provider_perms %}
<a href="{% url 'provider_edit' provider.id %}" class="btn btn-white text-sm">📝 Update listing</a>
{% endif %}
{% endflag %}
</div>

</div>
{% endfor %}
</div>

<p><a class="" href="{% url 'before-starting' %}" class="btn">Or create entirely new provider</a></p>


{% else %}

{% if object_list.requests|length == 0 %}
<p>You don't have any verified listings yet.</p>
<p><a class="btn mt-0" href="{% url 'before-starting' %}" class="btn">Submit a new verification request</a></p>
{% else %}
<p class="">Thank you! We're already working on a verification request you've submitted, listed in the <a href="#pending">pending verification</a> above.</p>
<p>If you wish, you can <a class="" href="{% url 'before-starting' %}" class="btn">create an entirely new provider verification request</a> to restart the process.</p>
{% endif %}

{% endif %}

<p class="text-neutral-500 mt-8">Looking for the <a href="{% url 'greenweb_admin:index' %}" class="text-neutral-500">old style admin screens</a>?</p>

</div>

<div class="lg:grid grid-cols-2 gap-16 my-10">
<section class="prose border-2 rounded-xl mb-6 lg:mb-0 p-6">
<h3 class="text-2xl border-b-2">Why should I get verified? </h3>
<p>Green Web Foundation is on a mission to make the internet fossil-free by 2030. We maintain the world's largest open dataset on websites running on green energy, the <i>Green Domains Dataset</i>.</p>
<p>Green Web Foundation is on a mission to make the internet fossil-free by 2030. We maintain the world's largest open dataset on websites running on green energy, the <i>Green Web Dataset</i>.</p>
<p>Every day, across the globe, more than seven million checks against this dataset are made.</p>
<p>If you are a hosting provider getting verified with us allow you to show as green, and therefore become visible as a findable and trusted source.</p>
<p>If you are a hosting provider getting verified with us allows you to show as green, and therefore become visible as a trusted supplier.</p>
</section>

<section class="prose bg-white border-2 rounded-xl p-6">
Expand Down
18 changes: 13 additions & 5 deletions apps/accounts/templates/provider_portal/request_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@

<h1 class="text-6xl mb-0"><span class="uppercase">Summary of request</h1>

<p>Submitted on: {{ object.created }}</p>
<p>Status: <span class="uppercase">{{ object.status }}</span></p>
<p>Submitted on: {{ object.modified }}</p>

{% if object.status|lower == "more info required" %}
<div class="alert__warning">
{% endif %}

<p><span class="text-black">Status:</span> <span class="uppercase font-bold">{{ object.status }}</span></p>

{% if object.status|lower == "more info required" %}
<p class="mt-4"><a href="{% url 'provider_request_edit' object.id %}" class="btn">Update request now</a></p>
</div>
{% endif %}

{% if object.approved_at and object.status|lower == "approved" %}
<p>Approved on: <span>{{ object.approved_at }}</span></p>
Expand All @@ -22,9 +32,7 @@ <h1 class="text-6xl mb-0"><span class="uppercase">Summary of request</h1>
We are currently reviewing this request. If you want to update the information relating to this provider, please get in touch using <a target="_blank" rel="noopener noreferrer" href="https://www.thegreenwebfoundation.org/support-form/">our support form</a>.
{% endif %}

{% if object.status|lower == "more info required" %}
<p class="mt-8"><a href="{% url 'provider_request_edit' object.id %}" class="btn">Update this request</a></p>
{% endif %}

</header>

<article class="pb-12">
Expand Down
8 changes: 8 additions & 0 deletions apps/theme/static_src/src/css/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,12 @@
.heading-icon__lightning--black::before {
@apply bg-lightning-black;
}
.verification_request:hover {
.verification_request__date {
@apply text-black;
}
.verification_request__name {
@apply no-underline;
}
}
}

0 comments on commit 82f9dfd

Please sign in to comment.