dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

poker.gohtml (9694B)


      1 {{ define "title" }}dkf - poker{{ end }}
      2 
      3 {{ define "content" }}
      4     <div class="container mb-5">
      5         <div class="mb-3">
      6             Deposit xmr address:
      7             {{ if .Data.PokerXmrSubAddress }}<pre style="user-select: all; -webkit-user-select: all; color: #eaac45;">{{ .Data.PokerXmrSubAddress }}</pre>{{ else }}none{{ end }}
      8         </div>
      9         <div class="mb-3">
     10             <div class="float-left mr-3">
     11                 {{ if .Data.PokerXmrSubAddress }}
     12                     <img src="data:image/png;base64,{{ .Data.Img }}" class="img-thumbnail" alt="" />
     13                 {{ end }}
     14             </div>
     15             1 <small>XMR</small> == {{ .Data.XmrPrice }}<br />
     16             0.01 <small>XMR</small> == 1,000 <small>chips</small><br />
     17             rake follows <a href="https://www.pokerstars.com/poker/room/rake" rel="noopener noreferrer" target="_blank">pokerstars</a> (round half to even)<br />
     18             rake is capped<br />
     19             2 confirmations needed for deposits under 0.2 XMR (~4min)<br />
     20             10 confirmations needed for deposits over 0.2 XMR (~20min)<br />
     21             Rake back percentage is <strong>{{ .Data.RakeBackPct }}%</strong><br />
     22             <div class="clearfix"></div>
     23         </div>
     24         <div class="mb-3">
     25             <table class="mb-3">
     26                 <tr>
     27                     <td>
     28                         <span style="vertical-align: middle;">Balance: <span style="color: #eaac45;">{{ .Data.XmrBalance }} <small>pXMR</small></span></span><br />
     29                         <small>({{ .Data.XmrBalance.XmrStr }} <small>XMR</small> | {{ .Data.XmrBalance.ToPokerChip }} <small>chips</small>)</small>
     30                     </td>
     31                     <td style="vertical-align: middle;"><span class="ml-3" style="font-size: 30px; color: #1ee91e;">{{ .Data.XmrBalance.UsdStr }}</span></td>
     32                 </tr>
     33             </table>
     34             <div class="mb-3">
     35                 <a href="/poker/rake-back">Rake back</a>: <span style="color: #eaac45;">{{ .Data.RakeBack }} <small>chips</small></span>
     36                 {{ if gt .Data.RakeBack 0 }}
     37                     <form method="post" class="d-inline ml-3">
     38                         <input type="hidden" name="csrf" value="{{ .CSRF }}" />
     39                         <input type="hidden" name="form_name" value="claim_rake_back" />
     40                         <button class="btn btn-primary btn-sm">Claim chips</button>
     41                     </form>
     42                 {{ end }}
     43             </div>
     44             Free tables balance: <span style="color: #eaac45;">{{ .Data.ChipsTest }} <small>chips</small></span>
     45             <form method="post" class="d-inline ml-3">
     46                 <input type="hidden" name="csrf" value="{{ .CSRF }}" />
     47                 <input type="hidden" name="form_name" value="reset_chips" />
     48                 <button class="btn btn-primary btn-sm">Reset chips</button>
     49             </form>
     50         </div>
     51         <div class="mb-3">
     52             <hr />
     53             {{ if .Data.Error }}
     54                 <div class="alert alert-danger">{{ .Data.Error }}</div>
     55             {{ end }}
     56             <form method="post" class="form-inline">
     57                 <input type="hidden" name="csrf" value="{{ .CSRF }}" />
     58                 <input type="hidden" name="withdraw_unique" value="{{ .Data.WithdrawUnique }}" />
     59                 <input type="text" name="withdraw_address" value="{{ .Data.WithdrawAddress }}" placeholder="address" class="form-control mr-2" style="width: 400px;" />
     60                 <input type="number" name="withdraw_amount" value="{{ if gt .Data.WithdrawAmount 0 }}{{ .Data.WithdrawAmount }}{{ end }}" min="{{ .Data.MinWithdrawAmount }}" max="{{ .Data.XmrBalance }}" placeholder="amount (pXMR)" class="form-control mr-2" style="width: 170px; -moz-appearance:textfield;" />
     61                 <button class="btn btn-primary">Withdraw</button>
     62             </form>
     63             <div>To withdraw, use the "balance" (<small>{{ .Data.XmrBalance.RawString }} <small>pXMR</small></small>) which denomination is in <a href="https://www.getmonero.org/resources/moneropedia/denominations.html" rel="noopener noreferrer" target="_blank">piconero</a></div>
     64             <hr />
     65             <span>Helper to convert from/to XMR/pXMR/chips/USD...</span>
     66             <form method="post" class="form-inline">
     67                 <input type="hidden" name="csrf" value="{{ .CSRF }}" />
     68                 <input type="hidden" name="form_name" value="helper" />
     69                 <input type="text" name="amount" placeholder="Amount" class="form-control form-control-sm mr-2" style="width: 170px;" autocomplete="off" value="{{ .Data.HelperAmount }}" />
     70                 <select class="form-control form-control-sm mr-2" name="type">
     71                     <option value="xmr"{{ if eq .Data.HelperType "xmr" }} selected{{ end }}>XMR</option>
     72                     <option value="pxmr"{{ if eq .Data.HelperType "pxmr" }} selected{{ end }}>pXMR</option>
     73                     <option value="chips"{{ if eq .Data.HelperType "chips" }} selected{{ end }}>Poker chips</option>
     74                     <option value="usd"{{ if eq .Data.HelperType "usd" }} selected{{ end }}>USD</option>
     75                 </select>
     76                 <button class="btn btn-primary btn-sm">Convert</button>
     77             </form>
     78             <span>
     79                 {{ .Data.HelperXmr }} <small>XMR</small> |
     80                 {{ .Data.HelperpXmr }} <small>pXMR</small> |
     81                 {{ .Data.HelperChips }} <small>chips</small> |
     82                 {{ .Data.HelperUsd }}
     83             </span>
     84             <hr />
     85         </div>
     86         <h3>Tables</h3>
     87         {{ if .Data.ErrorTable }}
     88             <div class="alert alert-danger">{{ .Data.ErrorTable }}</div>
     89         {{ end }}
     90         <table class="table table-novpadding table-sm table-hover table-striped">
     91             <tr>
     92                 <th>Table</th>
     93                 <th class="text-center">Players</th>
     94                 <th>Min/max buy-in (chips)</th>
     95                 <th class="text-center">Big Blind</th>
     96                 <th class="text-center">Type</th>
     97                 <th class="text-right">Join</th>
     98             </tr>
     99             {{ range .Data.Tables }}
    100                 <tr>
    101                     <td class="align-middle">
    102                         {{ .Name }}<br />
    103                         {{ if gt .TableBalance 0 }}(<span style="color: #eaac45;">{{ .TableBalance }} <small>chips</small></span>){{ end }}
    104                     </td>
    105                     <td class="text-center align-middle">{{ if gt .NbSeated 0 }}<span style="color: #1ee91e; font-weight: bolder;">{{ .NbSeated }}/6</span>{{ else }}{{ .NbSeated }}/6{{ end }}</td>
    106                     <td class="align-middle">{{ .MinBuyIn }} - {{ .MaxBuyIn }}</td>
    107                     <td class="text-center align-middle">{{ .MinBet }}</td>
    108                     <td class="text-center align-middle">{{ if .IsTest }}FREE{{ else }}XMR{{ end }}</td>
    109                     <td class="text-right">
    110                         <form method="post" class="d-inline-block">
    111                             <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
    112                             <input type="hidden" name="form_name" value="join_table" />
    113                             <input type="hidden" name="table_slug" value="{{ .Slug }}" />
    114                             <div class="input-group">
    115                                 <input type="number" min="{{ .MinBuyIn.Raw }}" max="{{ .MaxBuyIn.Raw }}" name="buy_in" value="{{ .MinBuyIn.Raw }}" class="form-control form-control-sm" style="width: 100px; -moz-appearance:textfield;" />
    116                                 <div class="input-group-append">
    117                                     <button class="btn btn-primary btn-sm">Buy-in</button>
    118                                 </div>
    119                             </div>
    120                         </form>
    121                         {{ if gt .TableBalance 0 }}
    122                             <form method="post" class="d-inline-block">
    123                                 <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
    124                                 <input type="hidden" name="form_name" value="cash_out" />
    125                                 <input type="hidden" name="table_slug" value="{{ .Slug }}" />
    126                                 <button class="btn btn-primary btn-sm">Cash out</button>
    127                             </form>
    128                         {{ end }}
    129                         <a href="/poker/{{ .Slug }}" class="btn btn-primary btn-sm">Enter</a>
    130                     </td>
    131                 </tr>
    132             {{ else }}
    133                 <tr><td colspan="6"><em>No table to show</em></td></tr>
    134             {{ end }}
    135         </table>
    136 
    137         <h3>Transactions</h3>
    138         <table class="table table-novpadding table-sm table-hover table-striped">
    139             <tr>
    140                 <th>Amount XMR</th>
    141                 <th>Confirmations</th>
    142                 <th>In/Out</th>
    143                 <th>Status</th>
    144                 <th>Created at</th>
    145             </tr>
    146             {{ range .Data.Transactions }}
    147                 <tr>
    148                     <td style="font-family: monospace;">{{ .Amount.XmrStr }}</td>
    149                     <td>{{ if .IsIn }}{{ .Confirmations }}/{{ .ConfirmationsNeeded }}{{ else }}-{{ end }}</td>
    150                     <td>{{ if .IsIn }}IN{{ else }}OUT{{ end }}</td>
    151                     <td>{{ if eq .Status 1 }}pending{{ else if eq .Status 2 }}success{{ else if eq .Status 3 }}failed{{ else }}-{{ end }}</td>
    152                     <td>{{ .CreatedAt.Format "Jan 02, 2006 15:04:05" }}</td>
    153                 </tr>
    154             {{ else }}
    155                 <tr><td colspan="5"><em>No transactions to show</em></td></tr>
    156             {{ end }}
    157         </table>
    158     </div>
    159 {{ end }}