Files
zulip/zerver/lib/hotspots.py
Amy Liu 6f061beb46 hotspots: Add backend support for tutorial hotspots.
This commit adds the backend support for a new style of tutorial which
allows for highlighting of multiple areas of the page with hotspots that
disappear when clicked by the user.
2017-03-29 11:34:32 -07:00

13 lines
460 B
Python

from zerver.models import UserProfile, UserHotspot
from typing import List, Text
ALL_HOTSPOTS = ['welcome', 'streams', 'topics', 'narrowing', 'replying', 'get_started']
def get_next_hotspots(user):
# type: (UserProfile) -> List[Text]
seen_hotspots = frozenset(UserHotspot.objects.filter(user=user).values_list('hotspot', flat=True))
for hotspot in ALL_HOTSPOTS:
if hotspot not in seen_hotspots:
return [hotspot]
return []