1<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1"%>
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3<html><head>
4    <%@ include file="head.jsp" %>
5    <%@ include file="jquery.jsp" %>
6
7    <script type="text/javascript" src="<c:url value="/dwr/engine.js"/>"></script>
8    <script type="text/javascript" src="<c:url value="/dwr/interface/multiService.js"/>"></script>
9
10    <link rel="stylesheet" href="<c:url value="/script/fontawesome/css/font-awesome.min.css"/>" type="text/css">
11
12    <c:choose>
13        <c:when test="${model.customScrollbar}">
14            <link href="<c:url value="/style/customScrollbar.css"/>" rel="stylesheet">
15            <script type="text/javascript" src="<c:url value="/script/jquery.mousewheel.min.js"/>"></script>
16            <script type="text/javascript" src="<c:url value="/script/jquery.mCustomScrollbar.concat.min.js"/>"></script>
17        </c:when>
18        <c:otherwise>
19            <link href="<c:url value="/style/customScrollbarAuto.css"/>" rel="stylesheet">
20        </c:otherwise>
21    </c:choose>
22
23    <c:if test="${model.listType eq 'random'}">
24        <meta http-equiv="refresh" content="30000">
25    </c:if>
26
27    <script type="text/javascript" src="<c:url value="/script/jquery-migrate-1.2.1.min.js"/>"></script>
28    <script type='text/javascript' src="<c:url value="/script/jquery.scrollTo-1.4.2.js"/>"></script>
29    <script type='text/javascript' src="<c:url value="/script/jquery.dropdownReplacement-0.5.3.js"/>"></script>
30    <link rel="stylesheet" href="<c:url value="/style/jquery.dropdownReplacement.css"/>" type="text/css">
31
32    <c:if test="${model.listType eq 'hot'}">
33    <link href="<c:url value="/style/carousel.css"/>" rel="stylesheet">
34    <script type="text/javascript" src="<c:url value="/script/jquery.event.drag-2.2.js"/>"></script>
35    <script type="text/javascript" src="<c:url value="/script/cloud-carousel.1.0.7.js"/>"></script>
36    <script type="text/javascript" src="<c:url value="/script/cloud-carousel-home.js"/>"></script>
37    </c:if>
38
39    <script type="text/javascript">
40
41    // --------------------------------------------
42    function onToastmessage(type, text) {
43        $().toastmessage(type, text);
44    }
45
46    function changeMusicFolder(musicFolderId) {
47        multiService.setSelectedMusicFolder(musicFolderId, refresh);
48    }
49
50    function changeGenre(genre) {
51        multiService.setSelectedGenre(genre, refresh);
52    }
53
54    function refresh() {
55        top.main.location.href = top.main.location.href;
56    }
57
58    </script>
59
60</head>
61<body class="mainframe bgcolor1">
62
63    <!-- content block -->
64    <c:set var="captionLength" value="${model.player.coverArtScheme.captionLength}"/>
65    <fmt:message key="home.${model.listType}.text" var="listTypeCat"/>
66    <div id="content_home" class="content_home">
67    <!-- CONTENT -->
68
69    <c:if test="${not empty model.welcomeTitle}">
70        <h1>
71            <img src="<spring:theme code="homeImage"/>" width="32" alt="">
72            ${model.welcomeTitle}
73        </h1>
74    </c:if>
75
76    <c:if test="${not empty model.welcomeSubtitle}">
77        <h2>${model.welcomeSubtitle}</h2>
78    </c:if>
79
80    <h2>
81    <!-- random newest hot allArtist starredArtist starred tip highest frequent recent decade genre alphabetical top new -->
82        <c:forTokens items="${model.homeHeader}" delims=" " var="cat" varStatus="loopStatus">
83
84        <c:choose>
85            <c:when test="${loopStatus.count > 1 and  (loopStatus.count - 1) % 15 != 0}">&nbsp;<img src="<spring:theme code="sepImage"/>" alt="">&nbsp;</c:when>
86            <c:otherwise></h2><h2></c:otherwise>
87        </c:choose>
88
89            <madsonic:url var="url" value="home.view">
90                <madsonic:param name="listType" value="${cat}"/>
91            </madsonic:url>
92
93            <c:choose>
94                <c:when test="${model.listType eq cat}">
95
96                <span class="headerSelected">
97                    <c:if test="${cat eq 'starred' || cat eq 'starredArtist'}">
98						<i class="fa fa-star starred"></i>
99                    </c:if>
100                <fmt:message key="home.${cat}.title"/></span>
101                </c:when>
102                <c:otherwise>
103                    <c:if test="${cat eq 'starred' || cat eq 'starredArtist'}">
104						<i class="fa fa-star starred"></i>
105                    </c:if>
106                    <a href="${url}"><fmt:message key="home.${cat}.title"/></a>
107                </c:otherwise>
108            </c:choose>
109        </c:forTokens>
110    </h2>
111
112    <div style="margin-top: 20px;">
113    <c:if test="${model.isIndexBeingCreated}">
114        <p class="warning" style="margin-top: 10px;"><i class="fa fa-info-circle fa-lg fa-fw icon" style="color: #FFC107"></i> <fmt:message key="home.scan"/></p>
115    </c:if>
116
117    <c:if test="${model.showHomePagerTop}">
118        <%@ include file="homePager.jsp" %>
119    </c:if>
120    </div>
121    <br>
122    <c:if test="${not empty model.welcomeMessage}">
123        <div style="width:15em;float:right;padding:0 1em 0 1em;border-left:1px solid #<spring:theme code="detailColor"/>">
124            <madsonic:wiki text="${model.welcomeMessage}"/>
125        </div>
126    </c:if>
127
128    <c:choose>
129    <c:when test="${model.listType eq 'hot'}">
130
131        <script type="text/javascript" src="<c:url value="/script/jquery.mousewheel.min.js"/>"></script>
132
133        <img id="left-but" src="<spring:theme code="buttonLeftImage"/>" title=""/>
134        <img id="right-but" src="<spring:theme code="buttonRightImage"/>" title=""/>
135
136        <div id="preloader">
137            <div id="preloaderText">
138                <span id="currentProcess"></span>
139                <span id="persent"></span>
140                <div id="stopLoading">cancel</div>
141                <div id="startLoading">resume Downloads</div>
142            </div>
143        </div>
144        <div id="resizable">
145            <div id = "carousel1" >
146            <c:forEach items="${model.albums}" var="album" varStatus="loopStatus">
147                <c:import url="carousel.jsp">
148                    <c:param name="albumId" value="${album.id}"/>
149                    <c:param name="auth" value="${album.hash}"/>
150                    <c:param name="albumPath" value="${album.path}"/>
151                    <c:param name="albumName" value="${album.albumSetName}"/>
152                    <c:param name="albumArtist" value="${album.artist}"/>
153                    <c:param name="albumYear" value="${album.albumYear}"/>
154                    <c:param name="coverArtSize" value="150"/>
155                    <c:param name="coverArtSize" value="${model.coverArtSize}"/>
156                    <c:param name="showLink" value="true"/>
157                    <c:param name="showPlayAlbum" value="false"/>
158                    <c:param name="showAddAlbum" value="false"/>
159                </c:import>
160            </c:forEach>
161            </div>
162        </div>
163        <!--
164        <div id = "nextcontrols" >
165            <table width="100%" border="0" cellspacing="0" cellpadding="0">
166                <tr>
167                    <c:choose>
168                        <c:when test="${model.listType eq 'random'}">
169                        </c:when>
170                        <c:otherwise>
171                            <madsonic:url value="home.view" var="previousUrl">
172                                <madsonic:param name="listType" value="${model.listType}"/>
173                                <madsonic:param name="listOffset" value="${model.listOffset - model.listSize}"/>
174                                <madsonic:param name="genre" value="${model.genre}"/>
175                                <madsonic:param name="decade" value="${model.decade}"/>
176                            </madsonic:url>
177                            <madsonic:url value="home.view" var="nextUrl">
178                                <madsonic:param name="listType" value="${model.listType}"/>
179                                <madsonic:param name="listOffset" value="${model.listOffset + model.listSize}"/>
180                                <madsonic:param name="genre" value="${model.genre}"/>
181                                <madsonic:param name="decade" value="${model.decade}"/>
182                            </madsonic:url>
183                                <td width="33%"></td>
184                                <td width="80"><fmt:message key="home.albums"><fmt:param value="${model.listOffset + 1}"/><fmt:param value="${model.listOffset + model.listSize}"/></fmt:message></td>
185                                <td width="33%"></td>
186                            </c:otherwise>
187                        </c:choose>
188                    </tr>
189            </table>
190                <table width="100%" border="0" cellspacing="0" cellpadding="0">
191                <tr>
192                    <td width="33%"><div class="back"><a href="${previousUrl}"><fmt:message key="common.previous"/></a></div></td>
193                    <td width="100" style="padding-up:1.5em">
194                        <select name="listSize" onchange="location='home.view?listType=${model.listType}&amp;listOffset=${model.listOffset}&amp;listSize=' + options[selectedIndex].value;">
195                            <c:forTokens items="5 10 15 20 25 30 35" delims=" " var="size">
196                                <option ${size eq model.listSize ? "selected" : ""} value="${size}"><fmt:message key="home.listsize"><fmt:param value="${size}"/></fmt:message></option>
197                            </c:forTokens>
198                        </select>
199                    </td>
200                    <td width="33%"><div class="forwardright"><a href="${nextUrl}"><fmt:message key="common.next"/></a></div></td>
201                </tr>
202            </table>
203        </div> -->
204
205    </c:when>
206    <c:when test="${model.listType eq 'users'}">
207        <table>
208            <tr>
209                <th><fmt:message key="home.chart.total"/></th>
210                <th><fmt:message key="home.chart.stream"/></th>
211            </tr>
212            <tr>
213                <td><img src="<c:url value="/userChart.view"><c:param name="type" value="total"/></c:url>" alt=""></td>
214                <td><img src="<c:url value="/userChart.view"><c:param name="type" value="stream"/></c:url>" alt=""></td>
215            </tr>
216            <tr>
217                <th><fmt:message key="home.chart.download"/></th>
218                <th><fmt:message key="home.chart.upload"/></th>
219            </tr>
220            <tr>
221                <td><img src="<c:url value="/userChart.view"><c:param name="type" value="download"/></c:url>" alt=""></td>
222                <td><img src="<c:url value="/userChart.view"><c:param name="type" value="upload"/></c:url>" alt=""></td>
223            </tr>
224    </table>
225    </c:when>
226    <c:otherwise>
227
228    <c:forEach items="${model.albums}" var="album" varStatus="loopStatus">
229
230        <c:choose>
231        <c:when test="${captionLength > 1}">
232            <div class="albumThumb">
233        </c:when>
234        <c:otherwise>
235            <div class="albumThumbs">
236        </c:otherwise>
237        </c:choose>
238
239            <c:import url="coverArt.jsp">
240                <c:param name="albumId" value="${album.id}"/>
241                <c:param name="auth" value="${album.hash}"/>
242                <c:param name="albumName" value="${album.albumSetName}"/>
243                <c:param name="artistName" value="${album.artist}"/>
244                <c:param name="coverArtHQ" value="${model.coverArtHQ}"/>
245                <c:param name="coverArtSize" value="${model.coverArtSize}"/>
246                <c:param name="coverArtPath" value="${album.coverArtPath}"/>
247                <c:param name="showLink" value="true"/>
248                <c:param name="showZoom" value="false"/>
249                <c:param name="showChange" value="false"/>
250                <c:param name="appearAfter" value="${loopStatus.count * 15}"/>
251                <c:param name="showPlayAlbum" value="${model.showPlayer}"/>
252                <c:param name="showAddAlbum" value="${model.showPlayer}"/>
253                <c:param name="captionLength" value="${captionLength}"/>
254                <c:param name="showCaption" value="false"/>
255                <c:param name="showTopTrack" value="${model.showTopTrack}"/>
256                <c:param name="showSmoother" value="false"/>
257            </c:import>
258
259        <c:if test="${captionLength > 1}">
260
261            <div class="detailmini">
262
263            <c:if test="${not empty album.playCount}">
264            <div class="detailcolordark">
265                <fmt:message key="home.playcount"><fmt:param value="${album.playCount}"/></fmt:message>
266            </div>
267            </c:if>
268            <c:if test="${not empty album.lastPlayed}">
269            <div class="detailcolordark">
270                <fmt:formatDate value="${album.lastPlayed}" dateStyle="short" var="lastPlayedDate"/>
271                <fmt:message key="home.lastplayed"><fmt:param value="${lastPlayedDate}"/></fmt:message>
272            </div>
273            </c:if>
274            <c:if test="${not empty album.created}">
275            <div class="detailcolordark">
276                <fmt:formatDate value="${album.created}" dateStyle="short" var="creationDate"/>
277                <fmt:message key="home.created"><fmt:param value="${creationDate}"/></fmt:message>
278            </div>
279            <c:if test="${not empty album.year}">
280                ${album.year}
281            </c:if>
282            </c:if>
283            <c:if test="${not empty album.rating}">
284                <c:import url="rating.jsp">
285                    <c:param name="readonly" value="true"/>
286                    <c:param name="rating" value="${album.rating}"/>
287                </c:import>
288            </c:if>
289            </div>
290
291
292        <c:choose>
293            <c:when test="${empty album.artist and empty album.albumTitle}">
294            <div class="detail"><fmt:message key="common.unknown"/></div>
295            </c:when>
296            <c:otherwise>
297
298            <madsonic:url value="main.view" var="parent">
299            <madsonic:param name="id" value="${album.parentId}"/>
300            </madsonic:url>
301
302                <div class="detailcolor"><a href="${parent}"><str:truncateNicely upper="${captionLength}">${album.artist}</str:truncateNicely></a></div>
303
304                    <c:choose>
305                        <c:when test="${fn:startsWith(album.albumTitle,'[')}">
306                            <div class="detail"><str:truncateNicely upper="${captionLength}">${fn:split(album.albumTitle,']')[1]}</str:truncateNicely></div>
307                        </c:when>
308                        <c:otherwise>
309                            <div class="detail"><str:truncateNicely upper="${captionLength}">${album.albumTitle}</str:truncateNicely></div>
310                        </c:otherwise>
311                    </c:choose>
312
313            </c:otherwise>
314        </c:choose>
315
316        </c:if>
317
318        </div>
319
320    </c:forEach>
321
322    </c:otherwise>
323    </c:choose>
324
325    <c:if test="${model.showHomePagerBottom}">
326        <%@ include file="homePager.jsp" %>
327    </c:if>
328
329        </div>
330
331
332
333    <!-- CONTENT -->
334</div>
335
336<c:if test="${model.customScrollbar}">
337<script type="text/javascript">
338        (function($){
339            $(window).load(function(){
340
341                $("#content_home").mCustomScrollbar({
342                    axis:"y",
343                    scrollInertia:800, /*scrolling inertia: integer (milliseconds)*/
344                    mouseWheel:true, /*mousewheel support: boolean*/
345                    mouseWheelPixels:"auto", /*mousewheel pixels amount: integer, "auto"*/
346                    autoDraggerLength:true, /*auto-adjust scrollbar dragger length: boolean*/
347                    autoHideScrollbar:true, /*auto-hide scrollbar when idle*/
348                    alwaysShowScrollbar:false,
349                    advanced:{      updateOnBrowserResize:true, /*update scrollbars on browser resize (for layouts based on percentages): boolean*/
350                                    updateOnContentResize:true, /*auto-update scrollbars on content resize (for dynamic content): boolean*/
351                                    autoExpandHorizontalScroll:false }, /*auto expand width for horizontal scrolling: boolean*/
352                    scrollButtons:{ enable:true, /*scroll buttons support: boolean*/
353                                    scrollType:"continuous", /*scroll buttons scrolling type: "continuous", "pixels"*/
354                                    scrollSpeed:"auto", /*scroll buttons continuous scrolling speed: integer, "auto"*/
355                                    scrollAmount:40 },  /*scroll buttons pixels scroll amount: integer (pixels)*/
356                                    theme:"${model.customScrollbarTheme}",
357                                    scrollbarPosition:"inside"
358                });
359            });
360        })(jQuery);
361    </script>
362</c:if>
363
364<script type="text/javascript">
365
366function refreshPage() {
367    window.location.href = window.location.href;
368}
369
370<c:if test="${model.listType ne 'decade' or model.listType ne 'genre' or model.listType ne 'tip'}">
371$(document).ready(function() {
372    $("#musicFolder").dropdownReplacement({optionsDisplayNum: 10, onSelect : function(value, text, selectIndex){
373        changeMusicFolder(value);
374    }});
375});
376</c:if>
377
378<c:if test="${model.listType eq 'decade'}">
379$("#decadeSelect").dropdownReplacement({selectCssWidth: 60, onSelect : function(value, text, selectIndex){
380    location="home.view?listType=${model.listType}&decade=" + value;
381}});
382</c:if>
383
384<c:if test="${model.listType eq 'genre'}">
385 $("#genre").dropdownReplacement({selectCssWidth: 150, optionsDisplayNum: 15, onSelect : function(value, text, selectIndex){
386    location="home.view?listType=${model.listType}&genre=" + value;
387}});
388</c:if>
389
390</script>
391</body>
392</html>
393