diff --git a/www/conservancy/__init__.py b/www/conservancy/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..648278312b89233be6fc9da08f2b30f24991a0a4 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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/www/conservancy/apps/contractpatch/urls.py b/www/conservancy/apps/contractpatch/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..2d877ffaf363d6c19d65fa3979bc19c18ffcd5b0 --- /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 0000000000000000000000000000000000000000..4202552e26bfbcc078065a9c1607d5ef75a9bdb7 --- /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 7b4096b59e773f314e08e0edf20b7d95fd5491d9..e78386b8ae502a3aa32d56578f922f3c078d2ff8 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 0000000000000000000000000000000000000000..6597ff8364d673e528a72c7719d916e03a96b542 --- /dev/null +++ b/www/conservancy/templates/contractpatch/index.html @@ -0,0 +1,39 @@ +{% extends "base_conservancy.html" %} + +{% block head %} + +{% endblock %} + +{% block content %} +

ContractPatch

+ +
Everything is negotiable
+ +

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.

+ +

Follow ContractPatch

+ +

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.

+ +

Blog posts

+ +{# FIXME: This is duplicated from blog/entry_list.html #} +{% for entry in blog_entries %} +

{{ entry.headline|safe }}

+ {{ entry.body|safe }} +

Posted by {{ entry.author.formal_name }} on {{ entry.pub_date|date:"F j, Y" }} + {% if entry.tags.all %}/ Tags: {% for tag in entry.tags.all %}{{ tag.label }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endif %} +

+{% endfor %} + +

Read all ContractPatch blog posts…

+{% endblock %} diff --git a/www/conservancy/urls.py b/www/conservancy/urls.py index 32e4e8e4720ac7d72eb390c5a07f4bb2901b7544..cd57ff4a404e08ccb3d7bfe2d0f9b2925446556a 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'),