diff options
author | bnewbold <bnewbold@manus.(none)> | 2007-02-18 18:47:15 -0800 |
---|---|---|
committer | bnewbold <bnewbold@manus.(none)> | 2007-02-18 18:47:15 -0800 |
commit | de7fbaadb211650a73c68509f8b87cb93effdd2a (patch) | |
tree | a1ae85534c4716b10f94379148cb62115c5a1918 | |
parent | 0c7c01d4ff1635cb7f04bed3d099b30b967f44bd (diff) | |
download | bnewnet-de7fbaadb211650a73c68509f8b87cb93effdd2a.tar.gz bnewnet-de7fbaadb211650a73c68509f8b87cb93effdd2a.zip |
removed knowledge directory, filled in front page, continued git_browse
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | bn_django/git_browse/templates/git_browse/repository_info.html | 5 | ||||
-rw-r--r-- | bn_django/git_browse/templates/git_browse/repository_list.html | 7 | ||||
-rw-r--r-- | bn_django/git_browse/templates/git_browse/tree.html | 12 | ||||
-rw-r--r-- | bn_django/git_browse/urls.py | 3 | ||||
-rw-r--r-- | bn_django/git_browse/views.py | 15 | ||||
-rw-r--r-- | bn_django/templates/base.html | 3 | ||||
-rw-r--r-- | bn_django/templates/frontpage.html | 119 | ||||
-rw-r--r-- | bn_django/urls.py | 13 | ||||
-rw-r--r-- | knowledge/dummy_stub | 3 | ||||
-rw-r--r-- | static/style/default.css | 46 |
11 files changed, 142 insertions, 85 deletions
@@ -5,3 +5,4 @@ bn_django/bn_django.db *.pyc *.pyo *.swp +knowledge diff --git a/bn_django/git_browse/templates/git_browse/repository_info.html b/bn_django/git_browse/templates/git_browse/repository_info.html index bec150c..72f30b1 100644 --- a/bn_django/git_browse/templates/git_browse/repository_info.html +++ b/bn_django/git_browse/templates/git_browse/repository_info.html @@ -1,8 +1,11 @@ {% extends "git_browse/base.html" %} {% block gitbrowse %} +{{ object.description }} {% if shortlog %} -<h3>Shortlog</h3> +<h3>Shortlog (<a href="/code/{{object.slug}}/log/">full log</a>)</h3> <pre>{{ shortlog }}</pre> +<h3>Filelist (<a href="/code/{{object.slug}}/tree/">browse</a>)</h3> +<pre>{{ filelist }}</pre> {% endif %} {% endblock %} diff --git a/bn_django/git_browse/templates/git_browse/repository_list.html b/bn_django/git_browse/templates/git_browse/repository_list.html index a089fec..106c0e8 100644 --- a/bn_django/git_browse/templates/git_browse/repository_list.html +++ b/bn_django/git_browse/templates/git_browse/repository_list.html @@ -5,11 +5,14 @@ {% block title %}Code Repositories{% endblock %} {% block content %} +<div class="notice"> +Until this is better developed I would recommend trying <a href="http://git.bryannewbold.com/">gitweb</a>. +</div> {% if object_list %} {% for item in object_list %} <div class="righty"><br /> - <a href="{{ item.slug }}/tree/">tree</a> - - <a href="{{ item.slug }}/changelog/">changelog</a> + <a href="{{ item.slug }}/tree/">browse</a> - + <a href="{{ item.slug }}/log/">changelog</a> </div> <h3><a href="{{ item.slug }}/">{{ item.name }}</a> (aka {{ item.slug }})</h3> {{ item.description }} diff --git a/bn_django/git_browse/templates/git_browse/tree.html b/bn_django/git_browse/templates/git_browse/tree.html index 22162da..046d85c 100644 --- a/bn_django/git_browse/templates/git_browse/tree.html +++ b/bn_django/git_browse/templates/git_browse/tree.html @@ -1,10 +1,20 @@ {% extends "git_browse/base.html" %} {% block gitbrowse %} + {% if all_objs %} + <h3>Tree sha1 hash:</h3><br /> {{ hash }}<br /> <h3>Directory listing:</h3> {% for obj in all_objs %} -[{{obj.type}}] <a href='../obj/{{ obj.id }}/'>{{obj.name}}</a> <br /> +[{{obj.type}}] + {% ifequal obj.type 'blob'%} + <a href='/code/{{ object.slug }}/obj/{{ obj.id }}/'>{{obj.name}}</a> {% else %} + {% ifequal obj.type 'tree'%} + <a href='/code/{{object.slug}}/tree/{{ obj.id }}/'>{{obj.name}}</a> + {% else %} + <a href='/code/{{object.slug}}/obj/{{ obj.id }}/'>{{obj.name}}</a> + {% endifequal %}{% endifequal %} + <br /> {% endfor %} {% endif %} {% endblock %} diff --git a/bn_django/git_browse/urls.py b/bn_django/git_browse/urls.py index 91e9baa..909bfcd 100644 --- a/bn_django/git_browse/urls.py +++ b/bn_django/git_browse/urls.py @@ -36,5 +36,6 @@ urlpatterns += patterns('bn_django.git_browse.views', (r'^(?P<repo>[\w\-\_]*)/branches/$', 'view_branches',), (r'^(?P<repo>[\w\-\_]*)/history/$', 'view_history',), (r'^(?P<repo>[\w\-\_]*)/log/$', 'view_log',), - (r'^(?P<repo>[\w\-\_]*)/obj/(?P<hash>[0-9a-z]*)/$', 'view_obj',), + (r'^(?P<repo>[\w\-\_]*)/obj/(?P<hash>[0-9a-z]{40})/$', 'view_obj',), + (r'^(?P<repo>[\w\-\_]*)/tree/(?P<hash>[0-9a-z]{40})/$', 'view_tree',), ) diff --git a/bn_django/git_browse/views.py b/bn_django/git_browse/views.py index 9e3ba90..c8a7a40 100644 --- a/bn_django/git_browse/views.py +++ b/bn_django/git_browse/views.py @@ -27,20 +27,24 @@ def repo_info(request, repo,branch=None): GITPREFIX = 'cd ' + GITBROWSE_BASE + therepo.slug + '; ' + GITCOMMAND + ' --git-dir=' + GITBROWSE_BASE + therepo.slug + '/.git ' shortlog = commands.getoutput(GITPREFIX + ' log | ' + GITCOMMAND + '-shortlog') + filelist = commands.getoutput(GITPREFIX + ' ls-files') return render_to_response('git_browse/repository_info.html', dict(object=therepo, + filelist=filelist, shortlog=shortlog,)) -def view_tree(request, repo, tree_hash=None,branch=None): +def view_tree(request, repo, hash=None,branch=None): therepo = get_object_or_404(Repository, slug=repo) GITPREFIX = 'cd ' + GITBROWSE_BASE + therepo.slug + '; ' + GITCOMMAND + ' --git-dir=' + GITBROWSE_BASE + therepo.slug + '/.git ' - head_ref = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug +'/.git; cat HEAD') - head_ref = head_ref.split()[1] - head = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug +'/.git; cat ' + head_ref) - tree_ls = commands.getoutput(GITPREFIX + ' ls-tree ' + head) + if(hash == None): + head_ref = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug +'/.git; cat HEAD') + head_ref = head_ref.split()[1] + hash = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug +'/.git; cat ' + head_ref) + + tree_ls = commands.getoutput(GITPREFIX + ' ls-tree ' + hash) tree_objs = list() blob_objs = list() for line in tree_ls.splitlines(): @@ -56,6 +60,7 @@ def view_tree(request, repo, tree_hash=None,branch=None): dict(object=therepo, blob_objs=blob_objs, tree_objs=tree_objs, + hash=hash, all_objs=tree_objs+blob_objs,)) def view_log(request, repo, tree_hash=None, branch=None): diff --git a/bn_django/templates/base.html b/bn_django/templates/base.html index cee3641..63bdbda 100644 --- a/bn_django/templates/base.html +++ b/bn_django/templates/base.html @@ -20,7 +20,8 @@ <div class="right_stuff"> <form name="search"> <br/> -<input class="search_box" type="text" size="20" value=" search!" name="search_text" id="search_text" onFocus="if (this.value == this.defaultValue) this.value=''; return;" /> +<input class="search_box" type="text" size="21" value=" search!" name="search_text" id="search_text" onFocus="if (this.value == this.defaultValue) this.value=''; return;" /> +<br />style options # # # # <span class="righty"></span> </form> </div> diff --git a/bn_django/templates/frontpage.html b/bn_django/templates/frontpage.html index d73070e..9dacccd 100644 --- a/bn_django/templates/frontpage.html +++ b/bn_django/templates/frontpage.html @@ -5,82 +5,69 @@ {% block title %}A Brave New Bold World!{% endblock %} {% block right_stuff %} +<br /> Other sites: <br /> - <a href="http://web.mit.edu/bnewbold/www"> athena locker</a><br /> - - <a href="http://gitweb.bryannewbold.com"> git repository</a> + - <a href="http://git.bryannewbold.com"> git repository</a> {% endblock %} {% block content %} - There will be more forthcoming ... - There will be more stuff forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... +<div class="notice"> +<center><b>This site is under active development!</b></center> +<p /> There are undoubtedly bugs, errors, aesthetic travesties, ommissions, etc (notably the <a href="/knowledge">knowledge</a> section isn't anything yet). +If you're curious you can track my work in the <a href="/code">code</a> section. +<p />In the meanwhile you can get your bryan newbold fix at my <a href="http://web.mit.edu/bnewbold/www">old site</a>. +</div> + <h3>Where am I?</h3> +For 2007 i'm taking a year break from <a href="http://web.mit.edu">MIT</a>... +<!-- <div class="righty_content"> -<b> - there is no spoon! there is no spoon! - there is no spoon! there is no spoon! - there is no spoon! there is no spoon! -</b> +<b> Are you going to Burning Man? Let me know...</b> </div> +--> + +as of February i'm living in Seattle working at <a href="http://azalea.com/AboutUs">Azalea Software</a> doing tech work. Starting in mid-May i'll be working at the Moss Landing Marine Labs in California, followed in October by field work in Antartica. I will be back at MIT for the spring 2008 semester. +<hr /> - There will be more forthcoming ... - There will be more stuff forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - </div></div> -<div class="content" id="main_title"> <div class="right_stuff"> -what if i put more content over here? also, will it wrap correctly? +For more recent content see the <a href="/timeline/">timeline</a> +</div> + + +<div class="col_right"> +<div class="col_title">Latest knowledge</div> +{% if latest_knowledge %} +{% else %} +None yet! +<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> +{% endif %} +</div> + +<div class="col_center"> +<div class="col_title">Latest comments</div> +{% if latest_comments %} +{% else %} +None yet! +<br /><br /> <br /> <br /> +<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> +{% endif %} +</div> + +<div class="col_left"> +<div class="col_title">Latest photos</div> +{% if latest_photos %} +<div class="centerize"> +{% for photo in latest_photos %} +<a href="{{ photo.get_absolute_url }}"><img src="{{ photo.thumburl }}" /></a> +<br /> +{% endfor %} </div> +{% else %} +<br/><br />None yet! +<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> +{% endif %} </div> -<div class="content"> - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more stuff forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more stuff forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... - There will be more forthcoming ... +<br /> <br /> <br /> <br /> +<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> {% endblock %} diff --git a/bn_django/urls.py b/bn_django/urls.py index 327e9ec..1993f26 100644 --- a/bn_django/urls.py +++ b/bn_django/urls.py @@ -1,21 +1,30 @@ from django.conf.urls.defaults import * +from photos.models import Photo urlpatterns = patterns('', # Example: # (r'^bn_django/', include('bn_django.foo.urls')), - (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'frontpage.html'}), + (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'frontpage.html','extra_context':dict({ \ + 'latest_photos':Photo.objects.order_by('date')[:2] \ + #'latest_comments':Photo.objects.order_by('date')[:4] \ + #'latest_knowledge':Photo.objects.order_by('date')[:4] \ + })}), (r'^about/$', 'django.views.generic.simple.direct_to_template', {'template': 'about.html'}), (r'^credits/$', 'django.views.generic.simple.direct_to_template', {'template': 'credits.html'}), (r'^copyright/$', 'django.views.generic.simple.direct_to_template', {'template': 'copyright.html'}), (r'^knowledge/', include('bn_django.git_wiki.urls')), + (r'^k/', include('bn_django.git_wiki.urls')), (r'^code/', include('bn_django.git_browse.urls')), (r'^photos/', include('bn_django.photos.urls')), + + (r'^search/', include('bn_django.search.urls')), # Uncomment this for admin: (r'^admin/', include('django.contrib.admin.urls')), - (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home/bnewbold/bn-project/static', 'show_indexes': True}), + + (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home/bnewbold/bn-project/static', 'show_indexes': True}), (r'^style/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home/bnewbold/bn-project/static/style'}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home/bnewbold/bn-project/media'}), ) diff --git a/knowledge/dummy_stub b/knowledge/dummy_stub deleted file mode 100644 index b95de2d..0000000 --- a/knowledge/dummy_stub +++ /dev/null @@ -1,3 +0,0 @@ -this is a dummy file for the knowledge dir... - -i don't know much yet! diff --git a/static/style/default.css b/static/style/default.css index 5edddc7..585b54d 100644 --- a/static/style/default.css +++ b/static/style/default.css @@ -21,14 +21,14 @@ h3 { p { margin: 0px; } hr { - height: 12px; - padding: 2px; + height: 14px; + padding: 1px; background-color: black; padding: 0px; width: 100%; border: none; margin: 0px; - border-top: 5px solid #FFFFFF; + border-top: 8px solid #FFFFFF; border-bottom: 5px solid #FFFFFF; border-left: 55px solid #FFFFFF; border-right: 55px solid #FFFFFF; } @@ -45,6 +45,7 @@ pre { .search_box { border: 1px solid black; padding: 1px; + margin-bottom: 4px; font-size: 12px; font-weight: bold; background-color: #F8F8F8; @@ -81,12 +82,51 @@ pre { .righty_content img { border: 1px solid black; width: 90%; } +.col_title { + width: 100%; + margin-bottom: 7px; + text-align: center; + font-weight: bold; + font-family: serif; + font-size: 14px; +} +.col_left { + width: 24%; + margin-top: 3px; + padding: 5px; + float: right; +} +.col_center { + width: 38%; + margin-top: 3px; + padding: 5px; + float: right; + border-left: 1px solid black; + border-right: 1px solid black; +} +.col_right { + width: 31%; + left: 67%; + margin-top: 3px; + margin-right: 1%; + padding: 5px; + float: right; + left: 0px; + top: 0px; +} .content_caption { text-align: center; font-style: italic; width: 100%; font-size: small; font-family: courier; } +.notice { + padding: 8px; + background-color: yellow; + margin-right: 70px; + margin-left: 70px; + margin-bottom: 10px; + border: 2px solid orange; } .lefty { float: left; } .righty { |