diff --git a/cps/static/css/style.css b/cps/static/css/style.css index 673623c5..e5510dd6 100644 --- a/cps/static/css/style.css +++ b/cps/static/css/style.css @@ -90,3 +90,6 @@ input.pill:not(:checked) + label .glyphicon { #meta-info img { max-height: 150px; max-width: 100px; cursor: pointer; } .padded-bottom { margin-bottom: 15px; } + +.upload-format-input-text {display: initial;} +#btn-upload-format {display: none;} diff --git a/cps/static/js/edit_books.js b/cps/static/js/edit_books.js index 71dc2656..879c57f4 100644 --- a/cps/static/js/edit_books.js +++ b/cps/static/js/edit_books.js @@ -205,3 +205,11 @@ $("#search").on("change input.typeahead:selected", function() { }); }); }); + +$("#btn-upload-format").on('change', function () { + var filename = $(this).val(); + if (filename.substring(3,11) == 'fakepath') { + filename = filename.substring(12); + } // Remove c:\fake at beginning from localhost chrome + $('#upload-format').html(filename); +}); diff --git a/cps/templates/book_edit.html b/cps/templates/book_edit.html index 36e31f5e..0276ad3f 100644 --- a/cps/templates/book_edit.html +++ b/cps/templates/book_edit.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% block body %} {% if book %} -
+
@@ -115,7 +115,15 @@
{% endfor %} {% endif %} - + {% if g.user.role_upload() or g.user.role_admin()%} + {% if g.allow_upload %} +
+ +
+ +
+ {% endif %} + {% endif %}