Subversion Repositories SmartDukaan

Rev

Rev 35675 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
32846 ranu 1
<style>
35396 amit 2
    .grid-box {
3
        display: grid;
4
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
5
        gap: 10px;
32846 ranu 6
    }
32848 ranu 7
 
35396 amit 8
    .item {
9
        background: #f2f2f2;
10
        padding: 16px;
11
        /*height: 120px;  same height for all, adjust as needed */
12
        box-sizing: border-box;
32848 ranu 13
    }
32846 ranu 14
</style>
35396 amit 15
<div class="grid-box">
16
    #foreach( $offer in $publishedOffers )
35771 ranu 17
        <div class="item info-box white-bg mk_offer_container description-offer" style="margin-bottom:1px"
18
             data-offerid="$offer.getId()" data-toggle="modal"
19
             data-backdrop="static" data-keyboard="false">
35396 amit 20
            <h3 style="margin-top:-2px;color:#c70db8;margin-bottom:4px;font-weight:bold; font-size:20px;">
35675 amit 21
                <a href="javascript:void(0)" class="description-offer" data-offerid="$offer.getId()"
22
                   style="color:#c70db8; text-decoration:none;">
23
                    $offer.getName()
24
                </a>
35396 amit 25
            </h3>
26
            <h5 style="margin-top:-2px;font-size:15px;color:#5547d0;font-weight:bold">
27
                From $dateMonthFormatter.format($offer.getStartDate())
28
                to $dateMonthFormatter.format($offer.getEndDate()), Based
29
                on $offer.getSchemeType()
30
            </h5>
31
            <!--<h4 style="color:green;margin-top:0px;margin-bottom:0px;">
32
        ##$offer.getDashboardHtml()
33
    </h4>-->
34
            <br>
32846 ranu 35
 
35771 ranu 36
            <p style="float:right;font-size:15px; margin:0px 0px 0px; "><a href="javascript:void(0)">All terms &
37
                conditions</a></p>
35396 amit 38
        </div>
39
    #end
32846 ranu 40
</div>
41
 
42
<script>
43
    function showMore(button) {
44
        // Find the closest parent container with the class "mk_offer_container"
45
        var parentContainer = button.closest(".mk_offer_container");
46
        var mainparentContainer = button.closest("#offer-container");
47
 
48
        // Get all elements with class "mk_show" inside the parent container
49
        var mkShowElements = parentContainer.getElementsByClassName("mk_show");
50
 
51
        // Toggle the class "expanded" on the main parent container
52
        mainparentContainer.classList.toggle("expanded");
53
 
54
        // Loop through the elements and toggle their display
55
        for (var i = 0; i < mkShowElements.length; i++) {
56
            mkShowElements[i].style.display = (mkShowElements[i].style.display === 'block') ? 'none' : 'block';
57
        }
58
 
59
        // Toggle the text content of the clicked span
60
        button.textContent = (button.textContent === 'See More') ? 'Less' : 'See More';
61
    }
62
</script>