{% extends "base.html" %}
|
|
{% load compress staticfiles %}
|
|
|
|
{% block title %}Account Settings - healthchecks.io{% endblock %}
|
|
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<h1 class="settings-title">Settings</h1>
|
|
</div>
|
|
{% if messages %}
|
|
<div class="col-sm-12">
|
|
{% for message in messages %}
|
|
<p class="alert alert-{{ message.tags }}">{{ message }}</p>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="panel panel-default">
|
|
<div class="panel-body settings-block">
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
<h2>Monthly Reports</h2>
|
|
<label>
|
|
<input
|
|
name="reports_allowed"
|
|
type="checkbox"
|
|
{% if profile.reports_allowed %} checked {% endif %}>
|
|
Each month send me a summary of my checks
|
|
</label>
|
|
<button
|
|
name="update_reports_allowed"
|
|
type="submit"
|
|
class="btn btn-default pull-right">Save</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="panel panel-default">
|
|
<div class="panel-body settings-block">
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
<h2>Set Password</h2>
|
|
Attach a password to your healthchecks.io account
|
|
<button
|
|
type="submit"
|
|
name="set_password"
|
|
class="btn btn-default pull-right">Set Password</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="panel panel-default">
|
|
<div class="panel-body settings-block">
|
|
<h2>Team Access</h2>
|
|
{% if profile.member_set.count %}
|
|
<table class="table">
|
|
<tr>
|
|
<td>{{ profile.user.email }}</td>
|
|
<td>Owner</td>
|
|
<td></td>
|
|
</tr>
|
|
{% for member in profile.member_set.all %}
|
|
<tr>
|
|
<td>{{ member.user.email }} </td>
|
|
<td>Member</td>
|
|
<td>
|
|
<a
|
|
href="#"
|
|
data-email="{{ member.user.email }}"
|
|
class="pull-right member-remove">Remove</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% else %}
|
|
<p>
|
|
<strong>Invite team members to your account.</strong>
|
|
</p>
|
|
<p>
|
|
Share access to your checks and configured integrations
|
|
without having to share a login.
|
|
</p>
|
|
{% if not profile.team_access_allowed %}
|
|
<p>
|
|
To enable team access, please upgrade to
|
|
one of the <a href="{% url 'hc-pricing' %}">paid plans</a>.
|
|
</p>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
<br />
|
|
|
|
{% if profile.team_access_allowed %}
|
|
<a
|
|
href="#"
|
|
class="btn btn-default"
|
|
data-toggle="modal"
|
|
data-target="#set-team-name-modal">Set Team Name</a>
|
|
|
|
<a
|
|
href="#"
|
|
class="btn btn-primary pull-right"
|
|
data-toggle="modal"
|
|
data-target="#invite-team-member-modal">Invite a Team Member</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="panel panel-default">
|
|
<div class="panel-body settings-block">
|
|
<h2>API Access</h2>
|
|
{% if profile.api_key %}
|
|
{% if show_api_key %}
|
|
API key: <code>{{ profile.api_key }}</code>
|
|
<button
|
|
data-toggle="modal"
|
|
data-target="#revoke-api-key-modal"
|
|
class="btn btn-danger pull-right">Revoke</button>
|
|
|
|
{% else %}
|
|
<span class="text-success glyphicon glyphicon-ok"></span>
|
|
API access is enabled.
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
|
|
<button
|
|
type="submit"
|
|
name="show_api_key"
|
|
class="btn btn-default pull-right">Show API key</button>
|
|
</form>
|
|
{% endif %}
|
|
{% else %}
|
|
<span class="glyphicon glyphicon-remove"></span>
|
|
API access is disabled.
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
<button
|
|
type="submit"
|
|
name="create_api_key"
|
|
class="btn btn-default pull-right">Create API key</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if badge_urls %}
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="panel panel-default">
|
|
<div class="panel-body settings-block">
|
|
<h2 class="settings-title">Status Badges</h2>
|
|
<p id="badges-description">
|
|
Here are status badges for each of the tags you have used. The
|
|
badges have public, but hard-to-guess URLs. If you wish, you can
|
|
add them to your READMEs, dashboards or status pages.
|
|
</p>
|
|
<table class="badges table">
|
|
{% for badge_url in badge_urls %}
|
|
<tr>
|
|
<td>
|
|
<img src="{{ badge_url }}" alt="" />
|
|
</td>
|
|
<td>
|
|
<code>{{ badge_url }}</code>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div id="revoke-api-key-modal" class="modal">
|
|
<div class="modal-dialog">
|
|
<form id="revoke-api-key-form" method="post">
|
|
{% csrf_token %}
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="remove-check-title">Revoke API Key</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>You are about to revoke the current API key.</p>
|
|
<p>Afterwards, you can create a new API key, but there will
|
|
be <strong>no way of getting the current API
|
|
key back</strong>.
|
|
</p>
|
|
<p>Are you sure?</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
|
<button
|
|
type="submit"
|
|
name="revoke_api_key"
|
|
class="btn btn-danger">Revoke API Key</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="remove-team-member-modal" class="modal">
|
|
<div class="modal-dialog">
|
|
<form id="remove-team-member-form" method="post">
|
|
{% csrf_token %}
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="remove-check-title">Remove Team Member</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>You are about to remove <span id="rtm-email"></span> from the team.</p>
|
|
<p>Are you sure?</p>
|
|
<input
|
|
type="hidden"
|
|
name="email"
|
|
id="remove-team-member-email" />
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
|
<button
|
|
type="submit"
|
|
name="remove_team_member"
|
|
class="btn btn-danger">Remove Member from Team</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="invite-team-member-modal" class="modal">
|
|
<div class="modal-dialog">
|
|
<form method="post" class="form-horizontal">
|
|
{% csrf_token %}
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="remove-check-title">Invite a Team Member</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<ul>
|
|
<li>Team Members can create and manage Checks and Integrations</li>
|
|
<li>Only the team owner (you) can view and edit billing settings</li>
|
|
</ul>
|
|
<div class="form-group">
|
|
<label for="itm-email" class="col-sm-2 control-label">Email</label>
|
|
<div class="col-sm-9">
|
|
<input
|
|
type="email"
|
|
class="form-control"
|
|
id="itm-email"
|
|
name="email"
|
|
placeholder="[email protected]">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
|
<button
|
|
type="submit"
|
|
name="invite_team_member"
|
|
class="btn btn-primary">Send Invite</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="set-team-name-modal" class="modal">
|
|
<div class="modal-dialog">
|
|
<form method="post" class="form-horizontal">
|
|
{% csrf_token %}
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="remove-check-title">Set Team Name</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label for="team-name" class="col-sm-4 control-label">Team Name</label>
|
|
<div class="col-sm-7">
|
|
<input
|
|
type="text"
|
|
class="form-control"
|
|
id="team-name"
|
|
name="team_name"
|
|
value="{{ profile }}">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
|
<button
|
|
type="submit"
|
|
name="set_team_name"
|
|
class="btn btn-primary">Set Team Name</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
{% compress js %}
|
|
<script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
|
|
<script src="{% static 'js/bootstrap.min.js' %}"></script>
|
|
<script src="{% static 'js/profile.js' %}"></script>
|
|
{% endcompress %}
|
|
{% endblock %}
|