Skip to content

Commit

Permalink
Merge pull request #1486 from codalab/home-ui-private-comp
Browse files Browse the repository at this point in the history
Remove private competitions and competition participants counters from home page
  • Loading branch information
Didayolo authored Jun 13, 2024
2 parents e3dbec5 + 8cb32bd commit 9c5a545
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/apps/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.views.generic import TemplateView
from django.db.models import Count, Q

from competitions.models import Competition, Submission, CompetitionParticipant
from competitions.models import Competition, Submission
from profiles.models import User
from announcements.models import Announcement, NewsPost

Expand All @@ -22,17 +22,13 @@ def get_context_data(self, *args, **kwargs):
unpublished_comps=Count('pk', filter=Q(published=False)),
)

total_competitions = data['count']
public_competitions = data['published_comps']
users = User.objects.all().count()
competition_participants = CompetitionParticipant.objects.all().count()
submissions = Submission.objects.all().count()

context['general_stats'] = [
{'label': "Total Competitions", 'count': total_competitions},
{'label': "Public Competitions", 'count': public_competitions},
{'label': "Users", 'count': users},
{'label': "Competition Participants", 'count': competition_participants},
{'label': "Submissions", 'count': submissions},
]

Expand Down
2 changes: 1 addition & 1 deletion src/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h3 class="ui icon header">
</div>

<!-- Stats section -->
<div class="ui five column grid" id="general-stats">
<div class="ui three column grid" id="general-stats">
{% for stat in general_stats %}
<div class="column">
<div class="ui statistic">
Expand Down

0 comments on commit 9c5a545

Please sign in to comment.