potential cover added

This commit is contained in:
Alex 2018-05-27 22:32:17 +02:00
parent ac23e131c5
commit e1d966924d
4 changed files with 15 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -37,5 +37,15 @@
{% block js %} {% endblock%}
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="{{ url_for("static", filename="js/app.js") }}"></script>
<script>
$( ".no_cover" ).each(function() {
var randomColor = '#'+ ('000000' + Math.floor(Math.random()*16777215).toString(16)).slice(-6);
$(this).css({
'background-color' : randomColor,
});
}
)
</script>
</body>
</html>

View File

@ -25,7 +25,11 @@
</tr>
{% for book in books|sort(attribute='title', reverse = False) %}
<tr>
<td><img src="../uploads/cover/{{ book.cover }}" width="80"></td>
<td>
<object class="no_cover" data="../static/img/default_cover.png" type="image/png" width="65">
<img src="../uploads/cover/{{ book.cover }}" width="80">
</object>
</td>
<td class="title_col"><a href="books/{{ book.id }}">{{ book.title }}</a></td>
<td class="author_col"> {% for author in book.authors %}