Prototype website for VPN service, Bitcoin payments via the Blockchain.info API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
6.1 KiB

11 years ago
  1. {% extends "layout.html" %}
  2. {% block title %} Dashboard - packetcrypt {% endblock %}
  3. {% block content %}
  4. <div class="uk-container-center" id="pc-dashboard-wrapper">
  5. <div class="uk-grid">
  6. <div class="uk-width-1-1">
  7. <h4 class="uk-float-right">Hello, {{ user.email }}!</h4>
  8. <br/>
  9. </div>
  10. <div class="uk-width-1-2">
  11. <div class="uk-panel">
  12. <h2 class="uk-panel-title">Account Information <i class="uk-icon-user"></i> </h2>
  13. <ul>
  14. <li>Email Address: {{ user.email }}</li>
  15. <li>Last Payment Date: {{ lastpaid }}</li>
  16. <li>Plan Expires: {{ expires }}</li>
  17. <li>Number of Support Tickets: {{ user.tickets.all() | length }} </li>
  18. <li class="uk-text-muted">Traffic This Month: 000Mb (00%)</li>
  19. <li class="uk-text-muted">Number of Referred Signups: 0</li>
  20. </ul>
  21. </div>
  22. </div>
  23. <div class="uk-width-1-2">
  24. <div class="uk-panel uk-panel-box uk-panel-box-secondary">
  25. <h2 class="uk-panel-title">Controls <i class="uk-icon-cogs uk-float-right"></i> </h2>
  26. <hr class="uk-panel-divider">
  27. <ul class="uk-nav">
  28. <li><a href="">Logout</a></li>
  29. <li><a href="">Change Password</a></li>
  30. <li><a href="{{ url_for('newticket') }}">Open Support Ticket</a></li>
  31. </ul>
  32. <div class="uk-panel" style="margin-top:1em;">
  33. {% if latest %}
  34. <a href="{{url_for('purchase')}}" class="uk-button uk-button-success uk-align-left uk-button-small">Renew</a>
  35. {% else %}
  36. <a href="{{url_for('purchase')}}" class="uk-button uk-button-success uk-align-left uk-button-small">Purchase</a>
  37. {% endif %}
  38. <div class="uk-button-group uk-align-right" style="">
  39. <button class="uk-button uk-button-disabled uk-button-small" type="submit"><i class="uk-icon-folder-open-alt"></i> Download</button>
  40. <div data-uk-dropdown>
  41. <a href="" class="uk-button uk-button-small"><i class="uk-icon-caret-down"></i></a>
  42. <div class="uk-dropdown uk-dropdown-small">
  43. <ul class="uk-nav uk-nav-dropdown">
  44. <li><a href="">Windows</a></li>
  45. <li><a href="">OSX</a></li>
  46. <li><a href="">Android</a></li>
  47. <li><a href="">iOS</a></li>
  48. </ul>
  49. </div>
  50. </div>
  51. </div> <!-- end button-group -->
  52. </div>
  53. </div>
  54. </div>
  55. <div class="uk-width-1-1">
  56. <table class="uk-table uk-table-hover uk-table-striped">
  57. <caption>Support Tickets <div class="uk-badge" style="margin-left:1em;">{{ g.user.tickets.all() | length }}</div></caption>
  58. <thead>
  59. <tr><th>Date</th><th>Subject</th><th>Status</th><th>Last Updated</th></tr>
  60. </thead>
  61. <tbody>
  62. {% if g.user.tickets.all() %}
  63. {% for ticket in g.user.tickets.all() %}
  64. <tr class="ticket-row">
  65. <td>{{ ticket.timestamp |date }}</td>
  66. <td><a href="{{ url_for('viewticket', tid=ticket.id) }}"></a>{{ ticket.subject }}</td>
  67. <td>N/A</td>
  68. <td>N/A</td>
  69. </tr>
  70. {% endfor %}
  71. {% else %}
  72. <tr><td>You have no support ticket history</td><td></td><td></td><td></td></tr>
  73. {% endif %}
  74. </tbody>
  75. </table>
  76. <br/><br/>
  77. <table class="uk-table uk-table-hover uk-table-striped">
  78. <caption>Invoices <div class="uk-badge uk-badge-danger" style="margin-left:1em;">{{ g.user.invoices.all() | length }}</div></caption>
  79. <thead>
  80. <tr><th>Date Paid</th><th>Amount Paid</th><th>Payment Address</th><th>Confirmed</th></tr>
  81. </thead>
  82. <tbody>
  83. {% if g.user.invoices.all() %}
  84. {% for invoice in g.user.invoices.all() %}
  85. <tr class="invoice-row">
  86. {% if invoice.datepaid %}
  87. <td>{{invoice.datepaid | date}}</td>
  88. {% else %}
  89. <td>Unpaid</td>
  90. {% endif %}
  91. <td>{{invoice.value_paid}}</td>
  92. <td>{{invoice.address}}</td>
  93. {% if invoice.is_confirmed %}
  94. <td><a href="{{url_for('confirm_purchase', invoice_id=invoice.id)}}"><i class="uk-icon-ok"></i></a></td>
  95. {% else %}
  96. {% if invoice.paid %}
  97. <td><a href="{{url_for('confirm_purchase', invoice_id=invoice.id)}}"><i class="uk-icon-ban-circle"></i></a></td>
  98. {% else %}
  99. <td><a href="{{url_for('confirm_purchase', invoice_id=invoice.id)}}" class="uk-button">Pay <i class="uk-icon-btc"></i></a></td>
  100. {% endif %}
  101. {% endif %}
  102. </tr>
  103. {% endfor %}
  104. {% endif %}
  105. </tbody>
  106. </table>
  107. </div>
  108. </div>
  109. </div>
  110. {% endblock %}
  111. {% block postscript %}
  112. <script type="text/javascript">
  113. $(window).load(function(){
  114. $(".ticket-row").click(function(){
  115. var tid = $(this).find("a").attr("href");
  116. window.location = tid
  117. });
  118. $(".invoice-row").click(function(){
  119. var invoice_id = $(this).find("a").attr("href");
  120. window.location = invoice_id
  121. });
  122. });
  123. </script>
  124. {% endblock %}