From cce589d9b309679c8ea0a9bbed88e0093c1927f0 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 20 Feb 2007 19:53:26 -0800 Subject: more git_browse files --- .../git_browse/templates/git_browse/base.html | 3 ++- .../git_browse/templates/git_browse/heads_table | 23 +++++++++++++++++ bn_django/git_browse/templates/git_browse/obj.html | 12 ++++++--- .../templates/git_browse/repository_info.html | 2 +- .../git_browse/templates/git_browse/shortlog_table | 29 ++++++++++++++++++++++ .../git_browse/templates/git_browse/tags_table | 23 +++++++++++++++++ .../git_browse/templates/git_browse/tree.html | 19 ++++++++------ .../git_browse/templates/git_browse/tree_table | 23 +++++++++++++++++ bn_django/git_browse/urls.py | 5 ++-- bn_django/git_browse/views.py | 2 +- 10 files changed, 123 insertions(+), 18 deletions(-) create mode 100644 bn_django/git_browse/templates/git_browse/heads_table create mode 100644 bn_django/git_browse/templates/git_browse/shortlog_table create mode 100644 bn_django/git_browse/templates/git_browse/tags_table create mode 100644 bn_django/git_browse/templates/git_browse/tree_table (limited to 'bn_django') diff --git a/bn_django/git_browse/templates/git_browse/base.html b/bn_django/git_browse/templates/git_browse/base.html index d23ab55..1656ce0 100644 --- a/bn_django/git_browse/templates/git_browse/base.html +++ b/bn_django/git_browse/templates/git_browse/base.html @@ -10,8 +10,9 @@ {% block path %} {{ block.super }} +code {% if object %} - {{ object.name }} + » {{ object.name }} [browse, log] {% endif %} diff --git a/bn_django/git_browse/templates/git_browse/heads_table b/bn_django/git_browse/templates/git_browse/heads_table new file mode 100644 index 0000000..5840db0 --- /dev/null +++ b/bn_django/git_browse/templates/git_browse/heads_table @@ -0,0 +1,23 @@ +{% if heads %} + +{% for h in heads.iteritems %} + + + + +{% endfor %} +
+ + {{ h.0 }} + {% if tags %}{% for t in tags.iteritems %} + {% ifequal h.1 t.1 %} + + [{{ t.0 }}] + {% endifequal %}{% endfor %}{% endif %} + + {{ h.1 }} +
+{% else %}No heads!{% endif %} + diff --git a/bn_django/git_browse/templates/git_browse/obj.html b/bn_django/git_browse/templates/git_browse/obj.html index 0170eab..669091b 100644 --- a/bn_django/git_browse/templates/git_browse/obj.html +++ b/bn_django/git_browse/templates/git_browse/obj.html @@ -2,10 +2,14 @@ {% block gitbrowse %} {% if contents %} -

Object sha1 hash: {{ hash }}
- Size: {{ size|filesizeformat }}
- Type: "{{ type }}"

-
{{ contents }}
+

Object sha1 hash

+ {{ hash }}
+

Size

+ {{ size|filesizeformat }}
+

Type

+ "{{ type }}" +

Raw Description

+
{{ contents }}
{% else %}

No such object: {{ hash }}

{% endif %} 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 f45eeb8..9be33ee 100644 --- a/bn_django/git_browse/templates/git_browse/repository_info.html +++ b/bn_django/git_browse/templates/git_browse/repository_info.html @@ -2,7 +2,7 @@ {% block gitbrowse %} {{ object.description }} -

Shortlog (full log)

+

Shortlog (full log) (last commit)

{% include "git_browse/shortlog_table" %}

Heads (browse)

