Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
28758 amit.gupta 1
<style>
33649 tejus.loha 2
    .working-green {
3
        color: green;
4
    }
28758 amit.gupta 5
 
33649 tejus.loha 6
    .not-working-red {
7
        color: red;
28758 amit.gupta 8
 
33649 tejus.loha 9
    }
28758 amit.gupta 10
 
33649 tejus.loha 11
    .cover-brand {
28977 manish 12
 
13
 
33649 tejus.loha 14
    }
28977 manish 15
 
33649 tejus.loha 16
    .servicesComment .psComment {
17
        visibility: hidden;
18
        width: 120px;
19
        background-color: black;
20
        color: #fff;
21
        text-align: center;
22
        border-radius: 6px;
23
        padding: 5px 0;
24
 
25
        /* Position the tooltip */
26
        position: absolute;
27
        z-index: 1;
28
    }
29
 
30
    .servicesComment:hover .psComment {
31
        visibility: visible;
32
    }
33
 
34
    .financePartnerServices-table table {
35
        width: 100%;
36
        border-collapse: collapse;
37
    }
38
 
39
    .financePartnerServices-table th, .financePartnerServices-table td {
40
        padding: 4px;
41
        text-align: left;
42
    }
43
 
44
 
45
    .financePartnerServices-table th.fixed-column, .financePartnerServices-table td.fixed-column {
46
        position: sticky;
47
        left: 0;
48
        background-color: white;
49
        z-index: 1;
50
        border-right: 1px solid #ddd;
51
        min-width: 120px;
52
        max-width: 120px;
53
        overflow: hidden;
54
        text-overflow: ellipsis;
55
    }
56
 
57
    .financePartnerServices-table th.fixed-column {
58
        z-index: 2;
59
    }
60
 
61
    .DTFC_LeftBodyLiner {
62
        overflow: hidden !important;
63
    }
35971 aman 64
 
65
    /* Modern Tooltip */
66
    [data-tip] {
67
        cursor: pointer;
68
    }
69
 
70
    #fs-tooltip {
71
        position: fixed;
72
        background: #1e293b;
73
        color: #fff;
74
        font-size: 12px;
75
        font-weight: 500;
76
        padding: 6px 12px;
77
        border-radius: 6px;
78
        white-space: nowrap;
79
        z-index: 99999;
80
        pointer-events: none;
81
        opacity: 0;
82
        transition: opacity 0.15s ease;
83
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
84
        letter-spacing: 0.3px;
85
    }
86
 
87
    #fs-tooltip.visible {
88
        opacity: 1;
89
    }
90
 
91
    /* Arrow pointing down (tooltip above cell) */
92
    #fs-tooltip.arrow-down::after {
93
        content: '';
94
        position: absolute;
95
        top: 100%;
96
        left: 50%;
97
        transform: translateX(-50%);
98
        border: 5px solid transparent;
99
        border-top-color: #1e293b;
100
    }
101
 
102
    /* Arrow pointing up (tooltip below cell) */
103
    #fs-tooltip.arrow-up::after {
104
        content: '';
105
        position: absolute;
106
        bottom: 100%;
107
        left: 50%;
108
        transform: translateX(-50%);
109
        border: 5px solid transparent;
110
        border-bottom-color: #1e293b;
111
    }
33618 tejus.loha 112
</style>
33649 tejus.loha 113
 
114
<section class="wrapper">
28758 amit.gupta 115
    <div class="row">
116
        <div class="col-lg-12">
33618 tejus.loha 117
            <h3 class="page-header"><i class="icon_document_alt"></i>Finance Services</h3>
28758 amit.gupta 118
            <ol class="breadcrumb">
119
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
33618 tejus.loha 120
                <li><i class="icon_document_alt"></i>Finance Services</li>
28758 amit.gupta 121
            </ol>
122
        </div>
123
    </div>
33649 tejus.loha 124
 
125
    <table class="table table-border table-condensed table-bordered">
126
        <tr>
