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.

211 lines
7.8 KiB

9 years ago
9 years ago
  1. {% extends "base.html" %}
  2. {% load compress static hc_extras %}
  3. {% block title %}Account Settings - {% site_name %}{% endblock %}
  4. {% block content %}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <h1 class="settings-title">
  8. Settings
  9. <small>{{ request.user.email }}</small>
  10. </h1>
  11. </div>
  12. {% if messages %}
  13. <div class="col-sm-12">
  14. {% for message in messages %}
  15. <p class="alert alert-{{ message.tags }}">{{ message }}</p>
  16. {% endfor %}
  17. </div>
  18. {% endif %}
  19. </div>
  20. <div class="row">
  21. <div class="col-sm-3">
  22. <ul class="nav nav-pills nav-stacked">
  23. <li class="active"><a href="{% url 'hc-profile' %}">Account</a></li>
  24. {% if show_pricing %}
  25. <li><a href="{% url 'hc-billing' %}">Billing</a></li>
  26. {% endif %}
  27. <li><a href="{% url 'hc-notifications' %}">Email Reports</a></li>
  28. <li><a href="{% url 'hc-badges' %}">Badges</a></li>
  29. </ul>
  30. </div>
  31. <div class="col-sm-9 col-md-6">
  32. <div class="panel panel-default">
  33. <div class="panel-body settings-block">
  34. <form method="post">
  35. {% csrf_token %}
  36. <h2>Email and Password</h2>
  37. <p>
  38. Your account's email address is
  39. <code>{{ request.user.email }}</code>
  40. <button
  41. type="submit"
  42. name="change_email"
  43. class="btn btn-default pull-right">Change Email</button>
  44. </p>
  45. <p class="clearfix"></p>
  46. <p>
  47. Attach a password to your {% site_name %} account
  48. <button
  49. type="submit"
  50. name="set_password"
  51. class="btn btn-default pull-right">Set Password</button>
  52. </p>
  53. </form>
  54. </div>
  55. </div>
  56. <div class="panel panel-{{ my_projects_status }}">
  57. <div class="panel-body settings-block">
  58. {% csrf_token %}
  59. <h2>My Projects</h2>
  60. {% if projects %}
  61. <table id="my-projects" class="table">
  62. <tr>
  63. <th>Project</th>
  64. <th>My role</th>
  65. <th></th>
  66. </tr>
  67. {% for project in profile.projects %}
  68. <tr>
  69. <td>
  70. <div class="name">
  71. <a href="{% url 'hc-checks' project.code %}">
  72. {{ project }}
  73. </a>
  74. </div>
  75. </td>
  76. <td>
  77. {% if project.owner == request.user %}
  78. Owner
  79. {% else %}
  80. Collaborator
  81. {% endif %}
  82. </td>
  83. <td>
  84. {% if project.owner == request.user %}
  85. <a
  86. href="{% url 'hc-project-settings' project.code %}"
  87. class="pull-right">Settings</a>
  88. {% else %}
  89. <a
  90. href="#"
  91. data-name="{{ project }}"
  92. data-code="{{ project.code }}"
  93. class="pull-right leave-project">Leave</a>
  94. {% endif %}
  95. </td>
  96. </tr>
  97. {% endfor %}
  98. </table>
  99. {% else %}
  100. <p>You do not have any projects. Create one!</p>
  101. {% endif %}
  102. <a
  103. id="create-project"
  104. href="#"
  105. class="btn btn-default pull-right"
  106. data-toggle="modal"
  107. data-target="#add-project-modal">Create New Project</a>
  108. </div>
  109. {% if left_project %}
  110. <div class="panel-footer">
  111. Left project <strong>{{ left_project }}</strong>.
  112. </div>
  113. {% endif %}
  114. </div>
  115. <div class="panel panel-default">
  116. <div class="panel-body settings-block">
  117. {% csrf_token %}
  118. <h2>Close Account</h2>
  119. <a
  120. id="close-account"
  121. href="#"
  122. class="btn btn-default pull-right"
  123. data-toggle="modal"
  124. data-target="#close-account-modal">Close Account</a>
  125. This will permanently remove your {% site_name %} account
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. <div id="close-account-modal" class="modal">
  131. <div class="modal-dialog">
  132. <form method="post" action="{% url 'hc-close' %}">
  133. {% csrf_token %}
  134. <div class="modal-content">
  135. <div class="modal-header">
  136. <button type="button" class="close" data-dismiss="modal">&times;</button>
  137. <h4>Close Account?</h4>
  138. </div>
  139. <div class="modal-body">
  140. <p></p>
  141. <p>You are about to permanently remove
  142. the account <strong>{{ request.user.email }}</strong> and all
  143. of its associated projects, checks and integrations. Are you sure?
  144. </p>
  145. </div>
  146. <div class="modal-footer">
  147. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  148. <button
  149. type="submit"
  150. class="btn btn-danger">Close Account</button>
  151. </div>
  152. </div>
  153. </form>
  154. </div>
  155. </div>
  156. <div id="leave-project-modal" class="modal">
  157. <div class="modal-dialog">
  158. <form id="leave-project-form" method="post">
  159. {% csrf_token %}
  160. <div class="modal-content">
  161. <div class="modal-header">
  162. <button type="button" class="close" data-dismiss="modal">&times;</button>
  163. <h4>Leave This Project?</h4>
  164. </div>
  165. <div class="modal-body">
  166. <p>
  167. You are about to leave the project <strong id="leave-project-name"></strong>.
  168. You will lose access to its checks and integrations.
  169. </p>
  170. <p>Are you sure?</p>
  171. <input
  172. type="hidden"
  173. name="code"
  174. id="leave-project-code" />
  175. </div>
  176. <div class="modal-footer">
  177. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  178. <button
  179. type="submit"
  180. name="leave_project"
  181. class="btn btn-danger">Leave Project</button>
  182. </div>
  183. </div>
  184. </form>
  185. </div>
  186. </div>
  187. {% include "accounts/add_project_modal.html" %}
  188. {% endblock %}
  189. {% block scripts %}
  190. {% compress js %}
  191. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  192. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  193. <script src="{% static 'js/profile.js' %}"></script>
  194. {% endcompress %}
  195. {% endblock %}