major navbar overhaul: .btn-primary.btn-xl now reads CONT GAME and links to the user's most recently active game; log out functionality transferred to new BYE .btn-abandon abutting login spans; tooltips for each asserted via new FTs.test_navbar methods to appear w.in visible area
This commit is contained in:
@@ -1,4 +1,30 @@
|
||||
def user_palette(request):
|
||||
if request.user.is_authenticated:
|
||||
return {"user_palette": request.user.palette}
|
||||
return {"user_palette": "palette-default"}
|
||||
return {"user_palette": "palette-default"}
|
||||
|
||||
|
||||
def navbar_context(request):
|
||||
if not request.user.is_authenticated:
|
||||
return {}
|
||||
from django.db.models import Max, Q
|
||||
from django.urls import reverse
|
||||
from apps.epic.models import Room
|
||||
|
||||
recent_room = (
|
||||
Room.objects.filter(
|
||||
Q(owner=request.user) | Q(gate_slots__gamer=request.user)
|
||||
)
|
||||
.annotate(last_event=Max("events__timestamp"))
|
||||
.filter(last_event__isnull=False)
|
||||
.order_by("-last_event")
|
||||
.distinct()
|
||||
.first()
|
||||
)
|
||||
if recent_room is None:
|
||||
return {}
|
||||
if recent_room.table_status:
|
||||
url = reverse("epic:room", args=[recent_room.id])
|
||||
else:
|
||||
url = reverse("epic:gatekeeper", args=[recent_room.id])
|
||||
return {"navbar_recent_room_url": url}
|
||||
Reference in New Issue
Block a user