Esempio n. 1
0
def study_detail_view(request, campus, spot_id):
    spot = get_spot_by_id(spot_id)
    spot = validate_detail_info(spot, campus, "study")
    if not spot:
        return custom_404_response(request, campus)

    context = {"spot": spot,
               "campus": campus,
               "app_type": 'study'}
    return render_to_response('scout/study/detail.html', context,
                              context_instance=RequestContext(request))
Esempio n. 2
0
def tech_detail_view(request, campus, item_id):
    spot = get_item_by_id(int(item_id))
    spot = validate_detail_info(spot, campus, "tech")
    if not spot:
        return custom_404_response(request, campus)

    context = {"spot": spot,
               "campus": campus,
               "app_type": 'tech'}
    return render_to_response('scout/tech/detail.html', context,
                              context_instance=RequestContext(request))
Esempio n. 3
0
    def get_context_data(self, **kwargs):
        self.template_name = kwargs['template_name']
        spot = get_item_by_id(int(kwargs['item_id']))
        spot = validate_detail_info(spot, kwargs['campus'], "tech")
        if not spot:
            self.response_class = Response404
            self.template_name = "404.html"
            return custom_404_context(kwargs["campus"])

        context = {
            "spot": spot,
            "campus": kwargs['campus'],
            "app_type": 'tech',
            "campus_locations": CAMPUS_LOCATIONS
        }
        return context