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

Simplify header text on community pages (#1563) #1614

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

WajahatKanju
Copy link
Contributor

Simplify Header Text on Community Pages

Issue Reference

This pull request addresses/fixes #1563.

Description

The current header on the community pages reads:

Building the Django Community for 18 years, 11 months. Come join us!

This text is a bit too detailed, and a comment in the code suggests that it was intended to be shorter.

Changes Made

  • Simplified the header text on community pages by updating the age display to show only the number of years Django has been active. This was achieved by modifying the timesince function call in aggregator/context_processors.py.

FROM:

stats = {"age": timesince(DJANGO_DOB)}

TO

stats = {"age": timesince(DJANGO_DOB, depth=1)}

Added Test

  • Added a unit test to verify that the header text is simplified to show only the number of years and does not include months. The test checks that the output contains "years" and does not contain "months."

Test Method:

def test_header_text_simplification_shows_only_years(self):
    django_dob = datetime.datetime(2005, 7, 21)
    age = timesince(django_dob, depth=1)
    self.assertIn("years", age)
    self.assertNotIn("months", age)

@WajahatKanju
Copy link
Contributor Author

image
To
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify header text in community pages
1 participant