aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/git_wiki
diff options
context:
space:
mode:
authorbnewbold <bnewbold@manus.(none)>2007-02-21 01:06:47 -0800
committerbnewbold <bnewbold@manus.(none)>2007-02-21 01:06:47 -0800
commit34ce40fdb73eda0ae07ef62ddc713a4651b9bc7c (patch)
tree855728a24c7f63daa8d3adb7b10a3b155a371ab1 /bn_django/git_wiki
parente9e6055c9fe102f0151ce4c3e33fd2f78c894f0a (diff)
downloadbnewnet-34ce40fdb73eda0ae07ef62ddc713a4651b9bc7c.tar.gz
bnewnet-34ce40fdb73eda0ae07ef62ddc713a4651b9bc7c.zip
created skeleton for git_wiki app
Diffstat (limited to 'bn_django/git_wiki')
-rw-r--r--bn_django/git_wiki/settings.py7
-rw-r--r--bn_django/git_wiki/templates/git_wiki/base.html39
-rw-r--r--bn_django/git_wiki/templates/git_wiki/frontpage.html36
-rw-r--r--bn_django/git_wiki/urls.py26
-rw-r--r--bn_django/git_wiki/views.py42
5 files changed, 150 insertions, 0 deletions
diff --git a/bn_django/git_wiki/settings.py b/bn_django/git_wiki/settings.py
new file mode 100644
index 0000000..bb81610
--- /dev/null
+++ b/bn_django/git_wiki/settings.py
@@ -0,0 +1,7 @@
+
+# full path to directory holding the wiki repository (or sys links to
+# the repositories)
+GITWIKI_BASE = '/home/bnewbold/knowledge/'
+
+# fill path to the git command
+GITCOMMAND = '/usr/local/bin/git'
diff --git a/bn_django/git_wiki/templates/git_wiki/base.html b/bn_django/git_wiki/templates/git_wiki/base.html
new file mode 100644
index 0000000..6107c04
--- /dev/null
+++ b/bn_django/git_wiki/templates/git_wiki/base.html
@@ -0,0 +1,39 @@
+{% extends "base.html" %}
+
+{% block stylesheets %}
+{{ block.super }}
+<link rel="STYLESHEET" type="text/css" href="style/git_wiki.css">
+<link rel="STYLESHEET" type="text/css" href="/style/git_wiki.css">
+<!--<link rel="STYLESHEET" type="text/css" href="http://static.bryannewbold.com/style/git_wiki.css">-->
+
+{% endblock %}
+
+{% block path %}
+{{ block.super }}
+<a href="/knowledge">knowledge</a>
+{% if item %}
+ &raquo; <a href="/k/{{ item.slug }}/">{{ object.title }}</a>
+{% endif %}
+{% endblock %}
+
+{% block title %}
+{% if item %}
+{{ item.title }}
+{% endif %}
+{% endblock %}
+
+{% block content %}
+{% if item %}
+ {% block gitwiki %}
+ {% endblock %}
+ <br />
+ <span class="righty">
+ <a href="/k/{{ item.slug }}/pdf/">pdf</a> - <a href="/k/{{ item.slug }}/log">log</a>
+ </span>
+ <br />
+{% else %}
+<p>No such knowledge!</p>
+<p>Perhaps you meant...</p>
+{% endif %}
+
+{% endblock %}
diff --git a/bn_django/git_wiki/templates/git_wiki/frontpage.html b/bn_django/git_wiki/templates/git_wiki/frontpage.html
new file mode 100644
index 0000000..897bf8b
--- /dev/null
+++ b/bn_django/git_wiki/templates/git_wiki/frontpage.html
@@ -0,0 +1,36 @@
+{% extends "git_wiki/base.html" %}
+
+{% block title %}Knowledge Repository{% endblock %}
+
+{% block right_stuff %}
+<br />
+Get some knowledge: <br />
+ &nbsp; - <a href="http://wikipedia.org"> wikipedia</a><br />
+ &nbsp; - <a href="http://archive.org"> internet archive</a><br />
+ &nbsp; - <a href="http://mathworld.com"> mathworld</a>
+{% endblock %}
+
+{% block content %}
+<div class="notice">
+<center><b>This site is under active development!</b></center>
+<p />There are undoubtedly bugs, errors, aesthetic travesties, ommissions, etc.
+If you're curious you can track my work in the <a href="/code">code</a> section.
+</div>
+
+<div class="right_stuff">
+For more recent content see the <a href="/timeline/">timeline</a>
+</div>
+
+<h3>Latest knowledge</h3>
+{% if latest_knowledge %}
+{% else %}
+None yet!
+{% endif %}
+<hr />
+<h3>Latest comments</h3>
+{% if latest_comments %}
+{% else %}
+None yet!
+{% endif %}
+
+{% endblock %}
diff --git a/bn_django/git_wiki/urls.py b/bn_django/git_wiki/urls.py
new file mode 100644
index 0000000..98cedc4
--- /dev/null
+++ b/bn_django/git_wiki/urls.py
@@ -0,0 +1,26 @@
+from django.conf.urls.defaults import *
+from django.conf import settings
+
+from models import *
+
+try:
+ GITWIKI_BASE = settings.GITWIKI_BASE
+except AttributeError:
+ GITWIKI_BASE='/home/usr/doc/'
+
+try:
+ ADMIN_URL = settings.ADMIN_URL
+except AttributeError:
+ ADMIN_URL='/admin'
+if ADMIN_URL[-1] == '/':
+ ADMIN_URL=ADMIN_URL[:-1]
+
+info_dict = { 'extra_context': { 'admin_url': ADMIN_URL,
+ } }
+
+urlpatterns = patterns('bn_django.git_wiki.views',
+ (r'^(?P<hash>[0-9a-z]{40})/$', 'olditem',),
+ (r'^(?P<req>.+)/$', 'item',),
+ (r'^(?P<req>.+)/log/$', 'item',),
+ (r'^(?P<req>.+)/edit/$', 'item',)
+)
diff --git a/bn_django/git_wiki/views.py b/bn_django/git_wiki/views.py
index 60f00ef..d9ce15f 100644
--- a/bn_django/git_wiki/views.py
+++ b/bn_django/git_wiki/views.py
@@ -1 +1,43 @@
+import settings
+from django import forms, http, template
+from django.contrib.auth.decorators import login_required
+from django.shortcuts import get_object_or_404, render_to_response
+from django.http import HttpResponse
+
+import os, commands
+
+from models import *
+
+try:
+ GITWIKI_BASE = settings.GITWIKI_BASE+'/'
+except AttributeError:
+ GITWIKI_BASE='/home/'
+
+try:
+ GITCOMMAND = settings.GITCOMMAND
+except AttributeError:
+ GITCOMMAND='git'
+
+
# Create your views here.
+
+def frontpage(request):
+
+ return render_to_response('git_wiki/frontpage.html', \
+ dict())
+
+def item(request, req=''):
+ #GITPREFIX = models.getGITPREFIX()
+ #i = Item()
+ #i.update()
+
+ return render_to_response('git_browse/item.html',
+ dict(item=i))
+
+def olditem(request, hash):
+ #GITPREFIX = models.getGITPREFIX()
+ #i = Item()
+ #i.update()
+
+ return render_to_response('git_browse/olditem.html',
+ dict(item=i))