diff --git a/www/conservancy/__init__.py b/www/conservancy/__init__.py index e69de29b..64827831 100644 --- a/www/conservancy/__init__.py +++ b/www/conservancy/__init__.py @@ -0,0 +1,6 @@ +from django.shortcuts import render_to_response +from django.template import RequestContext + +def render_template_with_context(request, template_path, context_dict): + return render_to_response(template_path, context_dict, + context_instance=RequestContext(request)) diff --git a/www/conservancy/apps/contractpatch/__init__.py b/www/conservancy/apps/contractpatch/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/www/conservancy/apps/contractpatch/urls.py b/www/conservancy/apps/contractpatch/urls.py new file mode 100644 index 00000000..2d877ffa --- /dev/null +++ b/www/conservancy/apps/contractpatch/urls.py @@ -0,0 +1,6 @@ +from django.conf.urls import patterns, url, include + +urlpatterns = patterns( + '', + (r'', 'conservancy.apps.contractpatch.views.index'), +) diff --git a/www/conservancy/apps/contractpatch/views.py b/www/conservancy/apps/contractpatch/views.py new file mode 100644 index 00000000..4202552e --- /dev/null +++ b/www/conservancy/apps/contractpatch/views.py @@ -0,0 +1,13 @@ +from conservancy import render_template_with_context +from conservancy.apps.blog.models import Entry as BlogEntry +from datetime import datetime + +def index(request): + filters = { + 'pub_date__lte': datetime.now(), + 'tags__slug': 'ContractPatch', + } + context = { + 'blog_entries': BlogEntry.objects.filter(**filters)[:3], + } + return render_template_with_context(request, "contractpatch/index.html", context) diff --git a/www/conservancy/frontpage.py b/www/conservancy/frontpage.py index 7b4096b5..e78386b8 100644 --- a/www/conservancy/frontpage.py +++ b/www/conservancy/frontpage.py @@ -1,10 +1,8 @@ -from django.shortcuts import render_to_response -from conservancy import context_processors as context_processors -from django.template import RequestContext +from conservancy import render_template_with_context from conservancy.apps.supporters.models import Supporter as Supporter from conservancy.apps.news.models import PressRelease from conservancy.apps.blog.models import Entry as BlogEntry -from datetime import datetime, timedelta +from datetime import datetime def view(request): """Conservancy front page view @@ -12,13 +10,10 @@ def view(request): Performs all object queries necessary to render the front page. """ - supporters_count = len(Supporter.objects.all().filter(display_until_date__gte=datetime.now())) - press_releases = PressRelease.objects.all().filter(pub_date__lte=datetime.now(), sites=2)[:5] - blog = BlogEntry.objects.all().filter(pub_date__lte=datetime.now())[:5] - - c = { - 'press_releases': press_releases, - 'supporters_count': supporters_count, - 'blog' : blog + now = datetime.now() + context = { + 'press_releases': PressRelease.objects.all().filter(pub_date__lte=now, sites=2)[:5], + 'supporters_count': len(Supporter.objects.all().filter(display_until_date__gte=now)), + 'blog': BlogEntry.objects.all().filter(pub_date__lte=now)[:5], } - return render_to_response("frontpage.html", c, context_instance=RequestContext(request)) + return render_template_with_context(request, "frontpage.html", context) diff --git a/www/conservancy/templates/contractpatch/index.html b/www/conservancy/templates/contractpatch/index.html new file mode 100644 index 00000000..6597ff83 --- /dev/null +++ b/www/conservancy/templates/contractpatch/index.html @@ -0,0 +1,39 @@ +{% extends "base_conservancy.html" %} + +{% block head %} + +{% endblock %} + +{% block content %} +
Many free and open source software developers sign employment agreements with their employers. These agreements can affect whether and how developers contribute to FOSS—whether it’s done as part of their employment, after hours, or both. ContractPatch is Conservancy’s initiative to give developers the words they need to make sure they can continue to do the work that’s important to them and our community. Whether those words are negotiation tactics for the hiring process, or language to suggest for a prospective employment agreement, ContractPatch helps developers defend their own interests.
+ +In the coming months, we’ll write about legal and strategic points in contract negotiation strategies, pre-negotiation prep and practice, methods for negotiating, and general information on your legal rights around contracts. We’ll also look at specific contract provisions—especially those that impact tech workers the most, such as non-compete agreements and intellectual property assignment clauses. This will all go hand-in-hand with a Git repository with forkable sample language for key contract provisions, such as payment terms, benefits, non-competition and non-solicitation agreements, and intellectual property assignment clauses.
+ +Subscribe to our discussion mailing list. This is a great place to talk about issues in employment agreements, and suggest what ContractPatch might tackle next.
+ +Follow ContractPatch on Twitter.
+ +Posted by {{ entry.author.formal_name }} on {{ entry.pub_date|date:"F j, Y" }} + {% if entry.tags.all %}
+{% endfor %} + + {% endif %} + +{% endblock %} diff --git a/www/conservancy/urls.py b/www/conservancy/urls.py index 32e4e8e4..cd57ff4a 100644 --- a/www/conservancy/urls.py +++ b/www/conservancy/urls.py @@ -58,6 +58,7 @@ urlpatterns = patterns('', (r'^projects', 'conservancy.static.views.index'), (r'^npoacct', 'conservancy.static.views.index', {'fundraiser_sought' : 'npoacct'}), + (r'^contractpatch', include('conservancy.apps.contractpatch.urls')), (r'^overview', 'conservancy.static.views.index'), (r'^privacy-policy', 'conservancy.static.views.index'), (r'^supporter', 'conservancy.static.views.index'),