Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
boke0 committed Mar 12, 2021
1 parent 1afe695 commit fef0f0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions izanami/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
CsrfMiddleware
)
from mitama.app.method import view
from git.objects.blob import Blob

# from .controller import RepoController, ProxyController, HookController
from .controller import (
Expand All @@ -18,6 +19,10 @@
from .model import Repo, Merge, InnerPermission


def isblob(obj):
return isinstance(obj, Blob)


class App(App):
name = 'Izanami'
description = 'Git server for Mitama.'
Expand Down Expand Up @@ -59,6 +64,7 @@ def init_app(self):
def view(self):
view = super().view
view.globals.update(
isblob=isblob,
permission=InnerPermission.is_accepted,
)
return view
4 changes: 4 additions & 0 deletions izanami/templates/repo/retrieve.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
{% if tree %}
{% for obj in tree %}
<li class='list-group-item'>
{% if isblob(obj) %}
<a href='{{ url('/' + repo.name + '/blob/' + current_head + '/' + obj.name) }}'>{{ obj.name }}</a>
{% else %}
<a href='{{ url('/' + repo.name + '/tree/' + obj.path) }}'>{{ obj.path }}</a>
{% endif %}
</li>
{% endfor %}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fef0f0b

Please sign in to comment.