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 in community pages #1563 #1851

Open
wants to merge 4 commits into
base: main
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
2 changes: 1 addition & 1 deletion aggregator/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ def community_stats(request):
Context processor to calculate Django's age for the community pages.
"""
# Django 3.2 introduces depth kwarg. Set timesince(..., depth=1) then.
stats = {"age": timesince(DJANGO_DOB)}
stats = {"age": timesince(DJANGO_DOB, depth=1)}
return {"community_stats": stats}
7 changes: 5 additions & 2 deletions dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ def index(request):
if data is None:
metrics = []
for MC in Metric.__subclasses__():
metrics.extend(MC.objects.filter(show_on_dashboard=True))
metrics.extend(
MC.objects.filter(show_on_dashboard=True).prefetch_related("data")
)
metrics = sorted(metrics, key=operator.attrgetter("display_position"))

data = []
for metric in metrics:
data.append({"metric": metric, "latest": metric.data.latest()})
latest_data = metric.data.latest()
data.append({"metric": metric, "latest": latest_data})
cache.set(key, data, 60 * 60, version=generation)

return render(request, "dashboard/index.html", {"data": data})
Expand Down
2 changes: 1 addition & 1 deletion djangoproject/templates/base_community.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load fundraising_extras i18n %}

{% block og_title %}{% translate "Django Community" %}{% endblock %}
{% block og_description %}{% translate "Building the Django Community. Come join us!" %}{% endblock %}
{% block og_description %}{% translate "Building the Django Community for {{ community_stats.age }} Come join us!" %}{% endblock %}

{% block layout_class %}sidebar-right{% endblock %}
{% block title %}{% translate "Django Community" %}{% endblock %}
Expand Down
16 changes: 1 addition & 15 deletions fundraising/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,11 @@ class DjangoHeroForm(forms.ModelForm):
logo = forms.FileField(
required=False,
help_text=_(
"If you've donated at least US $%d, you can submit your logo and "
"If you've donated at least US $%d in a calendar year, you can submit your logo and "
"we will display it, too."
)
% LEADERSHIP_LEVEL_AMOUNT,
)
is_visible = forms.BooleanField(
required=False,
label=_(
"Yes, display my name, URL, and logo on this site. "
"It'll be displayed shortly after we verify it."
),
)
is_subscribed = forms.BooleanField(
required=False,
label=_(
"Yes, the Django Software Foundation can inform me about "
"future fundraising campaigns by email."
),
)

class Meta:
model = DjangoHero
Expand Down