Skip to content

Commit

Permalink
makes the leaderboard just slightly faster
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Jul 20, 2019
1 parent d02a905 commit 7ab6444
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
18 changes: 18 additions & 0 deletions app/marketing/migrations/0003_auto_20190720_1709.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.7 on 2019-07-20 17:09

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('marketing', '0002_auto_20190212_1736'),
]

operations = [
migrations.AlterField(
model_name='leaderboardrank',
name='active',
field=models.BooleanField(db_index=True),
),
]
2 changes: 1 addition & 1 deletion app/marketing/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class LeaderboardRank(SuperModel):
github_username = models.CharField(max_length=255)
leaderboard = models.CharField(max_length=255, db_index=True)
amount = models.FloatField(db_index=True)
active = models.BooleanField()
active = models.BooleanField(db_index=True)
count = models.IntegerField(default=0)
rank = models.IntegerField(default=0)
tech_keywords = ArrayField(models.CharField(max_length=50), blank=True, default=list)
Expand Down
2 changes: 1 addition & 1 deletion app/marketing/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def leaderboard(request, key=''):

keyword_search = request.GET.get('keyword', '')
keyword_search = '' if keyword_search == 'all' else keyword_search
limit = request.GET.get('limit', 25)
limit = request.GET.get('limit', 50)
cadence = request.GET.get('cadence', 'quarterly')

# backwards compatibility fix for old inbound links
Expand Down
10 changes: 9 additions & 1 deletion app/retail/templates/leaderboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h1 class="font-title-lg font-weight-semibold mt-2">{% trans "None found" %}</h1
<td class="col-3 d-flex align-items-center item-position"># {{forloop.counter}}</td>
<td class="col-5 d-flex align-items-center" >
{% if not is_linked_to_profile %}
<img class="img-fluid" src="{{item.avatar_url}}">
<img class="img-fluid" data-src="{{item.avatar_url}}">
{% endif %}
<div class="ml-3 item-count-bounties" style="white-space: nowrap">
{% if not is_linked_to_profile %}
Expand Down Expand Up @@ -183,4 +183,12 @@ <h1 class="font-title-lg font-weight-semibold mt-2">{% trans "None found" %}</h1
<script src="{% static "v2/js/tokens.js" %}"></script>
<script src="{% static "v2/js/pages/leaderboard.js" %}"></script>

<script src="{% static "v2/js/lib/jquery-unveil.js" %}"></script>
<script>
$(document).ready(function() {
$("img").unveil(200);
});
</script>


</html>

0 comments on commit 7ab6444

Please sign in to comment.