Пример #1
0
def gml(request, mark_reference):
    mark = get_object_or_404(Mark, reference=mark_reference)
    date_drawn = int(time.mktime(mark.date_drawn.timetuple()))
    context = {'mark': mark, 'obj_decoded': simplejson.loads(mark.points_obj_simplified), 'date_drawn': date_drawn}
    response = render_response(request, 'gml.xml', context, mimetype='application/xml')
    response['Content-Disposition'] = "attachment; filename=%s.gml" % mark.reference
    return response
Пример #2
0
def list_invites(request):
    if not request.user.is_authenticated():
        return HttpResponseRedirect('/accounts/login/')
    else:
        invites = Invitation.objects.order_by('id')
        context = {'invites': invites}
        return render_response(request, 'list_invites.html', context)
Пример #3
0
def list_invites(request):
    if not request.user.is_authenticated():
        return HttpResponseRedirect('/accounts/login/')
    else:
        invites = Invitation.objects.order_by('id')
        context = {'invites': invites}
        return render_response(request, 'list_invites.html', context)
Пример #4
0
def makemark(request):
    mark_form = MarkForm(request.POST)
    if mark_form.is_valid():
        mark_data = {'points_obj': mark_form.cleaned_data['points_obj'], 'country_code': mark_form.cleaned_data['country_code']}
        common.save_new_mark_with_data(mark_data)
    else:
        mark_form = MarkForm()
    return render_response(request, 'makemark.html', {'form': mark_form})
Пример #5
0
def makemark(request):
    mark_form = MarkForm(request.POST)
    if mark_form.is_valid():
        mark_data = {
            'points_obj': mark_form.cleaned_data['points_obj'],
            'country_code': mark_form.cleaned_data['country_code']
        }
        common.save_new_mark_with_data(mark_data)
    else:
        mark_form = MarkForm()
    return render_response(request, 'makemark.html', {'form': mark_form})
Пример #6
0
def community(request):
    if 'offset' in request.GET:
        try:
            offset = int(request.GET['offset'])
            per_page = int(request.GET['per_page'])
        except ValueError:
            return HttpResponseBadRequest()
        top_limit = offset + per_page
        all_marks = Mark.objects.exclude(flaggings__gte=1)[offset:top_limit]
    else:
        all_marks = Mark.objects.exclude(flaggings__gte=1)
    return render_response(request, 'community.html', {'all_marks': all_marks})
Пример #7
0
def community(request):
    if 'offset' in request.GET:
        try:
            offset = int(request.GET['offset'])
            per_page = int(request.GET['per_page'])
        except ValueError:
            return HttpResponseBadRequest()
        top_limit = offset + per_page
        all_marks = Mark.objects.exclude(flaggings__gte=1)[offset:top_limit]
    else:
        all_marks = Mark.objects.exclude(flaggings__gte=1)
    return render_response(request, 'community.html', {'all_marks': all_marks})
Пример #8
0
def gml(request, mark_reference):
    mark = get_object_or_404(Mark, reference=mark_reference)
    date_drawn = int(time.mktime(mark.date_drawn.timetuple()))
    context = {
        'mark': mark,
        'obj_decoded': simplejson.loads(mark.points_obj_simplified),
        'date_drawn': date_drawn
    }
    response = render_response(request,
                               'gml.xml',
                               context,
                               mimetype='application/xml')
    response[
        'Content-Disposition'] = "attachment; filename=%s.gml" % mark.reference
    return response
def subscribe(request):
    """ Subscribe a new email address to our contact list """
    form = forms.EmailSubscribeForm(request.POST or None)
    if request.method == 'POST':
        if form.is_valid():
            data = form.cleaned_data
            responsys.subscribe(settings.RESPONSYS_CAMPAIGN, 
                                data['email'],
                                'text',
                                responsys.make_source_url(request),
                                request.locale,
                                data['country'])
            return HttpResponseRedirect('/')
     # Not a POST or an Error 
    return render_response(request, 'newsletter.html', {'form': form})
Пример #10
0
def evan(request):
    evan_urls = {
        'laser_url': 'http://graffitiresearchlab.com/projects/laser-tag/',
        'throwies_url': 'http://graffitiresearchlab.com/projects/led-throwies/',
        'glove_url': 'http://whiteglovetracking.com/',
        'eyewriter_url': 'http://www.eyewriter.org/',
        'graffiti_url': 'http://graffitianalysis.com/',
        'jayz_url': 'http://www.youtube.com/watch?v=QftcJtvLr8g',
        'research_url': 'http://www.graffitiresearchlab.com/',
        'fat_url': 'http://fffff.at/',
        'npr_url': 'http://www.npr.org/templates/story/story.php?storyId=124980282',
        'nyt_url': 'http://evan-roth.com/press/High-Tech-Graffiti-Spray-Paint-Is-So-20th-Century-New-York-Times.pdf',
        'liberation_url': 'http://evan-roth.com/press/C-est-graff-docteur.pdf',
        'time_url': 'http://www.time.com/time/photogallery/0,29307,1911799_1912685,00.html',
        'cnn_url': 'http://edition.cnn.com/2010/TECH/web/09/10/gif.images/index.html',
        'guardian_url': 'http://www.guardian.co.uk/search?search=%22evan+roth%22&sitesearch-radio=guardian&go-guardian=Search',
        'abc_url': 'http://abcnews.go.com/Technology/popup?id=2425229',
        'esquire_url': 'http://www.esquire.com/features/best-brightest-2007/graffiti1207',
        'juxtapoz_url': 'http://evan-roth.com/press/juxtapoz-2010-10-oct-eroth.pdf',
    }
    return render_response(request, 'evan-roth.html', evan_urls)
