async loadPage(res, err, done) {
        let orders = nav.load(site);
        let order_items = chainread.orders();
        let items = chainread.items();
        let votings = chainread.votings();
        [order_items, items, votings] = await Promise.all([order_items, items, votings])

        let voteassignments = [];
        for (let i = 0; i < votings.rows.length; i++) {
            let row = votings.rows[i];

            if (row.voter !== config.user)
                continue;

            voteassignments[row.itemKey] = row;
        }


        let table_dispute = '<table class="table align-items-center table-flush">';
        table_dispute += '<tr><th>Order</th><th>Item</th><th>Reporter</th><th>Name</th><th>Description</th></th><th>Orderdate</th><th>Action</th></tr>';
        for (let i = 0; i < order_items.rows.length; i++) {
            let row = order_items.rows[i];

            //only show disputed incidents
            if (row.dispute == 0 || row.finished == 1)
                continue;

            //only show incidents where user is involved (buyer, seller or verifier)
            if (row.buyer !== config.user && row.seller !== config.user && voteassignments[row.itemKey] != undefined)
                continue;


            let item = items.rows.filter(i => i.key === row.itemKey)[0];

            table_dispute += '<tr>';
            table_dispute += '<td>' + row.key + '</td>';
            table_dispute += '<td>' + row.itemKey + '</td>';
            table_dispute += '<td>' + row.seller + '</td>';
            table_dispute += '<td>' + item.title + '</td>';
            table_dispute += '<td>' + item.description + '</td>';
            table_dispute += '<td>' + row.timestamp + '</td>';


            table_dispute += ` 
            <td><form>
                <input type="submit" class="btn btn-primary" value="Upload Key"/>
            </form></td>
            `;


            table_dispute += '</tr>';
        }
        table_dispute += '</table>';

        //place tables
        let orders_dom = new jsdom.JSDOM(orders);
        let $ = jquery(orders_dom.window);
        $('.table-responsive').html(table_dispute);
        orders = orders_dom.serialize();

        nav.deliver(res, orders, err, done);
    }
//get order page and its buttons
get order page and its buttons
get order page and its buttons
async loadPage(res, err, done) {
        let orders = nav.load(site);
        let order_items = chainread.orders();
        let items = chainread.items();
        let votings = chainread.votings();
        [order_items, items, votings] = await Promise.all([order_items, items, votings])
        let voteassignments = [];
        for (let i = 0; i < votings.rows.length; i++) {
            let row = votings.rows[i];
            if (row.voter !== config.user)
                continue;
            voteassignments[row.itemKey] = row;
        }
        let table_dispute = '<table class="table align-items-center table-flush">';
        table_dispute += '<tr><th>Order</th><th>Item</th><th>Reporter</th><th>Name</th><th>Description</th></th><th>Orderdate</th><th>Action</th></tr>';
        for (let i = 0; i < order_items.rows.length; i++) {
            let row = order_items.rows[i];
            if (row.dispute == 0 || row.finished == 1)
                continue;
            if (row.buyer !== config.user && row.seller !== config.user && voteassignments[row.itemKey] != undefined)
                continue;
            let item = items.rows.filter(i => i.key === row.itemKey)[0];
            table_dispute += '<tr>';
            table_dispute += '<td>' + row.key + '</td>';
            table_dispute += '<td>' + row.itemKey + '</td>';
            table_dispute += '<td>' + row.seller + '</td>';
            table_dispute += '<td>' + item.title + '</td>';
            table_dispute += '<td>' + item.description + '</td>';
            table_dispute += '<td>' + row.timestamp + '</td>';
            table_dispute += ` 
            <td><form>
                <input type="submit" class="btn btn-primary" value="Upload Key"/>
            </form></td>
            `;
            table_dispute += '</tr>';
        }
        table_dispute += '</table>';
        let orders_dom = new jsdom.JSDOM(orders);
        let $ = jquery(orders_dom.window);
        $('.table-responsive').html(table_dispute);
        orders = orders_dom.serialize();
        nav.deliver(res, orders, err, done);
    }
async loadPage ( res , err , done ) { let orders = nav . load ( site ) ; let order_items = chainread . orders ( ) ; let items = chainread . items ( ) ; let votings = chainread . votings ( ) ; [ order_items , items , votings ] = await Promise . all ( [ order_items , items , votings ] ) let voteassignments = [ ] ; for ( let i = 0 ; i < votings . rows . length ; i ++ ) { let row = votings . rows [ i ] ; if ( row . voter !== config . user ) continue ; voteassignments [ row . itemKey ] = row ; } let table_dispute = '<table class="table align-items-center table-flush">' ; table_dispute += '<tr><th>Order</th><th>Item</th><th>Reporter</th><th>Name</th><th>Description</th></th><th>Orderdate</th><th>Action</th></tr>' ; for ( let i = 0 ; i < order_items . rows . length ; i ++ ) { let row = order_items . rows [ i ] ; if ( row . dispute == 0 || row . finished == 1 ) continue ; if ( row . buyer !== config . user && row . seller !== config . user && voteassignments [ row . itemKey ] != undefined ) continue ; let item = items . rows . filter ( i => i . key === row . itemKey ) [ 0 ] ; table_dispute += '<tr>' ; table_dispute += '<td>' + row . key + '</td>' ; table_dispute += '<td>' + row . itemKey + '</td>' ; table_dispute += '<td>' + row . seller + '</td>' ; table_dispute += '<td>' + item . title + '</td>' ; table_dispute += '<td>' + item . description + '</td>' ; table_dispute += '<td>' + row . timestamp + '</td>' ; table_dispute += ` ` ; table_dispute += '</tr>' ; } table_dispute += '</table>' ; let orders_dom = new jsdom . JSDOM ( orders ) ; let $ = jquery ( orders_dom . window ) ; $ ( '.table-responsive' ) . html ( table_dispute ) ; orders = orders_dom . serialize ( ) ; nav . deliver ( res , orders , err , done ) ; }
get order page and its buttons
get order page and its buttons
//only show disputed incidents //only show incidents where user is involved (buyer, seller or verifier) //place tables