Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
protonpopsicle committed Mar 19, 2014
0 parents commit f9df694
Show file tree
Hide file tree
Showing 2,303 changed files with 258,891 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.pyc
*.DS_Store
site_media/
search_index/
sitemaps/
logs/
venv/
.sass-cache/
rhizome/local_settings.py
local_settings.py
fabfile.py
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@


/rza

staffuser
123

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

Installation
============

clone repo

```bash
virtualenv venv
```

note: 2.6.5 or newer
if multiple versions on system, specify w/ -p flag:

```bash
virtualenv -p /usr/local/bin/python venv
```

```bash
sh sysop_setup_local.sh
```

```bash
Could not access or create artbase CouchDB database
```

```bash
Failed to install index for...
```

Empty file added about/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions about/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from django.contrib import admin
from models import Press, StaffMember


class PressAdmin(admin.ModelAdmin):

class Meta:
model = Press

class StaffMemberAdmin(admin.ModelAdmin):
raw_id_fields = ('user',)

class Meta:
model = StaffMember

admin.site.register(Press,PressAdmin)
admin.site.register(StaffMember,StaffMemberAdmin)
55 changes: 55 additions & 0 deletions about/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import datetime

from django.db import models
from django.contrib.auth.models import User
from django.utils.html import strip_tags

from countries.models import Country, UsState
from utils.helpers import clean_html

class StaffMember(models.Model):
user = models.ForeignKey(User, null=True, blank=True)
first_name = models.CharField(max_length = 100)
last_name = models.CharField(max_length = 100)
position = models.CharField(max_length = 100)
bio = models.TextField()
email = models.EmailField()
url = models.URLField(max_length = 255,null=True,blank=True)

def __unicode__(self):
return '%s' % (self.email)


def save(self, *args, **kwargs):
''' On save, clean HTML '''
self.bio = clean_html(self.bio)
super(StaffMember, self).save(*args, **kwargs)

def press_upload_to(self, filename):
title = filename.split('.')[0]
extension = filename.split('.')[-1]
#add check extension logic
self.image = 'about/press/%s.%s' % (title,extension)
return 'about/press/%s.%s' % (title,extension)

class Press(models.Model):
publication = models.CharField(max_length = 255)
article_title = models.CharField(max_length = 255)
article_url = models.URLField(max_length = 255)
publication_date = models.DateField()
excerpt = models.TextField()
article_full_text = models.TextField(null=True, blank=True)
document = models.FileField(null=True, blank=True,upload_to = press_upload_to)

def __unicode__(self):
return '%s on %s' % (self.publication, self.publication_date)

class Meta:
verbose_name = "Press Clipping"
verbose_name_plural = "Press Clippings"

def save(self, *args, **kwargs):
''' On save, clean HTML '''
self.excerpt = clean_html(self.excerpt)
self.article_full_text = clean_html(self.article_full_text)
super(Press, self).save(*args, **kwargs)
8 changes: 8 additions & 0 deletions about/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.conf.urls.defaults import patterns, url
from about.views import about, policy, press

urlpatterns = patterns('',
url(r'^$', about, name='about-about'),
url(r'^policy/$', policy, name='about-policy'),
url(r'^press/$', press, name='about-press'),
)
27 changes: 27 additions & 0 deletions about/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from django.template.context import RequestContext
from django.shortcuts import render_to_response
from utils.template import RhizomePaginator

from about.models import StaffMember, Press


def about(request):
return render_to_response('about/about.html', {
'breadcrumb': (('About', None),),
'staff_members': StaffMember.objects.all().order_by('last_name'),
}, RequestContext(request))

def press(request):
press = Press.objects.all().order_by('-publication_date')
press_paginator = RhizomePaginator(press, per_page=15, url=request.get_full_path())
press_paginator.set_current_page(request.GET.get('page'))

return render_to_response('about/press.html', {
'breadcrumb': (('Press', None),),
'press_paginator': press_paginator,
}, RequestContext(request))

def policy(request):
return render_to_response('about/policy.html', {
'breadcrumb': (('Policy', None),),
}, RequestContext(request))
Empty file added accounts/__init__.py
Empty file.
Loading

0 comments on commit f9df694

Please sign in to comment.