
    fC                     ^    d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	m
Z
  ed      d        Zy	)
z
GPXPORTER VIEWS
Frontend

    )login_required)HttpResponseRedirectHttpResponse)loader)strava_authstrava_activityz/accounts/login/)	login_urlc                 j   t        j                  | j                        }|du rAt        j                  | j                        }t	        dt        |      z         t        |      S t        j                  d      }t        |j                  dt        j                  | j                        d|             S )NFz*[FRONTEND][STRAVA] redirecting to auth: %szgpxporter_frontend/index.html	GPXporter)title
activities)r   get_user_strava_settingsuserbuild_strava_authorize_uriprintstrr   r   get_templater   renderr   get_user_activities)requestsettingsauth_urltemplates       7/var/www/lazysolutions_prod/gpxporter/views/frontend.pylandingr      s    33GLLAH599',,G:S]JK#H--""#BCH%99',,G)IJQS T T    N)__doc__django.contrib.auth.decoratorsr   django.httpr   r   django.templater   gpxporter.helpersr   r   r    r   r   <module>r#      s4    : : " : ,-
T .
Tr   