Browse Source

potential cover added

ansible-setup-and-deploy
Alex 6 years ago
parent
commit
e1d966924d
  1. BIN
      .DS_Store
  2. BIN
      app/static/img/default_cover.png
  3. 10
      app/templates/base.html
  4. 6
      app/templates/show_books.html

BIN
.DS_Store

Binary file not shown.

BIN
app/static/img/default_cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

10
app/templates/base.html

@ -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>

6
app/templates/show_books.html

@ -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 %}

Loading…
Cancel
Save