Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
35583 ranu 1
<ul class="bulletin-tabs">
2
    #foreach($entry in $bulletins.entrySet())
3
        <li data-tab="$entry.key">
4
            $entry.key
5
        </li>
6
    #end
7
</ul>
8
<div class="timeline-wrapper">
9
    #foreach($entry in $bulletins.entrySet())
10
 
11
        <div class="bulletin-tab-content" id="tab-$entry.key">
12
 
13
            <div class="timeline-wrapper">
14
 
15
                #foreach($bulletin in $entry.value)
16
                    <div class="timeline-row">
17
 
18
                        <div class="timeline-card">
19
                            <div class="card-header">
20
                                <div class="header-text">
21
 
22
                                    <div class="timeline-time">
23
                                        $bulletin.getCreatedTime()
24
                                        #if($bulletin.getCreatedBy())
25
                                            | By- $bulletin.getCreatedBy()
26
                                        #end
27
                                    </div>
28
 
29
                                    #if($bulletin.isCatalogOffer())
30
                                        <strong>
31
                                            <a class="today-bulletin-offer"
32
                                               data-offerid="$bulletin.offerId">
33
                                                ${bulletin.title}
34
                                            </a>
35
                                        </strong>
36
                                    #elseif(${bulletin.title})
37
                                        <strong>${bulletin.title}</strong>
38
                                    #end
39
 
40
                                </div>
41
                            </div>
42
 
43
                            <div class="card-body">
44
                                $bulletin.description
45
 
46
                                #if($bulletin.catalogBriefList)
47
                                    <p>
48
                                        #foreach($catalog in $bulletin.catalogBriefList)
49
                                            <span>${catalog.modelName}</span>,
50
                                        #end
51
                                    </p>
52
                                #end
53
 
54
                                #if($bulletin.documentIds && $bulletin.documentIds.size() > 0)
55
                                    <div class="bulletin-attachments">
56
                                        #foreach($docId in $bulletin.documentIds)
57
                                            <a href="$rc.contextPath/document/$docId"
58
                                               target="_blank">
59
                                                Attachment
60
                                            </a>
61
                                        #end
62
                                    </div>
63
                                #end
64
 
65
                            </div>
66
                        </div>
67
 
68
                    </div>
69
                #end
70
 
71
            </div>
72
        </div>
73
 
74
    #end
75
 
76
</div>
77
 
78
 
79
<script>
80
 
81
 
82
    $(document).on('click', '.today-bulletin-offer', function () {
83
        let offerId = $(this).data("offerid");
84
        doGetAjaxRequestHandler(`${context}/getOfferMargins?offerId=${offerId}`, function (data) {
85
            $('#todayBulletinOfferDescription .modal-content').html(data);
86
            $("#todayBulletinOfferDescription").modal('show');
87
        });
88
    });
89
 
90
 
91
    document.querySelectorAll('.bulletin-tabs li').forEach(tab => {
92
        tab.addEventListener('click', function () {
93
 
94
            document.querySelectorAll('.bulletin-tabs li')
95
                    .forEach(t => t.classList.remove('active'));
96
 
97
            document.querySelectorAll('.bulletin-tab-content')
98
                    .forEach(c => c.style.display = 'none');
99
 
100
            this.classList.add('active');
101
            document.getElementById('tab-' + this.dataset.tab).style.display = 'block';
102
        });
103
    });
104
 
105
    /* Activate first tab by default */
106
    document.querySelector('.bulletin-tabs li')?.click();
107
 
108
</script>