mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
							
								
								
									
										12
									
								
								zerver/lib/hotspots.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								zerver/lib/hotspots.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
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 []
 | 
			
		||||
		Reference in New Issue
	
	Block a user