Changeset - 8fec6023e964
[Not reviewed]
0 3 4
Brett Smith (brett) - 6 years ago 2016-11-28 20:23:58
contractpatch: Add page.
7 files changed with 73 insertions and 13 deletions:
0 comments (0 inline, 0 general)
Show inline comments
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,
Show inline comments
new file 100644
Show inline comments
new file 100644
from django.conf.urls import patterns, url, include

urlpatterns = patterns(
    (r'', 'conservancy.apps.contractpatch.views.index'),
Show inline comments
new file 100644
from conservancy import render_template_with_context
from import Entry as BlogEntry
from datetime import datetime

def index(request):
    filters = {
        'tags__slug': 'ContractPatch',
    context = {
        'blog_entries': BlogEntry.objects.filter(**filters)[:3],
    return render_template_with_context(request, "contractpatch/index.html", context)
Show inline comments
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 import PressRelease
from import Entry as BlogEntry
from datetime import datetime, timedelta
from datetime import datetime

def view(request):
    """Conservancy front page view

    Performs all object queries necessary to render the front page.

    supporters_count = len(Supporter.objects.all().filter(
    press_releases = PressRelease.objects.all().filter(, sites=2)[:5]
    blog = BlogEntry.objects.all().filter([:5]

    c = {
        'press_releases': press_releases,
        'supporters_count': supporters_count,
        'blog' : blog
    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)
Show inline comments
new file 100644
{% extends "base_conservancy.html" %}

{% block head %}
#subhed {
  margin-top: -0.8em;
  font-style: italic;
{% endblock %}

{% block content %}

<div id="subhed">Everything is negotiable</div>

<p style="clear: both;">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.</p>

<p>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.</p>

<h3>Follow ContractPatch</h3>

<p><a href="">Subscribe to our discussion mailing list.</a>  This is a great place to talk about issues in employment agreements, and suggest what ContractPatch might tackle next.</p>

<p><a href="">Follow ContractPatch on Twitter.</a></p>

<h3>Blog posts</h3>

{# FIXME: This is duplicated from blog/entry_list.html #}
{% for entry in blog_entries %}
    <h3><a href="{{ entry.get_absolute_url }}">{{ entry.headline|safe }}</a></h3>
        {{ entry.body|safe }}
    <p class="date small">Posted by <strong>{{ }}</strong> on {{ entry.pub_date|date:"F j, Y" }}
    {% if entry.tags.all %}<span class="blog-tags">/ Tags: {% for tag in entry.tags.all %}<a href="{{ tag.get_absolute_url }}">{{ tag.label }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</span>{% endif %}
{% endfor %}

<p><span class="continued"><a href="/blog/?tag=ContractPatch">Read all ContractPatch blog posts…</a></span></p>
{% endblock %}
Show inline comments
# Copyright 2005-2008, James Garrison
# Copyright 2010, 2012 Bradley M. Kuhn

# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute, modify and/or redistribute modified versions of
# this program under the terms of the GNU Affero General Public License
# (AGPL) as published by the Free Software Foundation (FSF), either
# version 3 of the License, or (at your option) any later version of the
# AGPL published by the FSF.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program in a file in the toplevel directory called
# "AGPLv3".  If not, see <>.

from django.conf.urls import patterns, url, include
from django.contrib import admin

# import conservancy.settings
from django.conf import settings
from conservancy.feeds import BlogFeed, PressReleaseFeed, OmnibusFeed
# from django.views.static import serve
# from django.conf.urls.static import static
# from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# import conservancy.static.overview.views

# handler404 = 'modpythoncustom.view404'
# handler401 = 'conservancy.static.views.handler401'
# handler403 = 'conservancy.static.views.handler403'
handler404 = 'conservancy.static.views.handler404'
# handler500 = 'conservancy.static.views.handler500'


urlpatterns = patterns('',
    (r'^$', 'conservancy.frontpage.view'),
    (r'^sponsors$', 'conservancy.frontpage.view'),
    (r'^sponsors/$', 'conservancy.sponsors.view'),
    (r'^sponsors/index.html$', 'conservancy.sponsors.view'),
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^feeds/blog/?$', BlogFeed()),
    (r'^feeds/news/?$', PressReleaseFeed()),
    (r'^feeds/omnibus/?$', OmnibusFeed()),
    (r'^feeds/?$', 'conservancy.feeds.view'),
    (r'^news(/|$)', include('')),
    (r'^blog(/|$)', include('')),
    # formerly static templated things... (dirs with templates)
    (r'^error', 'conservancy.static.views.index'),
    (r'^about', 'conservancy.static.views.index'),
    (r'^donate', 'conservancy.static.views.index'),
    (r'^copyleft-compliance', 'conservancy.static.views.index',
                           {'fundraiser_sought' : 'vmware-match-0'}),
    (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'),
    (r'^fundraiser_data', 'conservancy.apps.fundgoal.views.view'),

# urlpatterns += url(regex  = r'^%s(?P<path>.*)$' % conservancy.settings.STATIC_URL[1:],
# urlpatterns += url(regex  = r'^/overview',
#                    view   = 'django.views.static.serve',
#                    kwargs = {'document_root': conservancy.settings.STATIC_ROOT,
#                              'show_indexes' : True})
# urlpatterns += (r'^(?P<path>.*)$', 'django.views.static.serve', 
# urlpatterns += (r'^overview/$', 'django.views.static.serve', 
#                 {'document_root': conservancy.settings.STATIC_ROOT,
#                  'show_indexes' : True})

#  + static(conservancy.settings.STATIC_URL, document_root=conservancy.settings.STATIC_ROOT)

# urlpatterns += staticfiles_urlpatterns()

# urlpatterns += static(settings.STATIC_URL, view='django.contrib.staticfiles.views.serve',
# urlpatterns += static('/', view='django.contrib.staticfiles.views.serve',
#                       document_root=settings.STATIC_ROOT,
#                       show_indexes=True)




0 comments (0 inline, 0 general)