Commit 6648e6ec authored by Leo Iannacone's avatar Leo Iannacone

added button to download current file

parent 68ed889f
...@@ -5,8 +5,15 @@ var Page_Distrubion = { ...@@ -5,8 +5,15 @@ var Page_Distrubion = {
if (! data) if (! data)
data = Utils.from_hash_to_data() data = Utils.from_hash_to_data()
label = '' label = ''
if (Utils.check_data_file(data)) if (Utils.check_data_file(data)) {
label = data.package.orig_name + '.' + data.file.name complete_name = data.package.orig_name + '.' + data.file.name
if (! data.file.path)
data.file.path = DEBOMATIC_STATIC + '/' + data.distribution.name + '/pool/' + data.package.orig_name + '/' + complete_name
label = complete_name + ' \
<a class="btn btn-link btn-lg" title="Download" href="' + data.file.path + '">\
<span class="glyphicon glyphicon-download-alt"></span>\
</a>'
}
else if (Utils.check_data_package(data)) else if (Utils.check_data_package(data))
label = data.package.orig_name label = data.package.orig_name
else if (Utils.check_data_distribution(data)) else if (Utils.check_data_distribution(data))
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<script src="/libs/bootstrap/3.1.1/js/bootstrap.min.js"></script> <script src="/libs/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script> <script>
var DEBOMATIC_STATIC = '<%= paths.debomatic %>'
var AUTOSCROLL = <%= autoscroll %> var AUTOSCROLL = <%= autoscroll %>
var DISTRIBUTION_PAGE = '<%= paths.distribution %>' var DISTRIBUTION_PAGE = '<%= paths.distribution %>'
var HOSTNAME = '<%= host %><% if (port) { %>:<%= port%><% } %>' var HOSTNAME = '<%= host %><% if (port) { %>:<%= port%><% } %>'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment