示例#1
0
def locations(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': request.GET}

        context = setConstants(context)

        #context['currentlocation_s'] = '*'
        #context['pgNum'] = pgNum if 'pgNum' in context else '1'
        #context['url'] = url
        #context['displayType'] = 'list'
        #context['pixonly'] = 'true'
        #context['title'] = TITLE

        # do search
        loginfo('start search', context, request)
        #context = doSearch(context)

        locations = getlocations(connect_string)
        context['locations'] = locations
        context['loginBtnNext'] = 'locviewer/'

        return render(request, 'viewLocations.html', context)

    else:
        return render(request, 'viewLocations.html',
                      {'title': TITLE, 'pgNum': 10, 'maxresults': 20,
                       'imageserver': IMAGESERVER, 'loginBtnNext': 'locviewer/'})
示例#2
0
def images(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': request.GET}

        context = setConstants(context)

        context['text'] = request.GET['text']
        #context['pgNum'] = pgNum if 'pgNum' in context else '1'
        #context['url'] = url
        context['displayType'] = 'list'
        context['pixonly'] = 'true'
        context['title'] = TITLE

        # do search
        loginfo('start search', context, request)
        context = doSearch(context)

        return render(request, 'showImages.html', context)

    else:
        return render(request, 'showImages.html', {
            'title': TITLE,
            'pgNum': 10,
            'maxresults': 20
        })
示例#3
0
def locations(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': request.GET}

        context = setConstants(context)

        #context['currentlocation_s'] = '*'
        #context['pgNum'] = pgNum if 'pgNum' in context else '1'
        #context['url'] = url
        #context['displayType'] = 'list'
        #context['pixonly'] = 'true'
        #context['title'] = TITLE

        # do search
        loginfo('start search', context, request)
        #context = doSearch(context)

        locations = getlocations(connect_string)
        context['locations'] = locations
        context['loginBtnNext'] = 'locviewer/'

        return render(request, 'viewLocations.html', context)

    else:
        return render(request, 'viewLocations.html',
                      {'title': TITLE, 'pgNum': 10, 'maxresults': 20,
                       'imageserver': IMAGESERVER, 'loginBtnNext': 'locviewer/'})
示例#4
0
def index(request):

    context = setConstants({})

    # http://blog.mobileesp.com/
    # the middleware must be installed for the following to work...
    if request.is_phone:
        context['device'] = 'phone'
    elif request.is_tablet:
        context['device'] = 'tablet'
    else:
        context['device'] = 'other'

    if request.method == 'GET' and request.GET != {}:
        context['searchValues'] = request.GET

        if 'text' in request.GET:
            context['text'] = request.GET['text']
        if 'musno' in request.GET:
            context['musno'] = request.GET['musno']
            context['maxresults'] = 1
        if 'submit' in request.GET:
            context['maxresults'] = MAXRESULTS
            if "Metadata" in request.GET['submit']:
                context['resultType'] = 'metadata'
                context['displayType'] = 'full'
            elif "Images" in request.GET['submit']:
                context['resultType'] = 'images'
                context['pixonly'] = 'true'
                context['displayType'] = 'grid'
            elif "Lucky" in request.GET['submit']:
                context['resultType'] = 'metadata'
                context['maxresults'] = 1
        else:
            context['resultType'] = 'metadata'
        context['title'] = TITLE

        # do search
        loginfo('start search', context, request)
        context = doSearch(context)

        return render(request, 'imagineImages.html', context)

    else:
        
        return render(request, 'imagineImages.html', context)
示例#5
0
def images(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': request.GET}

        context = setConstants(context)

        context['text'] = request.GET['text']
        #context['pgNum'] = pgNum if 'pgNum' in context else '1'
        #context['url'] = url
        context['displayType'] = 'list'
        context['pixonly'] = 'true'
        context['title'] = TITLE

        # do search
        loginfo('start search', context, request)
        context = doSearch(context)

        return render(request, 'showImages.html', context)

    else:
        return render(request, 'showImages.html',
                      {'title': TITLE, 'pgNum': 10, 'maxresults': 20})