summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/projects/admin.py14
-rw-r--r--apps/projects/models/__init__.py3
-rw-r--r--apps/projects/models/code.py25
-rw-r--r--apps/projects/views.py2
-rw-r--r--base_urls.py2
-rw-r--r--media/img/chricon.jpgbin0 -> 1827 bytes
-rw-r--r--media/img/fficon.jpgbin0 -> 1795 bytes
-rw-r--r--templates/details/code.html62
8 files changed, 105 insertions, 3 deletions
diff --git a/apps/projects/admin.py b/apps/projects/admin.py
index c128c86..a0f1a16 100644
--- a/apps/projects/admin.py
+++ b/apps/projects/admin.py
@@ -163,6 +163,20 @@ class NationalParksAdmin(OSMGeoAdmin):
#debug = False
#widget = OpenLayersWidget
+from django.contrib import admin
+
+from projects.models.code import Code
+
+class CodeAdmin(admin.ModelAdmin):
+ list_display = ('name', 'date_created', 'status')
+ search_fields = ['name','body_html']
+ list_filter = ['status',]
+ fieldsets = (
+ (None, {'fields': ('name','date_created','slug','status','body_html')}),
+ )
+
+admin.site.register(Code, CodeAdmin)
+
admin.site.register(Project, ProjectAdmin)
admin.site.register(FiveBy, FiveByAdmin)
admin.site.register(NationalParks, NationalParksAdmin) \ No newline at end of file
diff --git a/apps/projects/models/__init__.py b/apps/projects/models/__init__.py
index fdee7fc..7fe6077 100644
--- a/apps/projects/models/__init__.py
+++ b/apps/projects/models/__init__.py
@@ -1,3 +1,4 @@
from base import Project
from fiveby import FiveBy
-from natparks import NationalParks \ No newline at end of file
+from natparks import NationalParks
+from code import Code \ No newline at end of file
diff --git a/apps/projects/models/code.py b/apps/projects/models/code.py
new file mode 100644
index 0000000..14a66f0
--- /dev/null
+++ b/apps/projects/models/code.py
@@ -0,0 +1,25 @@
+from django.db import models
+
+
+PUB_STATUS = (
+ (0, 'Draft'),
+ (1, 'Published'),
+ )
+
+
+
+class Code(models.Model):
+ name = models.CharField(max_length=254)
+ slug = models.SlugField()
+ date_created = models.DateField('Date Created')
+ status = models.IntegerField(choices=PUB_STATUS, default=0)
+ body_html = models.TextField(blank=True)
+
+ class Meta:
+ verbose_name_plural = "Code"
+ app_label = 'projects'
+ ordering = ('-date_created',)
+ # Returns the string representation of the model.
+ def __unicode__(self):
+ return self.slug
+
diff --git a/apps/projects/views.py b/apps/projects/views.py
index 65de8ae..64857a7 100644
--- a/apps/projects/views.py
+++ b/apps/projects/views.py
@@ -10,7 +10,7 @@ from projects.models.base import Project
from projects.models.fiveby import FiveBy
from projects.models.natparks import NationalParks
-projects = {'5x5':'FiveBy','6x6':'SixBy','national-parks':'NationalParks'}
+projects = {'5x5':'FiveBy','6x6':'SixBy','national-parks':'NationalParks','code':'Code'}
"""
Projects by slug
diff --git a/base_urls.py b/base_urls.py
index 24acc93..1b18ce6 100644
--- a/base_urls.py
+++ b/base_urls.py
@@ -43,7 +43,7 @@ urlpatterns += patterns('',
urlpatterns += patterns('',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/filebrowser/', include('filebrowser.urls')),
- (r'^admin/', include(admin.site.urls),{'SSL':True}),
+ (r'^admin/', include(admin.site.urls),{'SSL':False}),
(r'^grappelli/', include('grappelli.urls')),
(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
(r'^robots.txt$', direct_to_template, {'template': 'archives/robots.html'}),
diff --git a/media/img/chricon.jpg b/media/img/chricon.jpg
new file mode 100644
index 0000000..466c76e
--- /dev/null
+++ b/media/img/chricon.jpg
Binary files differ
diff --git a/media/img/fficon.jpg b/media/img/fficon.jpg
new file mode 100644
index 0000000..5b0cc42
--- /dev/null
+++ b/media/img/fficon.jpg
Binary files differ
diff --git a/templates/details/code.html b/templates/details/code.html
new file mode 100644
index 0000000..da76f0a
--- /dev/null
+++ b/templates/details/code.html
@@ -0,0 +1,62 @@
+{% extends 'base.html' %}
+{% load typogrify %}
+{% block pagetitle %}Luxagraf | Projects | Code and Other Experiments {% endblock %}
+{% block metadescription %}{% endblock %}
+{% block extrahead %}
+<style>
+#page-header {margin: 2em 0 0 0;}
+article[role="main"] header {margin-top: 0;}
+article[role="main"] a { color: #b53a04;}
+#ffext, #chrext, #bkmklt {
+ display: block;
+ margin: 20px 0;
+}
+#ffext a, #chrext a, #bkmklt a {
+ padding: 10px 8px 10px 35px;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ border: #d7d7d7 1px solid;
+ background: #f2f2f2;
+ width: auto;
+ font: 11px normal Helvetica, Verdana, sans-serif;
+ text-transform: uppercase;
+}
+#ffext a {
+ background: #f2f2f2 url("{{MEDIA_URL}}img/fficon.jpg") 2px 50% no-repeat;
+}
+#chrext a {
+ background: #f2f2f2 url("{{MEDIA_URL}}img/chricon.jpg") 2px 50% no-repeat;
+}
+#ffext a:hover, #chrext a:hover, #bkmklt a:hover { background-color: #e2e2e2;}
+#bkmklt a {
+ padding: 10px 8px;
+}
+</style>
+{% endblock %}
+{%block bodyid%}id="code"{%endblock%}
+
+{% block primary %}<section id="page-header">
+ <h1 class="hide">The National Parks Project</h1>
+ <nav>
+ <ul id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
+ <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> &rarr;</li>
+ <li><a href="/projects/" title="luxagraf projects page" itemprop="url"><span itemprop="title">Projects</span></a> &rarr;</li>
+ <li>Code</li>
+ </ul>
+ </nav>
+ </section>
+ <article role="main">
+ {% for object in object_list %}
+ <header>
+ <h1>{{object.name}}</h1>
+ </header>
+ <div id="post-body">
+ {{object.body_html|smartypants|widont|safe}}
+ </div>
+ {% endfor %}
+ </article>
+
+
+
+{% endblock %}