Beispiel #1
0
def advanced_map_view(request):
    pilegroups = [(pilegroup, ordered_piles(pilegroup))
                  for pilegroup in ordered_pilegroups()]

    return render_to_response_per_partner('advanced_map.html', {
            'pilegroups': pilegroups
            }, request)
Beispiel #2
0
def level3_test_links(request):
    '''Temporary page for Level 3 page user testing on smartphones.'''
    piles = []
    for pilegroup in ordered_pilegroups():
        for pile in ordered_piles(pilegroup):
            piles.append((pile, get_simple_url('simple', pilegroup, pile)))
    return render(request, 'level3_test_links.html', {'piles': piles})
Beispiel #3
0
def level3_test_links(request):
    '''Temporary page for Level 3 page user testing on smartphones.'''
    piles = []
    for pilegroup in ordered_pilegroups():
        for pile in ordered_piles(pilegroup):
            piles.append((pile, get_simple_url('simple', pilegroup, pile)))
    return render(request, 'level3_test_links.html', {
            'piles': piles
        })
Beispiel #4
0
def video_view(request):
    # The Getting Started video is first, followed by videos for the pile
    # groups and piles in the order that they are presented in the stepwise
    # pages at the beginning of plant identification.
    videos = []
    getting_started_video = Video.objects.get(title="Getting Started")
    if getting_started_video:
        videos.append({"title": getting_started_video.title, "youtube_id": getting_started_video.youtube_id})

    for pilegroup in ordered_pilegroups():
        videos.append(_get_video_dict(pilegroup.friendly_title, pilegroup.video))
        for pile in ordered_piles(pilegroup):
            videos.append(_get_video_dict(pile.friendly_title, pile.video))

    return render_to_response("gobotany/video.html", {"videos": videos}, context_instance=RequestContext(request))
Beispiel #5
0
def video_view(request):
    # The Getting Started video is first, followed by videos for the pile
    # groups and piles in the order that they are presented in the stepwise
    # pages at the beginning of plant identification.
    videos = []
    getting_started_video = Video.objects.get(title='Getting Started')
    if getting_started_video:
        videos.append({'title': getting_started_video.title,
                       'youtube_id': getting_started_video.youtube_id});

    for pilegroup in ordered_pilegroups():
        videos.append(_get_video_dict(pilegroup.friendly_title,
                                      pilegroup.video))
        for pile in ordered_piles(pilegroup):
            videos.append(_get_video_dict(pile.friendly_title, pile.video))

    return render_to_response_per_partner('video.html', {
           'videos': videos,
           }, request)
Beispiel #6
0
def level2(request, key, pilegroup_slug):
    pilegroup = get_object_or_404(PileGroup, slug=pilegroup_slug)

    short_name = partner_short_name(request)
    subgroups_list_page = SubgroupsListPage.objects.get(group=pilegroup)

    piles = []
    for pile in ordered_piles(pilegroup):
        images = _images_with_copyright_holders(
            ContentImage.objects.filter(pileimage__pile=pile)
            .select_related('image_type'))
        piles.append((pile, images, get_simple_url(key, pilegroup, pile)))

    return render_per_partner('pilegroup.html', {
                'partner_site': short_name,
                'subgroups_list_page': subgroups_list_page,
                'key': key,
                'pilegroup': pilegroup,
                'piles': piles
                }, request)
Beispiel #7
0
def level2(request, key, pilegroup_slug):
    pilegroup = get_object_or_404(PileGroup, slug=pilegroup_slug)

    short_name = partner_short_name(request)
    subgroups_list_page = SubgroupsListPage.objects.get(group=pilegroup)

    piles = []
    for pile in ordered_piles(pilegroup):
        images = _images_with_copyright_holders(
            ContentImage.objects.filter(
                pileimage__pile=pile).select_related('image_type'))
        piles.append((pile, images, get_simple_url(key, pilegroup, pile)))

    return render_per_partner(
        'pilegroup.html', {
            'partner_site': short_name,
            'subgroups_list_page': subgroups_list_page,
            'key': key,
            'pilegroup': pilegroup,
            'piles': piles
        }, request)
Beispiel #8
0
def video_view(request):
    # The Getting Started video is first, followed by videos for the pile
    # groups and piles in the order that they are presented in the stepwise
    # pages at the beginning of plant identification.
    videos = []
    getting_started_video = Video.objects.get(title='Getting Started')
    if getting_started_video:
        videos.append({
            'title': getting_started_video.title,
            'youtube_id': getting_started_video.youtube_id
        })

    for pilegroup in ordered_pilegroups():
        videos.append(
            _get_video_dict(pilegroup.friendly_title, pilegroup.video))
        for pile in ordered_piles(pilegroup):
            videos.append(_get_video_dict(pile.friendly_title, pile.video))

    return render_per_partner('video.html', {
        'videos': videos,
    }, request)
Beispiel #9
0
def advanced_map_view(request):
    pilegroups = [(pilegroup, ordered_piles(pilegroup)) for pilegroup in ordered_pilegroups()]

    return render_to_response(
        "gobotany/advanced_map.html", {"pilegroups": pilegroups}, context_instance=RequestContext(request)
    )
Beispiel #10
0
def advanced_map_view(request):
    pilegroups = [(pilegroup, ordered_piles(pilegroup))
                  for pilegroup in ordered_pilegroups()]

    return render_per_partner('advanced_map.html', {'pilegroups': pilegroups},
                              request)
Beispiel #11
0
def advanced_map_view(request):
    pilegroups = [(pilegroup, ordered_piles(pilegroup)) for pilegroup in ordered_pilegroups()]

    return render_per_partner("advanced_map.html", {"pilegroups": pilegroups}, request)