예제 #1
0
def visitorMetrics():
    visitors = Visitor()
    return render_template('visitors.html',
                           home=visitors.dashboard,
                           odds=visitors.odds,
                           map=visitors.map,
                           support=visitors.support,
                           last_update=Config.get('updated'),
                           )
예제 #2
0
def graphsMaker():
    Visitor().addVisit('graphs')
    courtTable = get_court_info_table()
    sjGraph = stakesJurorsGraph()
    return render_template('graphs.html',
                           last_update=Config.get('updated'),
                           stakedPNKgraph=sjGraph,
                           disputesgraph=disputesGraph(),
                           disputeCourtgraph=disputesbyCourtGraph(),
                           disputeCreatorgraph=disputesbyArbitratedGraph(),
                           treemapJurorsGraph=treeMapGraph(courtTable),
                           treemapStakedGraph=treeMapGraph(courtTable, 'Total Staked')
                           )
예제 #3
0
def odds():
    Visitor().addVisit('odds')
    pnkStaked = 100000
    if request.method == 'POST':
        # Form being submitted; grab data from form.
        try:
            pnkStaked = int(request.form['pnkStaked'])
        except Exception:
            pnkStaked = 100000

    return render_template('odds.html',
                           last_update=Config.get('updated'),
                           pnkStaked=pnkStaked,
                           courtChances=get_all_court_chances(pnkStaked))
예제 #4
0
def index():
    Visitor().addVisit('dashboard')
    tokenSupply = float(Config().get('token_supply'))
    tokenCircSupply = float(Config.get('PNKcirculating_supply'))
    drawnJurors = len(Juror.list())
    retention = Juror.retention() / drawnJurors
    adoption = len(Juror.adoption())
    ruledCases = Dispute().ruledCases
    openCases = Dispute().openCases
    mostActiveCourt = Dispute.mostActiveCourt()
    if mostActiveCourt:
        mostActiveCourt = Court(id=int(list(mostActiveCourt.keys())[0])).map_name
    else:
        mostActiveCourt = "No new cases in the last 7 days"
    pnkPrice = float(Config.get('PNKprice'))
    courtTable = get_court_info_table()
    pnkStaked = courtTable['General Court']['Total Staked']
    activeJurors = courtTable['General Court']['Jurors']
    return render_template('main.html',
                           last_update=Config.get('updated'),
                           disputes=Dispute.query.order_by(Dispute.id.desc()).first().id,
                           activeJurors=activeJurors,
                           jurorsdrawn=drawnJurors,
                           retention=retention,
                           adoption=adoption,
                           most_active_court=mostActiveCourt,
                           cases_closed=ruledCases,
                           cases_rulling=openCases,
                           tokenSupply=tokenSupply,
                           pnkStaked=pnkStaked,
                           pnkStakedPercent=pnkStaked/tokenSupply,
                           pnkStakedPercentSupply=pnkStaked/tokenCircSupply,
                           ethPrice=float(Config.get('ETHprice')),
                           pnkPrice=pnkPrice,
                           pnkPctChange=float(Config.get('PNKpctchange24h'))/100,
                           pnkVol24=float(Config.get('PNKvolume24h')),
                           pnkCircSupply=tokenCircSupply,
                           fees_paid={'eth': float(Config.get('fees_ETH')),
                                      'pnk': float(Config.get('PNK_redistributed'))},
                           courtTable=courtTable
                           )
예제 #5
0
def support():
    Visitor().addVisit('support')
    return render_template('support.html',
                           last_update=Config.get('updated'))
예제 #6
0
def not_found(e):
    Visitor().addVisit('unknown')
    return render_template("404.html",
                           last_update=Config.get('updated'))
예제 #7
0
def maps():
    Visitor().addVisit('map')
    return render_template('kleros-map.html',
                           last_update=Config.get('updated')
                           )