CCrypto VPN public website https://vpn.ccrypto.org/
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.
 
 
 
 
 
 

218 lines
10 KiB

  1. {% extends 'account_layout.html' %}
  2. {% load i18n %}
  3. {% load staticfiles %}
  4. {% block headers %}
  5. {% endblock %}
  6. {% block account_content %}
  7. <div>
  8. {% if user_motd %}
  9. <div class="account-motd">
  10. <p> {{ user_motd | safe }} </p>
  11. </div>
  12. {% endif %}
  13. <h1>{% trans 'Account' %} : {{user.username}}</h1>
  14. <div class="account-status">
  15. {% if subscription %}
  16. {% if subscription.status == 'active' %}
  17. <p class="account-status-paid">
  18. {% blocktrans trimmed with until=subscription.next_renew|date:'DATE_FORMAT' backend=subscription.backend.backend_verbose_name %}
  19. Your account is active. Your subscription will automatically renew on {{until}} ({{backend}}).
  20. {% endblocktrans %}
  21. </p>
  22. {% if subscription.backend_id == 'paypal' %}
  23. <p>{% trans 'You can cancel it from PayPal account.' %}</p>
  24. {% else %}
  25. <form action="/payments/cancel_subscr/{{subscription.id}}" method="post" class="pure-form centered-form" id="cancel-form">
  26. {% csrf_token %}
  27. <fieldset>
  28. <div class="pure-controls">
  29. <input type="submit" class="pure-button pure-button-primary"
  30. value="{% trans 'Cancel Subscription' %}" />
  31. </div>
  32. </fieldset>
  33. </form>
  34. <script type="text/javascript">
  35. (function() {
  36. var e = document.getElementById("cancel-form");
  37. e.onsubmit = function() {
  38. return confirm("{% trans 'Do you really want to cancel your subscription?' %}");
  39. };
  40. })();
  41. </script>
  42. {% endif %}
  43. {% else %}
  44. <p class="account-status-paid">
  45. {% blocktrans trimmed with backend=subscription.backend.backend_verbose_name %}
  46. Your subscription is waiting for confirmation by {{backend}}.
  47. It may take up to a few minutes.
  48. {% endblocktrans %}
  49. </p>
  50. {% endif %}
  51. {% elif user.vpnuser.is_paid %}
  52. <p class="account-status-paid">
  53. {% blocktrans trimmed with until=user.vpnuser.expiration|date:'DATETIME_FORMAT' %}
  54. Your account is paid until {{until}}
  55. {% endblocktrans %}
  56. {% blocktrans trimmed with left=user.vpnuser.expiration|timeuntil %}
  57. ({{ left }} left)
  58. {% endblocktrans %}
  59. </p>
  60. {% elif user.vpnuser.can_have_trial %}
  61. <p class="account-status-trial">
  62. {% blocktrans trimmed with left=user.vpnuser. %}
  63. You can activate your free trial account for two hours periods for up to one week,
  64. by clicking this button:
  65. {% endblocktrans %}
  66. <form action="/account/trial" method="post" class="pure-form" name="trial_form">
  67. {% csrf_token %}
  68. <fieldset>
  69. <div id="captcha"></div>
  70. <noscript>
  71. <input type="submit" class="pure-button pure-button-primary" value="{% trans 'Activate' %}" />
  72. </noscript>
  73. </fieldset>
  74. </form>
  75. </p>
  76. <script type="text/javascript">
  77. var captchaLoadCallback = function() {
  78. grecaptcha.render("captcha", {
  79. "sitekey": "{{ recaptcha_site_key }}",
  80. "callback": function(response) { document.trial_form.submit(); },
  81. });
  82. };
  83. </script>
  84. <script src="https://www.google.com/recaptcha/api.js?onload=captchaLoadCallback&render=explicit"
  85. async defer></script>
  86. {% else %}
  87. <p class="account-status-disabled">{% trans 'Your account is not paid.' %}</p>
  88. {% endif %}
  89. </div>
  90. {% if not subscription %}
  91. <div class="pure-g">
  92. <div class="pure-u-1 pure-u-lg-1-2 account-payment-box account-payment-tabs">
  93. <div class="account-payment-tab">
  94. <input type="radio" name="type" id="tab_subscr" value="subscr" checked />
  95. <label for="tab_subscr"><span>{% trans 'Subscription' %}</span></label>
  96. <div class="tab-content">
  97. <form action="/payments/new" method="post" class="pure-form pure-form-aligned centered-form">
  98. {% csrf_token %}
  99. <input type="hidden" name="subscr" value="1" />
  100. <fieldset>
  101. <div class="pure-control-group">
  102. <label for="ino_time">{% trans 'Pay every' %}</label>
  103. <select id="ino_time" name="time" class="pure-input-1-2">
  104. <option value="3">3 {% trans 'months' %} ({{price.3}})</option>
  105. <option value="6">6 {% trans 'months' %} ({{price.6}})</option>
  106. <option value="12">12 {% trans 'months' %} ({{price.12}})</option>
  107. </select>
  108. </div>
  109. <div class="pure-control-group">
  110. <label for="ino_method">{% trans 'with' %}</label>
  111. <select id="ino_method" name="method" class="pure-input-1-2">
  112. {% for backend in subscr_backends %}
  113. <option value="{{ backend.backend_id }}" {% if backend.backend_id == default_backend %}selected{% endif %}>
  114. {{ backend.backend_display_name }}
  115. </option>
  116. {% endfor %}
  117. </select>
  118. </div>
  119. <div class="pure-controls">
  120. <input type="submit" class="pure-button pure-button-primary"
  121. value="{% trans 'Subscribe' %}" />
  122. </div>
  123. <p>{% trans 'You can cancel the recurring payment at any time.' %}</p>
  124. </fieldset>
  125. </form>
  126. </div>
  127. </div>
  128. <div class="account-payment-tab">
  129. <input type="radio" name="type" id="tab_onetime" value="onetime" />
  130. <label for="tab_onetime"><span>{% trans 'One-time payment' %}</span></label>
  131. <div class="tab-content">
  132. <form action="/payments/new" method="post" class="pure-form pure-form-aligned centered-form">
  133. {% csrf_token %}
  134. <input type="hidden" name="subscr" value="0" />
  135. <fieldset>
  136. <div class="pure-control-group">
  137. <label for="ino_time">{% trans 'Add' %}</label>
  138. <select id="ino_time" name="time" class="pure-input-1-2">
  139. <option value="1">1 {% trans 'month' %} ({{price.1}})</option>
  140. <option value="3">3 {% trans 'months' %} ({{price.3}})</option>
  141. <option value="6">6 {% trans 'months' %} ({{price.6}})</option>
  142. <option value="12">12 {% trans 'months' %} ({{price.12}})</option>
  143. </select>
  144. </div>
  145. <div class="pure-control-group">
  146. <label for="ino_method">{% trans 'with' %}</label>
  147. <select id="ino_method" name="method" class="pure-input-1-2">
  148. {% for backend in backends %}
  149. <option value="{{ backend.backend_id }}" {% if backend.backend_id == default_backend %}selected{% endif %}>
  150. {{ backend.backend_display_name }}
  151. </option>
  152. {% endfor %}
  153. </select>
  154. </div>
  155. <div class="pure-controls">
  156. <input type="submit" class="pure-button pure-button-primary"
  157. value="{% trans 'Buy Now' %}" />
  158. </div>
  159. <p>{% trans 'If you still have time, it will be added.' %}</p>
  160. </fieldset>
  161. </form>
  162. </div>
  163. </div>
  164. </div>
  165. <div class="pure-u-1 pure-u-lg-1-2 account-giftcode-box">
  166. <form action="/account/gift_code" method="post" class="pure-form pure-form-aligned centered-form">
  167. {% csrf_token %}
  168. <fieldset>
  169. <div class="pure-control-group">
  170. <label for="ins_code">{% trans 'Gift code' %}</label>
  171. <input type="text" id="ins_code" name="code" maxlength="32"
  172. pattern="[ ]*[a-zA-Z0-9]{1,32}[ ]*" autocomplete="off" />
  173. </div>
  174. <div class="pure-controls">
  175. <input type="submit" class="pure-button pure-button-primary"
  176. value="{% trans 'Redeem gift code' %}" />
  177. </div>
  178. </fieldset>
  179. </form>
  180. </div>
  181. </div>
  182. {% endif %}
  183. <div class="account-aff-box">
  184. <p>
  185. {% blocktrans trimmed %}
  186. Get two weeks for free for every referral that takes at least one month!
  187. {% endblocktrans %}
  188. {% trans 'Share this link' %}:
  189. <form class="pure-form">
  190. <fieldset>
  191. <input type="text" size="30" value="{{ref_url}}" />
  192. <a target="_blank" href="{{twitter_link}}">{% trans 'tweet' %}</a>
  193. <a href="/static/affimg/banner.png">banner</a>
  194. <a href="/static/affimg/leaderboard.png">leaderboard</a>
  195. </fieldset>
  196. </form>
  197. </p>
  198. </div>
  199. </div>
  200. {% endblock %}