List.html 4.92 KB
Newer Older
Dainis Abols's avatar
Dainis Abols committed
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">

<f:layout name="Default"/>

<f:section name="main">
    <style>
        .notice_summary {
            width: 400px;
            line-height:1.2em;
            height:3.6em;
            overflow:hidden;
            text-overflow: ellipsis;
        }
    </style>

    <f:if condition="{dates}">
        <select id="date_selector">
            <option></option>
            <f:for each="{dates}" as="item">
                <option {f:if(condition: '{item.selected}', then: 'selected="selected"')} value="{item.date_formatted}">
                    <f:if condition="{item.archive}">Arhīvs</f:if>
                    {item.date_formatted}</option>
            </f:for>
        </select>
        <script type="text/javascript">
          $('#date_selector').change(function () {
            $(location).attr('href', $(location).attr('protocol') + '//' + $(location).attr('hostname') + $(location).attr('pathname') + '?tx_lunotices_pi1[currentDate]=' + $(this).val()); //window.location.hostname + window.location.pathname
          });
        </script>
    </f:if>

    <ul class="topic_list all_topics">
        <f:for each="{data}" as="item" key="topicKey">
            <f:if condition="{item.notices -> f:count()} > 0 ">
                <li class="topic_info" style="border-color: {item.topic.color}">
                    <div class="topic_title" id="{topicKey}" style="background-color: {item.topic.color}">
                        <h2>
                            <f:if condition="{dates}">
                                <f:then>
                                    <a>{item.topic.title}</a>
                                </f:then>
                                <f:else>
                                    <f:link.typolink parameter="{item.url}">{item.topic.title}</f:link.typolink>
                                </f:else>
                            </f:if>
                        </h2>
                    </div>
                    <ul class="topic_notices">
                        <f:for each="{item.notices}" as="notice" key="noticeKey">
                            <li class="notice_info">
                                <div class="notice_title">
                                    <h3>
                                        <f:if condition="{dates}">
                                            <f:then>
                                                <f:format.raw>{notice.title}</f:format.raw>
                                                <f:if condition="{notice.fileArray}"> (
                                                    <f:for each="{notice.fileArray}" as="fileItem" iteration="i">
                                                        <img src="{f:uri.resource(path: 'Icons/FileIcons/{fileItem.type}.gif', extensionName: 'frontend')}" alt=""> <a href="{fileItem.path}" target="_blank">{fileItem.name}</a>
                                                        <f:if condition="{i.isLast}">
                                                            <f:then></f:then>
                                                            <f:else>, </f:else>
                                                        </f:if>
                                                    </f:for>)
                                                </f:if>
                                            </f:then>
                                            <f:else>
                                                <f:link.action action="details" arguments="{uid: notice.uid}">
                                                    <f:format.raw>{notice.title}</f:format.raw>
                                                </f:link.action>
                                                <f:if condition="{notice.starttime}">
                                                    <f:format.date format="(d.m.Y.)">{notice.starttime}</f:format.date>
                                                </f:if>
                                            </f:else>
                                        </f:if>
                                    </h3>
                                </div>
                                <div class="notice_summary">
                                    <f:format.raw>{notice.summary}</f:format.raw>
                                </div>
                            </li>
                        </f:for>
                    </ul>
                    <div class="read_more">
                        <f:if condition="{dates}">
                            <f:then></f:then>
                            <f:else>
                                <f:link.typolink parameter="{item.url}">
                                    <f:translate key="topic.notice.all"/>
                                </f:link.typolink>
                            </f:else>
                        </f:if>
                    </div>
                </li>
            </f:if>

        </f:for>
    </ul>
</f:section>

</html>