127
 
128
            <td>MA -> Mark Applicable</td>
129
            <td>NA -> Not Applicable</td>
130
 
131
            <td>SNA -> Service Not Applicable</td>
132
            <td>PNI -> Partner Not Interested</td>
133
 
134
            <td>No-Code -> Code Not Available</td>
135
 
136
        </tr>
137
        <tr>
138
            <td>&#10006; -> Brand not started</td>
139
 
140
            <td><span style="color:red;">&#10006; </span>-> More then seven days brand not started</td>
141
            <td><span style="color:red;">&#10006;&#10006; </span>-> Brand not working from partner side</td>
142
 
143
            <td><span style="color:green;">&#10004 </span> -> Brand proper work</td>
144
            <td>(--) -> Never work on partner</td>
145
        </tr>
146
 
147
    </table>
148
 
28758 amit.gupta 149
    <div class="col-lg-12">
33649 tejus.loha 150
        <table class="table table-striped table-advance table-hover table-border table-condensed table-bordered financePartnerServices-table"
151
               id="financePartnerServices" style="width:100%">
28758 amit.gupta 152
 
153
            <thead class="row">
33649 tejus.loha 154
 
28758 amit.gupta 155
            <tr style="color:black;">
33649 tejus.loha 156
                <th rowspan="2" style="display:none">id</th>
157
                <th rowspan="2" class="fixed-column">Partner Name</th>
158
                <th rowspan="2" class="fixed-column">Store Code</th>
159
                <th rowspan="2">Doc Compl</th>
160
 
161
                #foreach($paymentOption in $paymentOptions)
162
                    #if($serviceBrandsConfigMap.containsKey($paymentOption.getId()))
163
 
164
                        #if($financeAuthorityCheck)
165
 
166
                            #set ( $bandsSize = $serviceBrandsConfigMap.get($paymentOption.getId()).size() + 3 )
167
                            <th colspan="$bandsSize">
168
                                $paymentOption.getName()
169
                            </th>
170
                        #else
171
 
172
                            #set ( $bandsSize = $serviceBrandsConfigMap.get($paymentOption.getId()).size() + 2)
173
                            <th colspan="$bandsSize">
174
                                $paymentOption.getName()
175
                            </th>
176
 
177
                        #end
178
 
179
                    #end
29778 manish 180
                #end
181
 
28758 amit.gupta 182
            </tr>
33649 tejus.loha 183
            <tr>
184
                #foreach($paymentOption in $paymentOptions)
185
                    #if($serviceBrandsConfigMap.containsKey($paymentOption.getId()))
186
                        #if($financeAuthorityCheck)
187
                            <th>activation</th>
188
                        #end
189
                        #foreach($serviceBrand in $serviceBrandsConfigMap.get($paymentOption.getId()))
190
                            <th>
191
                                <img src="${brandUrlMap.get($serviceBrand.getBrand())}"
192
                                     class="cover-brand $serviceBrand.getBrand()" id="finBrandUrl"
193
                                     style="height: 30px;">
194
                            </th>
195
 
196
                        #end
197
                        <th>Service Comment</th>
198
                        <th>Follow UP</th>
199
                    #end
200
                #end
201
 
202
            </tr>
203
 
28758 amit.gupta 204
            </thead>
205
            <tbody>
33649 tejus.loha 206
                #foreach($entryCr in $customRetailers)
207
                <tr>
208
                        #parse("finance-service-row.vm")
209
                </tr>
210
                #end
28758 amit.gupta 211
            </tbody>
212
 
213
        </table>
214
    </div>
215
 
33649 tejus.loha 216
</section>
28758 amit.gupta 217
 
33649 tejus.loha 218
<script>
28758 amit.gupta 219
 
35971 aman 220
    // Create tooltip element on body (never clipped by overflow)
221
    $('body').append('<div id="fs-tooltip"></div>');
222
    var fsTooltip = $('#fs-tooltip');
223
 
224
    // Abbreviation maps
