Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tree.twig 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {% extends 'layout_page.twig' %}
  2. {% set page = 'files' %}
  3. {% block content %}
  4. {% embed 'breadcrumb.twig' with {breadcrumbs: breadcrumbs} %}
  5. {% block extra %}
  6. <div class="pull-right">
  7. <div class="btn-group download-buttons">
  8. <a href="{{ app.clone_url }}{{ repo }}" class="btn btn-default btn-xs" title="Clone '{{ repo }}'"><span class="fa fa-cloud-download"></span> Clone</a>
  9. <a href="{{ app.path_prefix }}{{ path('archive', {repo: repo, branch: branch, format: 'zip'}) }}" class="btn btn-default btn-xs" title="Download '{{ branch }}' as a ZIP archive">ZIP</a>
  10. <a href="{{ app.path_prefix }}{{ path('archive', {repo: repo, branch: branch, format: 'tar'}) }}" class="btn btn-default btn-xs" title="Download '{{ branch }}' as a TAR archive">TAR</a>
  11. </div>
  12. </div>
  13. {% endblock %}
  14. {% endembed %}
  15. {% if files is not empty %}
  16. <table class="table tree">
  17. <thead>
  18. <tr>
  19. <th width="80%">Name</th>
  20. <th width="10%">Mode</th>
  21. <th width="10%">Size</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. {% if parent is not null %}
  26. <tr>
  27. <td>
  28. {% if not parent %}
  29. <a href="{{ app.path_prefix }}{{ path('branch', {repo: repo, branch: branch}) }}">..</a>
  30. {% else %}
  31. <a href="{{ app.path_prefix }}{{ path('tree', {repo: repo, commitishPath: branch ~ '/' ~ parent}) }}">..</a>
  32. {% endif %}
  33. </td>
  34. <td></td>
  35. <td></td>
  36. </tr>
  37. {% endif %}
  38. {% for file in files %}
  39. <tr>
  40. <td><span class="fa {{ file.type == "folder" or file.type == "symlink" ? "fa-folder-open" : "fa-file" }}"></span> <a href="
  41. {%- if file.type == "folder" or file.type == "symlink" -%}
  42. {{ app.path_prefix }}{{ path('tree', {repo: repo, commitishPath: branch ~ '/' ~ path ~ (file.type == "symlink" ? file.path : file.name)}) }}
  43. {%- else -%}
  44. {{ app.path_prefix }}{{ path('blob', {repo: repo, commitishPath: branch ~ '/' ~ path ~ (file.type == "symlink" ? file.path : file.name)}) }}
  45. {%- endif -%}
  46. ">{{ file.name }}</a></td>
  47. <td>{{ file.mode }}</td>
  48. <td>{% if file.size %}{{ (file.size / 1024) | number_format }} kb{% endif %}</td>
  49. </tr>
  50. {% endfor %}
  51. </tbody>
  52. </table>
  53. {% else %}
  54. <p>This repository is empty.</p>
  55. {% endif %}
  56. {% if readme is defined and readme is not empty %}
  57. <div class="readme-view">
  58. <div class="md-header">
  59. <span class="meta">{{ readme.filename }}</span>
  60. </div>
  61. <div id="md-content">{{ readme.content }}</div>
  62. </div>
  63. {% endif %}
  64. {% endblock %}