potential cover added
This commit is contained in:
parent
ac23e131c5
commit
e1d966924d
BIN
app/static/img/default_cover.png
Normal file
BIN
app/static/img/default_cover.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
@ -37,5 +37,15 @@
|
|||||||
{% block js %} {% endblock%}
|
{% block js %} {% endblock%}
|
||||||
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
|
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
|
||||||
<script src="{{ url_for("static", filename="js/app.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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -25,7 +25,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% for book in books|sort(attribute='title', reverse = False) %}
|
{% for book in books|sort(attribute='title', reverse = False) %}
|
||||||
<tr>
|
<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="title_col"><a href="books/{{ book.id }}">{{ book.title }}</a></td>
|
||||||
|
|
||||||
<td class="author_col"> {% for author in book.authors %}
|
<td class="author_col"> {% for author in book.authors %}
|
||||||
|
Loading…
Reference in New Issue
Block a user