A bit refactoring.

This commit is contained in:
Roman Vynar
2018-07-04 17:31:15 +03:00
parent e163b5af27
commit d1ce70490c
9 changed files with 100 additions and 75 deletions

View File

@@ -15,7 +15,7 @@
<h2>Docker Registry UI</h2>
</div>
<div style="float: right">
<a href="{{ base_path }}/events">Event Log</a>
<a href="{{ basePath }}/events">Event Log</a>
</div>
<div style="clear: both"></div>

View File

@@ -14,7 +14,7 @@
{{block body()}}
<ol class="breadcrumb">
<li><a href="{{ base_path }}/">Home</a></li>
<li><a href="{{ basePath }}/">Home</a></li>
<li class="active">Event Log</li>
</ol>

View File

@@ -8,10 +8,10 @@
"stateSave": true
});
$('#namespace').on('change', function (e) {
window.location = '{{ base_path }}/' + this.value;
window.location = '{{ basePath }}/' + this.value;
});
namespace = window.location.pathname;
namespace = namespace.replace("{{ base_path }}", "");
namespace = namespace.replace("{{ basePath }}", "");
if (namespace == '/') {
namespace = 'library';
} else {
@@ -37,7 +37,7 @@
</div>
<ol class="breadcrumb">
<li><a href="{{ base_path }}/">Home</a></li>
<li><a href="{{ basePath }}/">Home</a></li>
</ol>
<table id="datatable" class="table table-striped table-bordered">
@@ -50,7 +50,7 @@
<tbody>
{{range repo := repos}}
<tr>
<td><a href="{{ base_path }}/{{ namespace }}/{{ repo|url_encoded_path }}">{{ repo }}</a></td>
<td><a href="{{ basePath }}/{{ namespace }}/{{ repo|url }}">{{ repo }}</a></td>
<td>{{ tagCounts[namespace+"/"+repo] }}</td>
</tr>
{{end}}

View File

@@ -4,11 +4,11 @@
{{block body()}}
<ol class="breadcrumb">
<li><a href="{{ base_path }}/">Home</a></li>
<li><a href="{{ basePath }}/">Home</a></li>
{{if namespace != "library"}}
<li><a href="{{ base_path }}/{{ namespace }}">{{ namespace }}</a></li>
<li><a href="{{ basePath }}/{{ namespace }}">{{ namespace }}</a></li>
{{end}}
<li><a href="{{ base_path }}/{{ namespace }}/{{ repo|url_decoded_path }}">{{ repo }}</a></li>
<li><a href="{{ basePath }}/{{ namespace }}/{{ repo }}">{{ repo|url_decode }}</a></li>
<li class="active">{{ tag }}</li>
</ol>
<table class="table table-striped table-bordered">

View File

@@ -1,7 +1,7 @@
{{extends "base.html"}}
{{block head()}}
<script type="text/javascript" src="{{ base_path }}/static/bootstrap-confirmation.min.js"></script>
<script type="text/javascript" src="{{ basePath }}/static/bootstrap-confirmation.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/natural.js"></script>
<script type="text/javascript">
$(document).ready(function() {
@@ -29,11 +29,11 @@
{{block body()}}
<ol class="breadcrumb">
<li><a href="{{ base_path }}/">Home</a></li>
<li><a href="{{ basePath }}/">Home</a></li>
{{if namespace != "library"}}
<li><a href="{{ base_path }}/{{ namespace }}">{{ namespace }}</a></li>
<li><a href="{{ basePath }}/{{ namespace }}">{{ namespace }}</a></li>
{{end}}
<li class="active">{{ repo |url_decoded_path }}</li>
<li class="active">{{ repo|url_decode }}</li>
</ol>
<table id="datatable" class="table table-striped table-bordered">
@@ -46,9 +46,9 @@
{{range tag := tags}}
<tr>
<td>
<a href="{{ base_path }}/{{ namespace }}/{{ repo }}/{{ tag }}">{{ tag }}</a>
<a href="{{ basePath }}/{{ namespace }}/{{ repo }}/{{ tag }}">{{ tag }}</a>
{{if deleteAllowed}}
<a href="{{ base_path }}/{{ namespace }}/{{ repo }}/{{ tag }}/delete" data-toggle="confirmation" class="btn btn-danger btn-xs pull-right" role="button">Delete</a>
<a href="{{ basePath }}/{{ namespace }}/{{ repo }}/{{ tag }}/delete" data-toggle="confirmation" class="btn btn-danger btn-xs pull-right" role="button">Delete</a>
{{end}}
</td>
</tr>