Redesigned book list

Signed-off-by: Gergely POLONKAI <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely POLONKAI 2012-08-17 20:13:13 +02:00
parent 528c373ad9
commit 972a57bf2b
3 changed files with 50 additions and 5 deletions

View File

@ -0,0 +1,34 @@
/*
Document : book.css
Created on : 2012.08.17., 18:23:37
Author : Gergely Polonkai
Description:
CSS to style book stuff
*/
#book-list {
border: 1px solid #142965;
border-collapse: collapse;
margin: 1em auto 1em auto;
width: 100%;
}
#book-list thead td {
font-weight: bold;
height: 1.5 em;
border-bottom: 2px solid #142965;
padding: 3px;
}
#book-list tbody td {
padding: 5px;
border-bottom: 1px solid #142965;
}
#book-list tbody tr.odd td {
background-color: #abccdc;
}
#book-list tbody tr.even td {
background-color: #c6ecfe;
}

View File

@ -13,7 +13,7 @@
body { body {
margin: 0; margin: 0;
background-color: #001100; background-color: #000800;
background-image: url('../images/rose_bg.png'); background-image: url('../images/rose_bg.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-attachment: fixed; background-attachment: fixed;

View File

@ -2,11 +2,20 @@
#} #}
{% extends 'KekRozsakFrontBundle:Default:main_template.html.twig' %} {% extends 'KekRozsakFrontBundle:Default:main_template.html.twig' %}
{% block title %} - Könyvtár{% endblock %} {% block title %} - Könyvtár{% endblock %}
{% block buttonlist %}
[Új könyv]
{% if books|length > 0 %}
[Saját könyveim]
[Nálam lévő kölcsönzött könyvek]
{% endif %}
{% endblock buttonlist %}
{% block content %} {% block content %}
<h3>Könyvtár</h3> <h3>Könyvtár</h3>
[Saját könyveim] [Nálam lévő kölcsönzött könyvek] {{ block('buttonlist') }}
{% if books|length > 0 %} {% if books|length > 0 %}
<table> <table id="book-list">
<thead> <thead>
<tr> <tr>
<td>Szerző</td> <td>Szerző</td>
@ -20,7 +29,7 @@
</thead> </thead>
<tbody> <tbody>
{% for book in books %} {% for book in books %}
<tr class="book-row popup-opener" id="book-{{ book.id }}"> <tr class="book-row popup-opener {{ cycle(['odd', 'even'], loop.index0) }}" id="book-{{ book.id }}">
<td class="popup-opener">{{ book.author }}</td> <td class="popup-opener">{{ book.author }}</td>
<td>{{ book.title }}</td> <td>{{ book.title }}</td>
<td>{{ book.year }}</td> <td>{{ book.year }}</td>
@ -32,8 +41,10 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{{ block('buttonlist') }}
{% endif %} {% endif %}
{% endblock %} {% endblock content %}
{% block bottomscripts %} {% block bottomscripts %}
<script type="text/javascript"> <script type="text/javascript">
$('.book-row').click(function() { $('.book-row').click(function() {