Browse Source

Merge base.html and base_project.html

pull/241/head
Pēteris Caune 6 years ago
parent
commit
0b90bb23ce
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
10 changed files with 82 additions and 199 deletions
  1. +43
    -6
      hc/front/views.py
  2. +1
    -1
      templates/accounts/project.html
  3. +30
    -15
      templates/base.html
  4. +0
    -169
      templates/base_project.html
  5. +1
    -1
      templates/front/badges.html
  6. +1
    -1
      templates/front/channels.html
  7. +1
    -1
      templates/front/details.html
  8. +2
    -2
      templates/front/log.html
  9. +1
    -1
      templates/front/my_checks.html
  10. +2
    -2
      templates/integrations/add_sms.html

+ 43
- 6
hc/front/views.py View File

@ -696,7 +696,11 @@ def add_email(request):
else:
form = AddEmailForm()
ctx = {"page": "channels", "form": form}
ctx = {
"page": "channels",
"project": request.project,
"form": form
}
return render(request, "integrations/add_email.html", ctx)
@ -716,6 +720,7 @@ def add_webhook(request):
ctx = {
"page": "channels",
"project": request.project,
"form": form,
"now": timezone.now().replace(microsecond=0).isoformat()
}
@ -774,7 +779,11 @@ def add_pd(request, state=None):
"callback": callback
})
ctx = {"page": "channels", "connect_url": connect_url}
ctx = {
"page": "channels",
"project": request.project,
"connect_url": connect_url
}
return render(request, "integrations/add_pd.html", ctx)
@ -792,9 +801,14 @@ def add_pagertree(request):
else:
form = AddUrlForm()
ctx = {"page": "channels", "form": form}
ctx = {
"page": "channels",
"project": request.project,
"form": form
}
return render(request, "integrations/add_pagertree.html", ctx)
@login_required
def add_pagerteam(request):
if request.method == "POST":
@ -809,7 +823,11 @@ def add_pagerteam(request):
else:
form = AddUrlForm()
ctx = {"page": "channels", "form": form}
ctx = {
"page": "channels",
"project": request.project,
"form": form
}
return render(request, "integrations/add_pagerteam.html", ctx)
@ -835,6 +853,9 @@ def add_slack(request):
"slack_client_id": settings.SLACK_CLIENT_ID
}
if request.user.is_authenticated:
ctx["project"] = request.project
if settings.SLACK_CLIENT_ID and request.user.is_authenticated:
ctx["state"] = _prepare_state(request, "slack")
@ -909,6 +930,7 @@ def add_pushbullet(request):
ctx = {
"page": "channels",
"project": request.project,
"authorize_url": authorize_url
}
return render(request, "integrations/add_pushbullet.html", ctx)
@ -957,6 +979,7 @@ def add_discord(request):
ctx = {
"page": "channels",
"project": request.project,
"authorize_url": auth_url
}
@ -1020,6 +1043,7 @@ def add_pushover(request):
# Show Integration Settings form
ctx = {
"page": "channels",
"project": request.project,
"po_retry_delay": td(seconds=settings.PUSHOVER_EMERGENCY_RETRY_DELAY),
"po_expiration": td(seconds=settings.PUSHOVER_EMERGENCY_EXPIRATION),
}
@ -1040,7 +1064,11 @@ def add_opsgenie(request):
else:
form = AddUrlForm()
ctx = {"page": "channels", "form": form}
ctx = {
"page": "channels",
"project": request.project,
"form": form
}
return render(request, "integrations/add_opsgenie.html", ctx)
@ -1058,7 +1086,11 @@ def add_victorops(request):
else:
form = AddUrlForm()
ctx = {"page": "channels", "form": form}
ctx = {
"page": "channels",
"project": request.project,
"form": form
}
return render(request, "integrations/add_victorops.html", ctx)
@ -1110,6 +1142,8 @@ def add_telegram(request):
return redirect("hc-channels")
ctx = {
"page": "channels",
"project": request.project,
"chat_id": chat_id,
"chat_type": chat_type,
"chat_name": chat_name,
@ -1141,6 +1175,7 @@ def add_sms(request):
ctx = {
"page": "channels",
"project": request.project,
"form": form,
"profile": request.project.owner_profile
}
@ -1171,6 +1206,7 @@ def add_trello(request):
ctx = {
"page": "channels",
"project": request.project,
"authorize_url": authorize_url
}
@ -1203,6 +1239,7 @@ def add_matrix(request):
ctx = {
"page": "channels",
"project": request.project,
"form": form,
"matrix_user_id": settings.MATRIX_USER_ID
}


+ 1
- 1
templates/accounts/project.html View File

@ -1,4 +1,4 @@
{% extends "base_project.html" %}
{% extends "base.html" %}
{% load compress static hc_extras %}
{% block title %}Project Settings - {{ project }}{% endblock %}


+ 30
- 15
templates/base.html View File

@ -64,10 +64,12 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand"
href="{% url 'hc-index' %}"
title="{% site_name %} - Monitor Cron Jobs">
{% if request.user.is_authenticated %}
<a class="navbar-brand" href="/">
{% if request.user.is_authenticated and project %}
{{ project }}
<span class="caret"></span>
{% elif request.user.is_authenticated%}
<img
id="logo"
height="50"
@ -75,7 +77,7 @@
src="{% static 'img/logo.png'%}"
srcset="{% static 'img/logo.png'%} 1x, {% static 'img/[email protected]'%} 2x"
alt="{% site_name %}">
{% else %}
{% else %}
<img
id="logo"
height="50"
@ -83,11 +85,30 @@
src="{% static 'img/logo-full.png'%}"
srcset="{% static 'img/logo-full.png'%} 1x, {% static 'img/[email protected]'%} 2x"
alt="{% site_name %}">
{% endif %}
{% endif %}
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
{% if project %}
<ul id="nav-main-sections" class="nav navbar-nav">
<li {% if page == 'checks' %} class="active" {% endif %}>
<a href="{% url 'hc-checks' project.code %}">Checks</a>
</li>
<li {% if page == 'channels' %} class="active" {% endif %}>
<a href="{% url 'hc-channels' %}">Integrations</a>
</li>
<li {% if page == 'badges' %} class="active" {% endif %}>
<a href="{% url 'hc-badges' project.code %}">Badges</a>
</li>
<li {% if page == 'project' %} class="active" {% endif %}>
<a href="{% url 'hc-project-settings' project.code %}">Settings</a>
</li>
</ul>
{% endif %}
<ul id="global-links" class="nav navbar-nav navbar-right">
{% if show_pricing %}
<li {% if page == 'pricing' %} class="active" {% endif %}>
@ -108,9 +129,9 @@
<ul class="dropdown-menu">
<li class="dropdown-header">Projects</li>
{% for project in request.profile.annotated_projects %}
<li>
<li class="project-item">
<a href="{% url 'hc-checks' project.code %}">
{{ project }}
<span class="name">{{ project }}</span>
{% if project.n_down %}
<span class="badge badge-down pull-right">
{{ project.n_down }}
@ -129,12 +150,6 @@
<li><a href="{% url 'hc-login' %}">Sign In</a></li>
{% endif %}
</ul>
{% if show_search %}
<form class="navbar-form navbar-right hidden-xs hidden-sm">
<input id="search" type="text" placeholder="Search checks&hellip;" class="form-control" value="{{ search }}">
</form>
{% endif %}
</div>
</div>


+ 0
- 169
templates/base_project.html View File

@ -1,169 +0,0 @@
<!DOCTYPE html>{% load compress staticfiles hc_extras %}
<html lang="en">
<head>
<meta charset="utf-8">
<title>{% block title %}{% site_name %} - Monitor Cron Jobs. Get Notified When Your Cron Jobs Fail{% endblock %}</title>
{% block description %}
<meta name="description" content="Monitor and Get Notified When Your Cron Jobs Fail. Free alternative to Cronitor and Dead Man's Snitch.">
{% endblock %}
{% block keywords %}
<meta name="keywords" content="healthchecks, monitor cron jobs, cron monitoring, cron job syntax, health checks, crontab cheat sheet, crontab monitoring, cronjob monitoring, cron dashboard">
{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-title" content="{% site_name %}">
<meta name="application-name" content="{% site_name %}">
<link rel="icon" type="image/x-icon" href="{% static 'img/favicon.ico' %}">
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'img/apple-touch-180.png' %}">
{% compress css %}
<link rel="stylesheet" href="{% static 'css/bootstrap.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/icomoon.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/nouislider.min.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/nouislider.pips.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/bootstrap-select.min.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/snippet-copy.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/base.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/docs.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/docs_cron.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/welcome.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/my_checks.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/my_checks_desktop.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/pricing.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/syntax.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/channels.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/channel_checks.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/details.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/log.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/add_pushover.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/add_webhook.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/settings.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/ping_details.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/profile.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/checkbox.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/radio.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/billing.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/login.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/projects.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/add_project_modal.css' %}" type="text/css">
{% endcompress %}
</head>
<body class="page-{{ page }}">
{% debug_warning %}
<nav class="navbar navbar-default">
<div class="container{% if page == "checks" or page == "details" %}-fluid{% endif %}">
<div class="navbar-header">
<button
type="button"
class="navbar-toggle collapsed"
data-toggle="collapse"
data-target="#navbar"
aria-expanded="false"
aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
{{ project }}
<span class="caret"></span>
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul id="nav-main-sections" class="nav navbar-nav">
{% if project %}
<li {% if page == 'checks' %} class="active" {% endif %}>
<a href="{% url 'hc-checks' project.code %}">Checks</a>
</li>
<li {% if page == 'channels' %} class="active" {% endif %}>
<a href="{% url 'hc-channels' %}">Integrations</a>
</li>
<li {% if page == 'badges' %} class="active" {% endif %}>
<a href="{% url 'hc-badges' project.code %}">Badges</a>
</li>
<li {% if page == 'project' %} class="active" {% endif %}>
<a href="{% url 'hc-project-settings' project.code %}">Settings</a>
</li>
{% endif %}
</ul>
{% if request.user.is_authenticated %}
<ul id="global-links" class="nav navbar-nav navbar-right">
{% if show_pricing %}
<li {% if page == 'pricing' %} class="active" {% endif %}>
<a href="{% url 'hc-pricing' %}">Pricing</a>
</li>
{% endif %}
<li {% if page == 'docs' %} class="active" {% endif %}>
<a href="{% url 'hc-docs' %}">Docs</a>
</li>
<li class="dropdown">
<a id="nav-email" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">
Account
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="dropdown-header">Projects</li>
{% for project in request.profile.annotated_projects %}
<li class="project-item">
<a href="{% url 'hc-checks' project.code %}">
<span class="name">{{ project }}</span>
{% if project.n_down %}
<span class="badge badge-down pull-right">
{{ project.n_down }}
</span>
{% endif %}
</a>
</li>
{% endfor %}
<li role="separator" class="divider"></li>
<li><a href="{% url 'hc-profile' %}">Account Settings</a></li>
<li><a href="{% url 'hc-logout' %}">Log Out</a></li>
</ul>
</li>
</ul>
{% elif page != "login" %}
<ul class="nav navbar-nav navbar-right">
<li><a href="{% url 'hc-login' %}">Sign In</a></li>
</ul>
{% endif %}
</div>
</div>
</nav>
{% block containers %}
<div class="container{% if page == "checks" or page == "details" %}-fluid{% endif %}">
{% block content %}{% endblock %}
</div>
{% endblock %}
<footer class="footer">
<div class="container{% if page == "checks" or page == "details" %}-fluid{% endif %}">
<ul>
<li>
Powered by Healthchecks open-source project
(<a href="https://github.com/healthchecks/healthchecks">github</a>,
<a href="https://healthchecks.io">healthchecks.io</a>)
</li>
</ul>
</div>
</footer>
{% block scripts %}
{% compress js %}
<script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
{% endcompress %}
{% endblock %}
</body>
</html>

+ 1
- 1
templates/front/badges.html View File

@ -1,4 +1,4 @@
{% extends "base_project.html" %}
{% extends "base.html" %}
{% load compress static hc_extras %}
{% block title %}Account Settings - {% site_name %}{% endblock %}


+ 1
- 1
templates/front/channels.html View File

@ -1,4 +1,4 @@
{% extends "base_project.html" %}
{% extends "base.html" %}
{% load compress humanize static hc_extras %}
{% block title %}Integrations - {% site_name %}{% endblock %}


+ 1
- 1
templates/front/details.html View File

@ -1,4 +1,4 @@
{% extends "base_project.html" %}
{% extends "base.html" %}
{% load compress humanize static hc_extras %}
{% block title %}{{ check|down_title }}{% endblock %}


+ 2
- 2
templates/front/log.html View File

@ -1,4 +1,4 @@
{% extends "base_project.html" %}
{% extends "base.html" %}
{% load compress humanize staticfiles hc_extras %}
{% block title %}My Checks - {% site_name %}{% endblock %}
@ -9,7 +9,7 @@
<div class="row">
<div class="col-sm-12">
<ol class="breadcrumb">
<li><a href="{% url 'hc-checks' check.project.code %}">Checks</a></li>
<li><a href="{% url 'hc-checks' check.project.code %}">{{ check.project }}</a></li>
<li>
<a href="{% url 'hc-details' check.code %}">
{{ check.name_then_code }}


+ 1
- 1
templates/front/my_checks.html View File

@ -1,4 +1,4 @@
{% extends "base_project.html" %}
{% extends "base.html" %}
{% load compress static hc_extras %}
{% block title %}{{ num_down|num_down_title }}{% endblock %}


+ 2
- 2
templates/integrations/add_sms.html View File

@ -15,7 +15,7 @@
</p>
{% if show_pricing and profile.sms_limit == 0 %}
<p class="alert alert-success">
<p class="alert alert-info">
<strong>Paid plan required.</strong>
SMS messaging is not available on the free plan–sending the messages
cost too much! Please upgrade to a
@ -81,4 +81,4 @@
</form>
</div>
</div>
{% endblock %}
{% endblock %}

Loading…
Cancel
Save