Skip to content

Commit

Permalink
API Template matching more now, should be alright
Browse files Browse the repository at this point in the history
  • Loading branch information
ineshbose committed Dec 23, 2021
1 parent 67bb5b3 commit 70a17ce
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/backend/portion_mate/settings.py
Expand Up @@ -60,7 +60,7 @@
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": ["templates"],
"DIRS": [BASE_DIR / "templates"],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
Expand Down
10 changes: 0 additions & 10 deletions src/backend/templates/rest_framework/api.html

This file was deleted.

114 changes: 114 additions & 0 deletions src/backend/templates/rest_framework/base.html
@@ -0,0 +1,114 @@
{% extends "rest_framework/base.html" %}

{% block title %}{% if name %}{{ name }} | {% endif %}Portion Mate API{% endblock %}

{% block bootstrap_theme %}

<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bootswatch@3.4.0/superhero/bootstrap.min.css"/>
<style>
:root {
--primary: #79aec8;
--secondary: #417690;
--accent: #f5dd5d;
--primary-fg: #fff;

--body-fg: #333;
--body-bg: #fff;
--body-quiet-color: #666;
--body-loud-color: #000;

--header-color: #ffc;
--header-branding-color: var(--accent);
--header-bg: var(--secondary);
--header-link-color: var(--primary-fg);

--breadcrumbs-fg: #c4dce8;
--breadcrumbs-link-fg: var(--body-bg);
--breadcrumbs-bg: var(--primary);

--link-fg: #447e9b;
--link-hover-color: #036;
--link-selected-fg: #5b80b2;

--hairline-color: #e8e8e8;
--border-color: #ccc;

--error-fg: #ba2121;

--message-success-bg: #dfd;
--message-warning-bg: #ffc;
--message-error-bg: #ffefef;

--darkened-bg: #f8f8f8; /* A bit darker than --body-bg */
--selected-bg: #e4e4e4; /* E.g. selected table cells */
--selected-row: #ffc;

--button-fg: #fff;
--button-bg: var(--primary);
--button-hover-bg: #609ab6;
--default-button-bg: var(--secondary);
--default-button-hover-bg: #205067;
--close-button-bg: #888; /* Previously #bbb, contrast 1.92 */
--close-button-hover-bg: #747474;
--delete-button-bg: #ba2121;
--delete-button-hover-bg: #a41515;

--object-tools-fg: var(--button-fg);
--object-tools-bg: var(--close-button-bg);
--object-tools-hover-bg: var(--close-button-hover-bg);
}

@media (prefers-color-scheme: dark) {
:root {
--primary: #264b5d;
--primary-fg: #eee;

--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;

--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);

--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;

--hairline-color: #272727;
--border-color: #353535;

--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;

--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;

--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
}

:root {
--primary: #fd7e14;
--secondary: #ac560e;
}

body {
font-size: 14px;
font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif;
color: var(--body-fg);
background: var(--body-bg);
}
</style>
{% endblock %}

{% block branding %}
<a class='navbar-brand' rel="nofollow" href='#' style="padding: 6px 15px;">
<img src="https://portion-mate-glasgow.readthedocs.io/en/latest/assets/logo.png" width="30" height="30" style="display: inline-block!important;" alt="">
Portion Mate
</a>
{% endblock %}

0 comments on commit 70a17ce

Please sign in to comment.