repo: show hooks version and update link in advanced section of repository.

This commit is contained in:
Marcin Kuzminski 2019-01-10 12:10:28 +01:00
parent 23771fb157
commit 89024101a8
2 changed files with 34 additions and 0 deletions

View file

@ -779,6 +779,9 @@ class BaseRepository(object):
def install_hooks(self, force=False):
return self._remote.install_hooks(force)
def get_hooks_info(self):
return self._remote.get_hooks_info()
class BaseCommit(object):
"""

View file

@ -113,6 +113,37 @@
</div>
<div class="panel panel-default">
<div class="panel-heading" id="advanced-hooks">
<h3 class="panel-title">${_('Hooks')} <a class="permalink" href="#advanced-hooks"> ¶</a></h3>
</div>
<div class="panel-body">
<% ver_info_dict = c.rhodecode_db_repo.scm_instance().get_hooks_info() %>
<table class="rctable">
<th>${_('Hook type')}</th>
<th>${_('Hook version')}</th>
<th>${_('Current version')}</th>
<tr>
<td>${_('PRE HOOK')}</td>
<td>${ver_info_dict['pre_version']}</td>
<td>${c.rhodecode_version}</td>
</tr>
<tr>
<td>${_('POST HOOK')}</td>
<td>${ver_info_dict['post_version']}</td>
<td>${c.rhodecode_version}</td>
</tr>
</table>
<a href="${h.route_path('edit_repo_advanced_hooks', repo_name=c.repo_name)}"
onclick="return confirm('${_('Confirm to reinstall hooks for this repository.')}');">
${_('Update Hooks')}
</a>
</div>
</div>
<div class="panel panel-warning">
<div class="panel-heading" id="advanced-archive">
<h3 class="panel-title">${_('Archive repository')} <a class="permalink" href="#advanced-archive"> ¶</a></h3>