Exemplo n.º 1
0
def scoreboard(request,page):
   
  page = string.lower(page)
  if( page == "index"):
    page = "overall_lounge"
  user = request.user
  events = get_available_events(user)
  floor = user.get_profile().floor
  
  current_round = get_current_round()
  round_name = current_round if current_round else None
  floor_standings = Floor.floor_points_leaders(num_results=10, round_name=round_name)
  profile_standings = Profile.points_leaders(num_results=10, round_name=round_name).select_related("scoreboardentry")
  user_floor_standings = floor.points_leaders(num_results=10, round_name=round_name).select_related("scoreboardentry")
  
  categories_list = __get_categories(user)

  return render_to_response("mobile/scoreboard/"+page+".html",{
    "page": page,
    "events": events,
    "profile":user.get_profile(),
    "floor": floor,
    "categories":categories_list,
    "current_round": round_name or "Overall",
    "floor_standings": floor_standings,
    "profile_standings": profile_standings,
    "user_floor_standings": user_floor_standings,
    "help":help,
  }, context_instance=RequestContext(request))
Exemplo n.º 2
0
def smartgrid(request):
  activities = ActivityBase.objects.order_by("priority")
  categories_list = __get_categories(request.user)

  return render_to_response("mobile/smartgrid/index.html", {
    "activities": activities,
    "categories":categories_list,
  }, context_instance=RequestContext(request))