diff --git a/apps/accounts/models/hosting.py b/apps/accounts/models/hosting.py index 9f42aad0..fd76811d 100644 --- a/apps/accounts/models/hosting.py +++ b/apps/accounts/models/hosting.py @@ -385,6 +385,18 @@ def ip_approval_count(self) -> int: """ return self.greencheckipapprove_set.all().count() + @property + def website_link(self) -> str: + """ + Return a hyperlink for the website, accounting for whether + the website link is stored as a fully qualified url or not + """ + if self.website.startswith("http"): + return self.website + else: + return f"https://{self.website}" + + # Mutators def refresh_shared_secret(self) -> str: try: diff --git a/apps/theme/templates/greencheck/partials/_directory_results.html b/apps/theme/templates/greencheck/partials/_directory_results.html index 531c76c3..e2088abc 100644 --- a/apps/theme/templates/greencheck/partials/_directory_results.html +++ b/apps/theme/templates/greencheck/partials/_directory_results.html @@ -1,118 +1,118 @@ {% load static %} {% regroup ordered_results by country.name as country_list %} - -

- Showing {{ ordered_results|length }} verified green hosting - {% if ordered_results|length == 1 %} - provider - {% else %} - providers - {% endif %} - - in {{ country_list|length }} - - {% if country_list|length == 1 %} - country. - {% else %} - countries. - {% endif %} -

- - {% for country in country_list %} - -
- -

{{ country.grouper }} ({{ country.list|length }})

- - {% for obj in country.list %} -
-
- -

- {% if obj.website %} - - {% endif %} - - {{ obj.name }} - - {% if obj.website %} - Visit {{ obj.name }}'s website - - {% endif %} -

- - {% if obj.description %} -

- {{ obj.description }} -

- {% endif %} - - {% if obj.services.names %} -
    - {% for service in obj.services.all %} -
  • {{ service.name }}
  • - {% endfor %} - - {% comment %} + +

    + Showing {{ ordered_results|length }} verified green hosting + {% if ordered_results|length == 1 %} + provider + {% else %} + providers + {% endif %} + + in {{ country_list|length }} + + {% if country_list|length == 1 %} + country. + {% else %} + countries. + {% endif %} +

    + +{% for country in country_list %} + +
    + +

    {{ country.grouper }} ({{ country.list|length }})

    + + {% for obj in country.list %} +
    +
    + +

    + {% if obj.website %} + + {% endif %} + + {{ obj.name }} + + {% if obj.website %} + Visit {{ obj.name }}'s website + + {% endif %} +

    + + {% if obj.description %} +

    + {{ obj.description }} +

    + {% endif %} + + {% if obj.services.names %} +
      + {% for service in obj.services.all %} +
    • {{ service.name }}
    • + {% endfor %} + + {% comment %} Every host in our directory used to at least offer shared hosting. Below is a placeholder to see how it would look with live data. {% else %}
    • Compute: Shared Hosting for Websites
    • {% endcomment %} -
    - {% endif %} - - {% if obj.public_supporting_evidence %} -
    - - Published supporting evidence - - -
      - {% for evidence in obj.public_supporting_evidence %} -
    • - {{ evidence.title }} - - {% if evidence.description %} -
      - {{ evidence.description|linebreaks }} -
      - {% endif %} -
    • - {% endfor %} -
    -
    - {% endif %} - -
    - - {% if not obj.public_supporting_evidence and not obj.description %} -
    - Help improve this listing - -

    - Once a hosting provider gets verified with us, we ask them to keep - their listing up to date and refresh their evidence at least annually.

    - -

    - Are you a customer of this provider? We find - it helps most providers act more quickly if they receive a friendly prompt - from you reminding them of the importance of this open data. Use our - - sample emails to start a conversation.

    - -

    - Do you work for this provider? - - Submit a correction now.

    - - {% endif %} - -
    - - {% endfor %} -
    - {% endfor %} - -

    End of results. To the top. \ No newline at end of file +

+ {% endif %} + + {% if obj.public_supporting_evidence %} +
+ + Published supporting evidence + + +
    + {% for evidence in obj.public_supporting_evidence %} +
  • + {{ evidence.title }} + + {% if evidence.description %} +
    + {{ evidence.description|linebreaks }} +
    + {% endif %} +
  • + {% endfor %} +
+
+ {% endif %} + +
+ + {% if not obj.public_supporting_evidence and not obj.description %} +
+ Help improve this listing + +

+ Once a hosting provider gets verified with us, we ask them to keep + their listing up to date and refresh their evidence at least annually.

+ +

+ Are you a customer of this provider? We find + it helps most providers act more quickly if they receive a friendly prompt + from you reminding them of the importance of this open data. Use our + + sample emails to start a conversation.

+ +

+ Do you work for this provider? + + Submit a correction now.

+ + {% endif %} + +
+ + {% endfor %} +
+{% endfor %} + +

End of results. To the top.