225
    var abbreviationMap = {
226
        'MA': 'Mark Applicable',
227
        'NA': 'Not Applicable',
228
        'SNA': 'Service Not Applicable',
229
        'PNI': 'Partner Not Interested',
230
        'No Code': 'Code Not Available',
231
        'NO': 'Document Compliance Not Done',
232
        'INITIATED': 'Service Initiated \u2013 Pending Activation',
233
        '--': 'Never Worked On This Partner'
234
    };
235
 
236
    var classTooltipMap = {
237
        'working-green': 'Brand Working Properly',
238
        'not-working-red': 'Brand Not Working (Partner Side)',
239
        'not-working': 'Brand Not Started'
240
    };
241
 
242
    function applyTooltips() {
243
        $('.dataTables_wrapper td').each(function () {
244
            var el = $(this);
245
            if (el.attr('data-tip')) return;
246
            var cellText = el.text().trim();
247
 
248
            if (abbreviationMap[cellText]) {
249
                el.attr('data-tip', abbreviationMap[cellText]);
250
                return;
251
            }
252
 
253
            for (var cls in classTooltipMap) {
254
                if (el.hasClass(cls)) {
255
                    el.attr('data-tip', classTooltipMap[cls]);
256
                    return;
257
                }
258
            }
259
        });
260
 
261
        $('.dataTables_wrapper .service-mark-pni').attr('data-tip', 'Partner Not Interested');
262
        $('.dataTables_wrapper .service-mark-active').attr('data-tip', 'Mark Applicable');
263
        $('.dataTables_wrapper .service-mark-not-active').attr('data-tip', 'Not Applicable');
264
    }
265
 
266
    // Show tooltip on hover using event delegation (works for all rows including clones)
267
    $(document).on('mouseenter', '[data-tip]', function () {
268
        var tipText = $(this).attr('data-tip');
269
        if (!tipText) return;
270
 
271
        fsTooltip.text(tipText).removeClass('arrow-down arrow-up');
272
        var rect = this.getBoundingClientRect();
273
        var tipHeight = fsTooltip.outerHeight();
274
        var tipWidth = fsTooltip.outerWidth();
275
        var left = rect.left + (rect.width / 2) - (tipWidth / 2);
276
 
277
        // Keep within viewport horizontally
278
        if (left < 5) left = 5;
279
        if (left + tipWidth > window.innerWidth - 5) left = window.innerWidth - tipWidth - 5;
280
 
281
        // Find the header bottom to detect overlap
282
        var headerEl = document.querySelector('.dataTables_scrollHead');
283
        var headerBottom = headerEl ? headerEl.getBoundingClientRect().bottom : 0;
284
 
285
        var topPos = rect.top - tipHeight - 8;
286
 
287
        if (topPos < headerBottom) {
288
            // Not enough space above (behind header) — show BELOW the cell
289
            fsTooltip.css({left: left, top: rect.bottom + 8});
290
            fsTooltip.addClass('visible arrow-up');
291
        } else {
292
            // Normal — show ABOVE the cell
293
            fsTooltip.css({left: left, top: topPos});
294
            fsTooltip.addClass('visible arrow-down');
295
        }
296
    });
297
 
298
    $(document).on('mouseleave', '[data-tip]', function () {
299
        fsTooltip.removeClass('visible arrow-down arrow-up');
300
    });
301
 
33649 tejus.loha 302
    var dtable = $('#financePartnerServices').DataTable(
303
            {
304
                "scrollX": true,
305
                "scrollY": "700px",
306
                "fixedColumns": {
307
                    leftColumns: 3
308
                },
35971 aman 309
                "initComplete": function () {
310
                    applyTooltips();
311
                }
33649 tejus.loha 312
            });
313
 
35971 aman 314
    dtable.on('draw.dt', function () {
315
        setTimeout(applyTooltips, 100);
316
    });
33649 tejus.loha 317
 
35971 aman 318
 
33649 tejus.loha 319
</script>