diff --git a/izanami/main.py b/izanami/main.py index f67a2ef..3dd117f 100644 --- a/izanami/main.py +++ b/izanami/main.py @@ -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 ( @@ -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.' @@ -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 diff --git a/izanami/templates/repo/retrieve.html b/izanami/templates/repo/retrieve.html index a44fd30..79b25d8 100644 --- a/izanami/templates/repo/retrieve.html +++ b/izanami/templates/repo/retrieve.html @@ -32,7 +32,11 @@ {% if tree %} {% for obj in tree %}
  • + {% if isblob(obj) %} {{ obj.name }} + {% else %} + {{ obj.path }} + {% endif %}
  • {% endfor %} {% endif %} diff --git a/poetry.lock b/poetry.lock index cbb9db5..4381b2e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -349,7 +349,7 @@ python-versions = "*" [[package]] name = "mitama" -version = "4.5.23" +version = "4.5.26" description = "" category = "dev" optional = false @@ -1056,7 +1056,7 @@ mccabe = [ {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, ] mitama = [ - {file = "mitama-4.5.23-py3-none-any.whl", hash = "sha256:09dae2d12145f35d3e6fd2c812ffa52ed14ad2564fd83206630b8047c905af7e"}, + {file = "mitama-4.5.26-py3-none-any.whl", hash = "sha256:ec3a91800a9b072735ab93a9d7306a705206522afa2f50a0a791fb05d156399d"}, ] mypy-extensions = [ {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"},