Subversion Repositories SmartDukaan

Rev

Rev 33577 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<style>


    img:target {
        border: 5px solid red;
    }

    .lightbox {
        /* Default to hidden */
        display: none;

        /* Overlay entire screen */
        position: fixed;
        z-index: 999;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;

        /* A bit of padding around image */
        padding: 1em;

        /* Translucent background */
        background: rgba(0, 0, 0, 0.8);
    }

    /* Unhide the lightbox when it's the target */
    .lightbox:target {
        display: block;
    }

    .lightbox span {
        /* Full width and height */
        display: block;
        width: 100%;
        height: 100%;

        /* Size and position background image */
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
    }

</style>
<section class="wrapper">
    <h2 class="text-center">Upload Your Document</h2>
    <hr>

    <table class="table-bordered table" id="OnboardingDocumentTable">
        <thead>
        <tr>
            <th>Documents</th>
            <th>Preview</th>
            #if($isApprover)
                <th>Status</th>
                <th>Action</th>
            #else
                <th>Status</th>
            #end
        </tr>
        </thead>
        <tbody>
            #set($counter=0)
            #foreach($loiDocMaster in $activeDocMasterList)
                #set($docId=0)
                #set($status=0)
                #set($status=$masterDocIdLoiDocMap.get($loiDocMaster.getId()).getOk())
                #if($masterDocIdLoiDocMap.get($loiDocMaster.getId()).getDocId())
                    #set($docId=$masterDocIdLoiDocMap.get($loiDocMaster.getId()).getDocId())
                #end
            <tr>
                <td class="docfile">
                    <input type="hidden" name="document-master-id" value="$loiDocMaster.getId()" class="masterId">
                    <input type="hidden" name="documentName" value="$loiDocMaster.getDocName()" class="documentName">
                    <input type="hidden" name="document-id" value="$docId" class="documentId">
                    #if(!$loiDocMaster.isOptional())
                        <label style="color: #688a7e">$loiDocMaster.getDocName()</label><span
                            style="color:red ;font-size: 140%">*</span>
                        <input type="file" required>
                    #else
                        <label style="color: #688a7e">$loiDocMaster.getDocName()</label>
                        <input type="file">
                    #end
                </td>
                <td>
                    #if($docId!=0)
                        <a href="#doc-id$counter">
                            <img src="${rc.contextPath}/download-attachment?documentId=$docId" width="100"
                                 alt="">
                        </a>
                        <a href="#" class="lightbox" id="doc-id$counter">
                            <span style="background-image:url('${rc.contextPath}/download-attachment?documentId=$docId')"></span>
                        </a><br>
                        <a href="${rc.contextPath}/download-attachment?documentId=$docId">Download & View</a>
                    #end
                </td>

                #if($isApprover && $docId!=0)

                    #if($status)
                        <td>Approved</td>
                    #elseif($status.equals(false))
                        <td>Rejected</td>
                    #else
                        <td>Need to Approval</td>
                    #end

                    <td>
                        #if($status == true)
                            <button class="mk_docApproval" data-form_id="$loiId"
                                    data-doc_master_id="$loiDocMaster.getId()"
                                    data-flag="false">Reject
                            </button>
                        #elseif($status == false)
                            <button class="mk_docApproval" data-form_id="$loiId"
                                    data-doc_master_id="$loiDocMaster.getId()"
                                    data-flag="true">Accept
                            </button>
                        #else
                            <button class="mk_docApproval" data-form_id="$loiId"
                                    data-doc_master_id="$loiDocMaster.getId()"
                                    data-flag="true">Accept
                            </button>
                            <button class="mk_docApproval" data-form_id="$loiId"
                                    data-doc_master_id="$loiDocMaster.getId()"
                                    data-flag="false">Reject
                            </button>
                        #end
                    </td>

                #else
                    #if($status)
                        <td>Approved</td>
                    #elseif($status.equals(false))
                        <td>Rejected</td>
                    #else
                        <td>Need to Approval</td>
                    #end
                #end
            </tr>
                #set($counter = $counter + 1)
            #end
        </tbody>
    </table>
    <div align="right">
        <button id="uploadDocumentbtn1" value="$loiId" class="btn-primary">Upload All</button>
    </div>
</section>