Пример #1
0
def get_tabs(request, url):
    '''
    '''
    date  = html_utils.get_first_param_as_date(request)
    month = html_utils.get_first_param_as_int(request, 'month')
    day   = html_utils.get_first_param_as_int(request, 'day')
    date  = date_utils.set_date(date, month, day)
    more  = html_utils.get_first_param(request, 'more')

    ret_val = {}
    ret_val['more_form']   = date_utils.get_day_info(date)
    ret_val['pretty_date'] = date_utils.pretty_date(date)
    ret_val['tabs'] = get_svc_date_tabs(date, url, more is not None, get_translator(request)) 

    return ret_val
Пример #2
0
    def make_from_request(cls, request, param_name='place'):
        ret_val = Place()
        try:
            name = html_utils.get_first_param(request, 'name')
            if name is None:
                _  = get_translator(request)
                name = _(u'Uncertain location')

            lat  = html_utils.get_first_param(request, 'lat')
            lon  = html_utils.get_first_param(request, 'lon')
            city = html_utils.get_first_param(request, 'city')
            ret_val.set_values(name, lat, lon, city)

            place = html_utils.get_first_param(request, param_name)
            ret_val.set_values_via_place_str(place)

            place_coord = html_utils.get_first_param(request, param_name + 'Coord')
            ret_val.set_values_via_coord_str(place_coord)
        except: pass
        return ret_val
Пример #3
0
    def make_from_request(cls, request, param_name='place'):
        ret_val = Place()
        try:
            name = html_utils.get_first_param(request, 'name')
            if name is None:
                _ = get_translator(request)
                name = _(u'Uncertain location')

            lat  = html_utils.get_first_param(request, 'lat')
            lon  = html_utils.get_first_param(request, 'lon')
            city = html_utils.get_first_param(request, 'city')
            ret_val.set_values(name, lat, lon, city)

            place = html_utils.get_first_param(request, param_name)
            ret_val.set_values_via_place_str(place)

            place_coord = html_utils.get_first_param(request, param_name + 'Coord')
            ret_val.set_values_via_coord_str(place_coord)
        except Exception as e:
            pass
        return ret_val
Пример #4
0
def get_tabs(request, url):
    """ make the set of tabs on the schedule page
    """
    #import pdb; pdb.set_trace()
    is_prev_day = use_previous_day(request)
    if is_prev_day:
        date = date_utils.get_day_before()
    else:
        date = html_utils.get_first_param_as_date(request)
        month = html_utils.get_first_param_as_int(request, 'month')
        day = html_utils.get_first_param_as_int(request, 'day')
        year = date_utils.normalize_year(month)
        date = date_utils.set_date(date, month, day, year)

    more = html_utils.get_first_param(request, 'more')
    tab_id = html_utils.get_first_param_as_int(request, 'tab_id', 0)

    ret_val = {}
    ret_val['more_form'] = date_utils.get_day_info(date)
    ret_val['pretty_date'] = date_utils.pretty_date(date)
    ret_val['tabs'] = make_date_tabs(date, url, is_prev_day, tab_id, more
                                     is not None, get_translator(request))

    return ret_val
Пример #5
0
def get_tabs(request, url):
    ''' make the set of tabs on the schedule page
    '''
    #import pdb; pdb.set_trace()
    is_prev_day = use_previous_day(request)
    if is_prev_day:
        date = date_utils.get_day_before()
    else:
        date  = html_utils.get_first_param_as_date(request)
        month = html_utils.get_first_param_as_int(request, 'month')
        day   = html_utils.get_first_param_as_int(request, 'day')
        date  = date_utils.set_date(date, month, day)

    more   = html_utils.get_first_param(request, 'more')
    tab_id = html_utils.get_first_param_as_int(request, 'tab_id', 0)

    ret_val = {}
    ret_val['more_form']   = date_utils.get_day_info(date)
    ret_val['pretty_date'] = date_utils.pretty_date(date)
    ret_val['tabs'] = make_date_tabs(date, url, is_prev_day, tab_id, more is not None, get_translator(request))

    return ret_val