file_history.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. {% extends "repo_master.html" %}
  2. {% block title %}File history - {{ repo.fullname }}{% endblock %}
  3. {% set tag = "home" %}
  4. {% block header %}
  5. <link nonce="{{ g.nonce }}" rel="stylesheet" href="{{
  6. url_for('static', filename='vendor/highlight.js/styles/github.css') }}?version={{ g.version}}"/>
  7. <style nonce="{{ g.nonce }}">
  8. .hljs {
  9. background: #fff;
  10. }
  11. </style>
  12. {% endblock %}
  13. {% block repo %}
  14. <div class="row m-b-1">
  15. <div class="col-sm-6">
  16. <h3>
  17. History {{ filename }}
  18. </h3>
  19. </div>
  20. <div class="col-sm-6">
  21. <div class="float-right">
  22. {% if branchname %}
  23. <div class="btn-group">
  24. <button type="button" class="btn btn-outline-light border-secondary text-dark btn-sm dropdown-toggle"
  25. data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  26. <span class="fa fa-random fa-fw"></span> Branch: <span class="font-weight-bold">{{ branchname }}</span>
  27. </button>
  28. <div class="dropdown-menu dropdown-menu-right">
  29. {% for branch in g.branches %}
  30. {% if origin == 'view_tree' %}
  31. <a class="dropdown-item" href="{{ url_for(
  32. 'ui_ns.view_tree',
  33. repo=repo.name,
  34. username=username,
  35. namespace=repo.namespace,
  36. identifier=branch) }}">
  37. {{ branch }}
  38. </a>
  39. {% elif origin == 'view_file' %}
  40. <a class="dropdown-item" href="{{ url_for(
  41. 'ui_ns.view_file',
  42. repo=repo.name,
  43. username=username,
  44. namespace=repo.namespace,
  45. identifier=branch,
  46. filename=filename | unicode ) }}">
  47. {{ branch }}
  48. </a>
  49. {% endif %}
  50. {% endfor %}
  51. </div>
  52. </div>
  53. {% endif %}
  54. </div>
  55. </div>
  56. </div>
  57. <div class="card">
  58. <div class="card-header">
  59. <ol class="breadcrumb p-0 bg-transparent mb-0">
  60. <li class="breadcrumb-item">
  61. <a href="{{ url_for('ui_ns.view_tree',
  62. repo=repo.name,
  63. username=username,
  64. namespace=repo.namespace,
  65. identifier=branchname)
  66. }}">
  67. <span class="fa fa-random">
  68. </span>&nbsp; {{ branchname }}
  69. </a>
  70. </li>
  71. {% set path = '' %}
  72. {% for file in filename.split('/') %}
  73. {% if loop.first %}
  74. {% set path = file %}
  75. {% else %}
  76. {% set path = path + '/' + file %}
  77. {% endif %}
  78. {% if loop.index != loop.length %}<li class="breadcrumb-item"><a
  79. href="{{ url_for('ui_ns.view_file',
  80. repo=repo.name,
  81. username=username,
  82. namespace=repo.namespace,
  83. identifier=branchname,
  84. filename=path | unicode)}}">
  85. <span class="fa fa-folder"></span>&nbsp; {{ file }}</a>
  86. </li>
  87. {% elif file %}
  88. <li class="breadcrumb-item active">
  89. <span class="fa {% if output_type == 'tree' %}fa-folder{% else %}fa-file{% endif %}">
  90. </span>&nbsp; {{ file }}
  91. </li>
  92. {% endif %}
  93. {% endfor %}
  94. </ol>
  95. </div>
  96. {% if log %}
  97. <div class="card-block p-a-0">
  98. <div class="bg-light border pr-2">
  99. <div class="list-group my-2">
  100. {% for line in log %}
  101. {% set commit = g.repo_obj[line[0]] %}
  102. <div class="list-group-item " id="c_{{ commit.hex }}">
  103. <div class="row align-items-center">
  104. <div class="col">
  105. <a href="{{ url_for('ui_ns.view_commit',
  106. repo=repo.name,
  107. username=username,
  108. namespace=repo.namespace,
  109. commitid=commit.hex, branch=branchname) }}"
  110. class="notblue">
  111. <strong>{{ commit.message.split('\n')[0] }}</strong>
  112. </a>
  113. <div>
  114. {{commit.author|author2user_commits(
  115. link=url_for('ui_ns.view_commits',
  116. repo=repo.name,
  117. branchname=branchname,
  118. username=username,
  119. namespace=repo.namespace,
  120. author=commit.author.email),
  121. cssclass="notblue")|safe}}
  122. <span class="commitdate"
  123. title="{{ commit.commit_time|format_ts }}"> &bull;
  124. {{ commit.commit_time|humanize }}</span>&nbsp;&nbsp;
  125. <span id="commit-actions"></span>
  126. </div>
  127. </div>
  128. <div class="col-xs-auto pr-3 text-right">
  129. <div class="btn-group">
  130. <a href="{{ url_for('ui_ns.view_commit',
  131. repo=repo.name,
  132. username=username,
  133. namespace=repo.namespace,
  134. commitid=commit.hex, branch=branchname) }}"
  135. class="btn btn-outline-primary font-weight-bold commithash" id="c_{{ commit.hex }}">
  136. <code>{{ commit.hex|short }}</code>
  137. </a>
  138. <a class="btn btn-outline-primary font-weight-bold" href="{{ url_for(
  139. 'ui_ns.view_tree', username=username, namespace=repo.namespace,
  140. repo=repo.name, identifier=commit.hex) }}"><span class="fa fa-file-code-o fa-fw"></span></a>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. {% endfor %}
  146. </div>
  147. </div>
  148. </div>
  149. {% else %}
  150. No history found for this file in this repository
  151. {% endif %}
  152. </div> <!-- end .card-->
  153. {% endblock %}
  154. {% block jscripts %}
  155. {{ super() }}
  156. <script type="text/javascript" nonce="{{ g.nonce }}">
  157. $(document).ready(function () {
  158. $('.fork_project_btn').click($("[name=fork_project]").submit);
  159. });
  160. </script>
  161. {% endblock %}