diff --git a/www/conservancy/static/img/projects/microblocks.png b/www/conservancy/static/img/projects/microblocks.png
new file mode 100644
index 00000000..e15b6c79
Binary files /dev/null and b/www/conservancy/static/img/projects/microblocks.png differ
diff --git a/www/conservancy/static/projects/current/index.html b/www/conservancy/static/projects/current/index.html
index fc430c68..8442a4ec 100644
--- a/www/conservancy/static/projects/current/index.html
+++ b/www/conservancy/static/projects/current/index.html
@@ -467,6 +467,18 @@ speed, bandwidth distribution, and redundancy of an optimized hybrid
mirror/peer-to-peer network, without any questions of legality, integrity,
or safety.
+
+
+
+
+
+
+MicroBlocks is a new programming language that runs right inside microcontroller boards such as the micro:bit, the NodeMCU and many Arduino boards. The MicroBlocks system allows for dynamic, parallel and interactive programming, but with the twist of letting your projects run autonomously inside the board without being tethered to a computer.
+
diff --git a/www/conservancy/static/views.py b/www/conservancy/static/views.py
index a07296ce..bbf2f56b 100644
--- a/www/conservancy/static/views.py
+++ b/www/conservancy/static/views.py
@@ -1,8 +1,10 @@
import mimetypes
import os.path
from django.http import HttpResponse
-from django.template import RequestContext, loader
-from conservancy.apps.fundgoal.models import FundraisingGoal as FundraisingGoal
+from django.template.response import TemplateResponse
+
+from conservancy.apps.fundgoal.models import FundraisingGoal
+from conservancy.local_context_processors import fundgoal_lookup
STATIC_ROOT = os.path.abspath(os.path.dirname(__file__))
FILESYSTEM_ENCODING = 'utf-8'
@@ -11,10 +13,9 @@ def handler(request, errorcode):
path = os.path.join('error', str(errorcode), 'index.html')
fullpath = os.path.join(STATIC_ROOT, path)
if not os.path.exists(fullpath):
- return HttpResponse("Internal error: " + path)
- template = loader.get_template(path)
- context = RequestContext(request)
- return HttpResponse(template.render(context), status=int(errorcode))
+ return HttpResponse("Internal error: " + path, status=int(errorcode))
+ else:
+ return TemplateResponse(request, path, status=int(errorcode))
def handler401(request):
return handler(request, 401)
@@ -28,13 +29,6 @@ def handler404(request):
def handler500(request):
return handler(request, 500)
-def fundgoal_lookup(fundraiser_sought):
- try:
- return FundraisingGoal.objects.get(fundraiser_code_name=fundraiser_sought)
- except FundraisingGoal.DoesNotExist:
- # we have no object! do something
- return None
-
def index(request, *args, **kwargs):
path = request.path.lstrip(u'/')
if path.endswith(u'/'):
@@ -49,23 +43,16 @@ def index(request, *args, **kwargs):
return handler404(request)
content_type, _ = mimetypes.guess_type(path)
if content_type != 'text/html':
- content = open(fullpath)
+ return HttpResponse(open(fullpath, 'rb'), content_type)
else:
- content_type = None # Let Django use its default
- template = loader.get_template(path)
-
- kwargs = kwargs.copy()
- if kwargs.has_key('fundraiser_sought'):
- kwargs['fundgoal'] = fundgoal_lookup(kwargs['fundraiser_sought'])
-
- kwargs['sitefundgoal'] = fundgoal_lookup('supporterrun')
-
- context = RequestContext(request, kwargs)
- content = template.render(context)
- return HttpResponse(content, content_type)
+ context = kwargs.copy()
+ try:
+ context['fundgoal'] = fundgoal_lookup(kwargs['fundraiser_sought'])
+ except KeyError:
+ pass
+ return TemplateResponse(request, path, context)
def debug(request):
path = request.get_full_path()
path = path.lstrip('/')
return HttpResponse("Hello, static world: " + path)
-
diff --git a/www/conservancy/templates/base_conservancy.html b/www/conservancy/templates/base_conservancy.html
index 080f4580..1e12166a 100644
--- a/www/conservancy/templates/base_conservancy.html
+++ b/www/conservancy/templates/base_conservancy.html
@@ -62,7 +62,6 @@ this_match_remaining: this_match_goal - this_match_so_far
{% endcomment %}
-{% comment %}
{% if sitefundgoal %}
{% with this_match_goal=sitefundgoal.fundraiser_goal_amount this_match_so_far=sitefundgoal.fundraiser_so_far_amount %}
{% with this_match_remaining=this_match_goal|subtract:this_match_so_far %}
@@ -96,7 +95,6 @@ this_match_remaining: this_match_goal - this_match_so_far
{% endwith %}
{% endwith %}
{% endif %}
-{% endcomment %}
{% block outercontent %} {% block content %}{% endblock %}
{% endblock %}