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