{% include "git_browse/heads_table" %} diff --git a/bn_django/git_browse/templates/git_browse/shortlog_table b/bn_django/git_browse/templates/git_browse/shortlog_table new file mode 100644 index 0000000..8a223ec --- /dev/null +++ b/bn_django/git_browse/templates/git_browse/shortlog_table @@ -0,0 +1,29 @@ +{% if shortlog %} + +{% for l in shortlog %} + + + + + +{% endfor %} +
+ {{ l.date }} + {{ l.author }} + + {{ l.description|truncatewords:10 }} + {% if heads %}{% for h in heads.iteritems %} + {% ifequal h.1 l.hash %} + + [{{ h.0 }}] + {% endifequal %} + {% endfor %}{% endif %} + {% if tags %}{% for t in tags.iteritems %} + {% ifequal l.hash t.1 %} + + [{{ t.0 }}] + {% endifequal %}{% endfor %}{% endif %} + + + {{ l.shorthash }}...
+{% else %}No shortlog!{% endif %} diff --git a/bn_django/git_browse/templates/git_browse/tags_table b/bn_django/git_browse/templates/git_browse/tags_table new file mode 100644 index 0000000..7df504a --- /dev/null +++ b/bn_django/git_browse/templates/git_browse/tags_table @@ -0,0 +1,23 @@ +{% if tags %} + +{% for t in tags.iteritems %} + + + + +{% endfor %} +
+ + {{ t.0 }} + {% for h in heads.iteritems %} + {% ifequal h.1 t.1 %} + + [{{ h.0 }}] + {% endifequal %} + {% endfor %} + + {{ t.1 }}
+{% else %}No tags!{% endif %} diff --git a/bn_django/git_browse/templates/git_browse/tree.html b/bn_django/git_browse/templates/git_browse/tree.html index 046d85c..3c8c294 100644 --- a/bn_django/git_browse/templates/git_browse/tree.html +++ b/bn_django/git_browse/templates/git_browse/tree.html @@ -2,19 +2,22 @@ {% block gitbrowse %} - {% if all_objs %}

Tree sha1 hash:


{{ hash }}

Directory listing:

- {% for obj in all_objs %} -[{{obj.type}}] - {% ifequal obj.type 'blob'%} - {{obj.name}} {% else %} - {% ifequal obj.type 'tree'%} - {{obj.name}} + {% include tree_table %} + {% if tree_objs %} + {% for o in tree_objs %} + [{{o.type}}] {{ o.mode }} + {% ifequal o.type 'blob' %} + {{o.name}} + {% else %} + {% ifequal o.type 'tree' %} + {{o.name}} {% else %} - {{obj.name}} + {{o.name}} {% endifequal %}{% endifequal %}
{% endfor %} + {% else %}No contents! {% endif %} {% endblock %} diff --git a/bn_django/git_browse/templates/git_browse/tree_table b/bn_django/git_browse/templates/git_browse/tree_table new file mode 100644 index 0000000..7df504a --- /dev/null +++ b/bn_django/git_browse/templates/git_browse/tree_table @@ -0,0 +1,23 @@ +{% if tags %} + +{% for t in tags.iteritems %} + + + + +{% endfor %} +
+ + {{ t.0 }} + {% for h in heads.iteritems %} + {% ifequal h.1 t.1 %} + + [{{ h.0 }}] + {% endifequal %} + {% endfor %} + + {{ t.1 }}
+{% else %}No tags!{% endif %} diff --git a/bn_django/git_browse/urls.py b/bn_django/git_browse/urls.py index 77fabd3..4806f66 100644 --- a/bn_django/git_browse/urls.py +++ b/bn_django/git_browse/urls.py @@ -35,9 +35,8 @@ urlpatterns += patterns('bn_django.git_browse.views', (r'^(?P[\w\-\_]*)/branches/$', 'view_branches',), (r'^(?P[\w\-\_]*)/log/$', 'view_log',), (r'^(?P[\w\-\_]*)/obj/(?P[0-9a-z]{40})/$', 'view_obj',), - (r'^(?P[\w\-\_]*)/obj/(?P[0-9a-z]{40})/log/$', 'view_log',), - (r'^(?P[\w\-\_]*)/commit/(?P[0-9a-z]{40})/$', 'view_commit',), - (r'^(?P[\w\-\_]*)/commit/$', 'view_commit',), + (r'^(?P[\w\-\_]*)/commit/(?P[0-9a-z]{40})/$', 'view_obj',), + (r'^(?P[\w\-\_]*)/commit/$', 'view_obj',), (r'^(?P[\w\-\_]*)/tag/(?P[0-9a-z]{40})/$', 'view_tag',), (r'^(?P[\w\-\_]*)/blob/(?P[0-9a-z]{40})/$', 'view_blob',), (r'^(?P[\w\-\_]*)/blob/(?P[0-9a-z]{40})/raw/$', 'view_blob',), diff --git a/bn_django/git_browse/views.py b/bn_django/git_browse/views.py index 3439c35..8a84241 100644 --- a/bn_django/git_browse/views.py +++ b/bn_django/git_browse/views.py @@ -57,7 +57,7 @@ def view_tree(request, repo, hash=None,branch=None): if l[1] == 'tree': tree_objs.append(tree_from_str(line)) if l[1] == 'blob': - blob_objs.append(blob_from_str(line)) + tree_objs.append(blob_from_str(line)) return render_to_response('git_browse/tree.html', dict(object=therepo, -- cgit v1.2.3