Пример #11
0
def evan(request):
    evan_urls = {
        'laser_url':
        'http://graffitiresearchlab.com/projects/laser-tag/',
        'throwies_url':
        'http://graffitiresearchlab.com/projects/led-throwies/',
        'glove_url':
        'http://whiteglovetracking.com/',
        'eyewriter_url':
        'http://www.eyewriter.org/',
        'graffiti_url':
        'http://graffitianalysis.com/',
        'jayz_url':
        'http://www.youtube.com/watch?v=QftcJtvLr8g',
        'research_url':
        'http://www.graffitiresearchlab.com/',
        'fat_url':
        'http://fffff.at/',
        'npr_url':
        'http://www.npr.org/templates/story/story.php?storyId=124980282',
        'nyt_url':
        'http://evan-roth.com/press/High-Tech-Graffiti-Spray-Paint-Is-So-20th-Century-New-York-Times.pdf',
        'liberation_url':
        'http://evan-roth.com/press/C-est-graff-docteur.pdf',
        'time_url':
        'http://www.time.com/time/photogallery/0,29307,1911799_1912685,00.html',
        'cnn_url':
        'http://edition.cnn.com/2010/TECH/web/09/10/gif.images/index.html',
        'guardian_url':
        'http://www.guardian.co.uk/search?search=%22evan+roth%22&sitesearch-radio=guardian&go-guardian=Search',
        'abc_url':
        'http://abcnews.go.com/Technology/popup?id=2425229',
        'esquire_url':
        'http://www.esquire.com/features/best-brightest-2007/graffiti1207',
        'juxtapoz_url':
        'http://evan-roth.com/press/juxtapoz-2010-10-oct-eroth.pdf',
    }
    return render_response(request, 'evan-roth.html', evan_urls)
Пример #12
0
def mark_sammy(request):
    mark = get_object_or_404(Mark, reference=mark_reference)
    return render_response(request, 'sammy/mark.html', {'mark': mark})
Пример #13
0
def mozilla(request):
    return render_response(request, 'mozilla.html')
Пример #14
0
def about_gml(request):
    return render_response(request, 'gml.html')
Пример #15
0
def coming_soon(request):
    return render_response(request, 'coming_soon.html')
Пример #16
0
def credits(request):
    return render_response(request, 'credits.html')
Пример #17
0
def newsletter(request):
    form = EmailSubscribeForm()
    return render_response(request, 'newsletter.html', {'form': form})
Пример #18
0
def home(request):
    mr = settings.MEDIA_ROOT
    return render_response(request, 'home.html', {'mr': mr})
Пример #19
0
def manifesto(request):
    return render_response(request, 'manifesto.html')
Пример #20
0
def moderate_sammy(request):
    if not request.user.is_authenticated():
        return HttpResponseRedirect('/accounts/login/')
    else:
        return render_response(request, 'sammy/moderate.html')
Пример #21
0
def about(request):
    return render_response(request, 'about.html')
Пример #22
0
def home(request):
    mr = settings.MEDIA_ROOT
    return render_response(request, 'home.html', {'mr': mr})
Пример #23
0
def mozilla(request):
    return render_response(request, 'mozilla.html')
Пример #24
0
def code(request):
    return render_response(request, 'code.html')
Пример #25
0
def credits(request):
    return render_response(request, 'credits.html')
Пример #26
0
def makemark_sammy(request):
    mark_form = MarkForm()
    return render_response(request, 'sammy/makemark.html', {'form': mark_form})
Пример #27
0
def account_locked(request):
    return render_response(request, 'registration/locked.html')
Пример #28
0
def account_locked(request):
    return render_response(request, 'registration/locked.html')
Пример #29
0
def manifesto(request):
    return render_response(request, 'manifesto.html')
Пример #30
0
def moderate_sammy(request):
    if not request.user.is_authenticated():
        return HttpResponseRedirect('/accounts/login/')
    else:
        return render_response(request, 'sammy/moderate.html')
Пример #31
0
def makemark_sammy(request):
    mark_form = MarkForm()
    return render_response(request, 'sammy/makemark.html', {'form': mark_form})
Пример #32
0
def about(request):
    return render_response(request, 'about.html')
Пример #33
0
def linear_sammy(request):
    return render_response(request, 'sammy/linear.html')
Пример #34
0
def about_gml(request):
    return render_response(request, 'gml.html')
Пример #35
0
def newsletter(request):
    form = EmailSubscribeForm()
    return render_response(request, 'newsletter.html', {'form': form})
Пример #36
0
def code(request):
    return render_response(request, 'code.html')
Пример #37
0
def linear_sammy(request):
    return render_response(request, 'sammy/linear.html')
Пример #38
0
def mark(request, mark_reference):
    mark = get_object_or_404(Mark, reference=mark_reference)
    return render_response(request, 'mark.html', {'mark': mark})
Пример #39
0
def coming_soon(request):
    return render_response(request, 'coming_soon.html')