Skip to content

Commit

Permalink
feat: put all year in hog images under a single URL path (#19147)
Browse files Browse the repository at this point in the history
* feat: add the survey year in hog imageS

* feat: all year in hog images from one root
  • Loading branch information
pauldambra authored Dec 6, 2023
1 parent f23e0f3 commit 2994cbf
Show file tree
Hide file tree
Showing 32 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions posthog/api/test/test_feature_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ def test_my_flags_is_not_nplus1(self) -> None:
format="json",
).json()

with self.assertNumQueries(10):
with self.assertNumQueries(FuzzyInt(10, 11)):
response = self.client.get(f"/api/projects/{self.team.id}/feature_flags/my_flags")
self.assertEqual(response.status_code, status.HTTP_200_OK)

Expand All @@ -1140,7 +1140,7 @@ def test_my_flags_is_not_nplus1(self) -> None:
format="json",
).json()

with self.assertNumQueries(10):
with self.assertNumQueries(FuzzyInt(10, 11)):
response = self.client.get(f"/api/projects/{self.team.id}/feature_flags/my_flags")
self.assertEqual(response.status_code, status.HTTP_200_OK)

Expand Down
2 changes: 1 addition & 1 deletion posthog/year_in_posthog/2023.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<link rel="preload" href="{% static 'Inter.woff2' %}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{% static 'Inter.woff' %}" as="font" type="font/woff" crossorigin>
<link rel="preload" href="{% static image_webp %}" as="image">
<link rel="preload" href="{% static 'background.png' %}" as="image">
<link rel="preload" href="{% static 'year_in_hog/background.png' %}" as="image">
<script>
!function (t, e) {
var o, n, p, r;
Expand Down
4 changes: 2 additions & 2 deletions posthog/year_in_posthog/hibernating.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
{% endif %}
<link rel="preload" href="{% static 'Inter.woff2' %}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{% static 'Inter.woff' %}" as="font" type="font/woff" crossorigin>
<link rel="prefetch" href="{% static 'sleeping-hog.png' %}" />
<link rel="prefetch" href="{% static "background.png" %}" />
<link rel="prefetch" href="{% static 'year_in_hog/sleeping-hog.png' %}" />
<link rel="prefetch" href="{% static "year_in_hog/background.png" %}" />


<script>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions posthog/year_in_posthog/sharing-buttons.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div>Share to</div>
<div>
<a target="_blank"
aria-label="share year in posthog 2022 to facebook"
data-attr="share-year-in-posthog-2022-to-facebook"
aria-label="share year in posthog 2023 to facebook"
data-attr="share-year-in-posthog-2023-to-facebook"
href="http://www.facebook.com/sharer/sharer.php?u={{ page_url | urlencode }}&quote=No hedgehogs were harmed in the course of this year on @posthog">
<svg viewBox="0 0 24 24">
<path fill="white"
Expand All @@ -12,8 +12,8 @@
</div>
<div>
<a target="_blank"
aria-label="share year in posthog 2022 to linked in"
data-attr="share-year-in-posthog-2022-to-linked-in"
aria-label="share year in posthog 2023 to linked in"
data-attr="share-year-in-posthog-2023-to-linked-in"
href="https://www.linkedin.com/sharing/share-offsite/?url={{ page_url | urlencode }}">
<svg viewBox="0 0 24 24">
<path fill="white"
Expand All @@ -23,9 +23,9 @@
</div>
<div>
<a target="_blank"
aria-label="share year in posthog 2022 to twitter"
data-attr="share-year-in-posthog-2022-to-twitter"
href="https://twitter.com/intent/tweet?text={{ 'No hedgehogs were harmed in the course of this year on @posthog' }}&url={{ page_url | urlencode }}&hashtags=YearInPostHog">
aria-label="share year in posthog 2023 to twitter"
data-attr="share-year-in-posthog-2023-to-twitter"
href="https://twitter.com/intent/tweet?text={{ 'No hedgehogs were harmed in the course of this year on @posthog' }}&url={{ page_url | urlencode }}&hashtags=PostHogUnwrapped">
<svg viewBox="0 0 24 24">
<path fill="white"
d="M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z"/>
Expand Down
6 changes: 3 additions & 3 deletions posthog/year_in_posthog/year_in_posthog.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def render_2023(request, user_uuid: str) -> HttpResponse:
"badge": badge,
"human_badge": human_badge.get(badge),
"highlight_color": highlight_color.get(badge),
"image_png": f"badges/2022_{badge}.png",
"image_webp": f"badges/2022_{badge}.webp",
"opengraph_image": f"open-graph/2022_{badge}.png",
"image_png": f"year_in_hog/badges/2023_{badge}.png",
"image_webp": f"year_in_hog/badges/2023_{badge}.webp",
"opengraph_image": f"open-graph/2023_{badge}.png",
"explanation": explanation.get(badge),
"stats": stats,
"page_url": f"{request.scheme}://{request.META['HTTP_HOST']}{request.get_full_path()}",
Expand Down

0 comments on commit 2994cbf

Please sign in to comment.