/
edit.latte
68 lines (61 loc) · 1.9 KB
/
edit.latte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{var $title = 'Playlist'}
{block content}
<p>
<a href="{link Event:details $eventId}" class="btn">
<i class="icon-search"></i> Detaily události
</a>
<a href="{link default eventId=>$eventId}" class="btn">
<i class="icon-list"></i> Zobrazit playlist
</a>
<a href="{link add eventId=>$eventId}" class="btn btn-success">
<i class="icon-plus icon-white"></i> Přidat písničku
</a>
</p>
{* TODO: AJAXify
<p>
<a href="#playlistItemAddModal" data-toggle="modal" class="btn btn-success">
<i class="icon-plus icon-white"></i> Přidat písničku
</a>
</p>
<div class="modal hide" id="playlistItemAddModal">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Přidat písničky do playlistu</h3>
</div>
<div class="modal-body">
{control songSearchPanel}
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Zpět</a>
</div>
</div>
*}
<style type="text/css">
table.playlist th.action, table.playlist td.action {
width: 9em;
text-align: center;
}
</style>
{foreach $playlist as $song}
{first}
{var $i = 0}
<table class="table table-condensed playlist">
{/first}
{? $i++}
<tr>
<td style="width: 2em">{$i}.</td>
<td class="song-title"><a href="{link Song:details $song->id}">{$song->title}</td>
<td class="action">
<a {if $song->order > 0}href="{link Playlist:updateItem eventId=>$eventId, songId=>$song->id, order=>$song->order-1}"{/if}
class="btn{if $song->order <= 0} disabled{/if}" title="Posunout nahoru"><i class="icon-chevron-up"></i></a>
<a href="{link Playlist:updateItem eventId=>$eventId, songId=>$song->id, order=>$song->order+1}"
class="btn" title="Posunout dolů"><i class="icon-chevron-down"></i></a>
<a href="{link Playlist:delete eventId=>$eventId, songId=>$song->id}"
class="btn" title="Odstranit z playlistu"><i class="icon-remove"></i></a>
</td>
</tr>
{last}
</table>
{/last}
{/foreach}
{/block}