Skip to content

Commit

Permalink
Import player positions
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjp93 committed Aug 4, 2024
1 parent 47a17c7 commit 217f6a2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion player/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from match.viewsapi import MatchBySummoner
from match import tasks as mt
from player.filters import SummonerAutocompleteFilter, SummonerMatchFilter
from player.forms import SummonerSearchForm
from player.models import EmailVerification, NameChange
from player.viewsapi import get_by_puuid
from player import tasks as pt


def get_page_urls(request, query_param='page'):
Expand Down Expand Up @@ -100,6 +100,7 @@ def get_context_data(self, *args, **kwargs):
queue,
)
mt.bulk_import.s(self.summoner.puuid, count=40, offset=start + limit).apply_async(countdown=2)
pt.import_positions(self.summoner.id)

context = super().get_context_data(*args, **kwargs)
prev_url, next_url = get_page_urls(self.request)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ format_css = true
line_break_after_multiline_tag = true
max_blank_lines = 1
profile = "django"
custom_html = "c-[\\w._\\-]+"

[tool.djlint.js]
indent_size = 2
Expand Down
13 changes: 9 additions & 4 deletions templates/cotton/player/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ summoner.summoner_level }}
</div>
</div>
<c-tooltip>
<c-tooltip class="mb-auto">
<div class="mx-auto flex underline">
<div>
{{ summoner.riot_id_name }}
Expand All @@ -17,10 +17,15 @@
</div>
<c-slot name="content">
<div class="flex flex-col gap-y-2 mx-2">
<h4 class="underline" title="Only names found in imported games will be listed here.">
Previous Names
</h4>
{% for name in namechanges %}
<div>
{{ name.old_name }}
</div>
<div>
{{ name.old_name }}
</div>
{% empty %}
<div>No Names Found</div>
{% endfor %}
</div>
</c-slot>
Expand Down
2 changes: 1 addition & 1 deletion templates/cotton/tooltip.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="cursor-pointer tippy" data-tippy-trigger="focusin click" >
<div class="cursor-pointer tippy {{ class }}" data-tippy-trigger="focusin click" >
{{ slot }}
<div class="tippy-content" style="display: none;">
{{ content }}
Expand Down

0 comments on commit 217f6a2

Please sign in to comment.