Fix OAuth page
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{% load static %}
|
||||
{% block title %}Food · Tasknest{% endblock %}
|
||||
{% block content %}
|
||||
<link rel="stylesheet" href="{% static 'food/food.css' %}?v=20261017-nutrition">
|
||||
<link rel="stylesheet" href="{% static 'food/food.css' %}?v=20261018-rings">
|
||||
{% include 'food/partials/diary_content.html' %}
|
||||
<script defer src="{% static 'food/quantity.js' %}?v=20261015"></script>
|
||||
<script defer src="{% static 'food/nutrient_help.js' %}?v=20261015-quantity"></script>
|
||||
|
||||
@@ -25,10 +25,11 @@
|
||||
<section class="food-macros" id="food-macro-summary" aria-label="Daily nutrition goals">
|
||||
{% for macro in macros %}<article class="food-card food-macro food-macro--{{ macro.color }}" aria-labelledby="food-goal-{{ macro.slug }}">
|
||||
<button class="food-help-trigger" type="button" aria-label="{% if help_language|slice:':2' == 'nl' %}Hulp bij {{ macro.guidance.title }}{% else %}About {{ macro.guidance.title }}{% endif %}" aria-expanded="false" aria-controls="food-help-{{ macro.slug }}" data-food-help-trigger><span aria-hidden="true">?</span></button>
|
||||
<div class="food-ring" {% if macro.percent is not None %}style="--progress:{{ macro.percent }}%" role="progressbar" aria-label="{{ macro.label }} progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="{{ macro.percent }}" aria-valuetext="{% if macro.incomplete %}At least {% endif %}{{ macro.eaten|floatformat:1 }} g of {{ macro.goal|floatformat:1 }} g{% if macro.incomplete %}; total incomplete{% endif %}"{% else %}aria-label="{{ macro.label }} progress unknown"{% endif %}><span aria-hidden="true">{% if macro.percent is not None %}{{ macro.percent }}%{% else %}—{% endif %}</span></div>
|
||||
{% include 'food/partials/progress_ring.html' with ring=macro %}
|
||||
<div><h3 id="food-goal-{{ macro.slug }}">{{ macro.label }}</h3>
|
||||
<p>{% if macro.eaten is None %}Known amount unavailable{% elif macro.incomplete %}At least {{ macro.eaten|floatformat:1 }} g{% else %}{{ macro.eaten|floatformat:1 }} g eaten{% endif %}{% if macro.goal is not None %} · {{ macro.goal|floatformat:1 }} g goal{% endif %}</p>
|
||||
{% if macro.incomplete %}<p><span class="food-warning-mark" aria-hidden="true">!</span> {% if macro.goal is not None %}Remaining unknown{% else %}Nutrition incomplete · No target{% endif %}</p>{% elif macro.goal is not None %}<p>{% if macro.remaining < 0 %}{{ macro.remaining|floatformat:1|cut:'-' }} g over target{% else %}{{ macro.remaining|floatformat:1 }} g remaining{% endif %}</p>{% else %}<p>No target</p>{% endif %}
|
||||
{% if macro.percent > 200 %}<p class="food-ring-laps">{{ macro.full_laps }} full laps{% if macro.current_lap < 100 %} + {{ macro.current_lap|floatformat:0 }}% of next{% endif %}</p>{% endif %}
|
||||
</div>
|
||||
<div class="food-help-popover" id="food-help-{{ macro.slug }}" role="region" aria-labelledby="food-help-title-{{ macro.slug }}" hidden>
|
||||
<div class="food-help-heading"><h4 id="food-help-title-{{ macro.slug }}">{{ macro.guidance.title }}</h4><button type="button" class="food-help-close" data-food-help-close aria-label="{% if help_language|slice:':2' == 'nl' %}Sluiten{% else %}Close{% endif %}">×</button></div>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="food-ring" role="img" aria-label="{{ ring.label }}: {% if ring.percent is not None %}{{ ring.percent }}% of target; {% if ring.incomplete %}at least {% endif %}{{ ring.eaten|floatformat:1 }} g of {{ ring.goal|floatformat:1 }} g{% if ring.incomplete %}; total incomplete, remaining unknown{% elif ring.remaining < 0 %}; {{ ring.remaining|floatformat:1|cut:'-' }} g over target{% else %}; {{ ring.remaining|floatformat:1 }} g remaining{% endif %}{% if ring.percent > 200 %}; {{ ring.full_laps }} full laps{% endif %}{% else %}progress unknown{% endif %}">
|
||||
<svg viewBox="0 0 54 54" aria-hidden="true" focusable="false">
|
||||
<circle class="food-ring__track" cx="27" cy="27" r="22" pathLength="100" />
|
||||
{% if ring.percent is not None %}
|
||||
<circle class="food-ring__base" cx="27" cy="27" r="22" pathLength="100" stroke-dasharray="{{ ring.base_lap }} 100" />
|
||||
{% if ring.percent > 100 %}<circle class="food-ring__extra" cx="27" cy="27" r="15" pathLength="100" stroke-dasharray="{{ ring.extra_lap }} 100" />{% endif %}
|
||||
{% endif %}
|
||||
</svg>
|
||||
<span aria-hidden="true">{% if ring.percent is not None %}{{ ring.percent }}%{% else %}—{% endif %}</span>
|
||||
</div>
|
||||
@@ -4,7 +4,7 @@
|
||||
<section class="settings-page">
|
||||
<p class="eyebrow">Personal preferences</p>
|
||||
<h1>API tokens</h1>
|
||||
<p>Give an app access to your food log and kitchen inventory. Keep tokens private.</p>
|
||||
<p>Give an app access to your food log, kitchen inventory, or private stress and dream journals. Keep tokens private.</p>
|
||||
{% if new_token %}
|
||||
<section class="settings-card" role="status">
|
||||
<h2>New token</h2>
|
||||
@@ -32,7 +32,7 @@
|
||||
</section>
|
||||
<section class="settings-card mcp-helper" data-mcp-helper>
|
||||
<h2>Connect an AI assistant</h2>
|
||||
<p>Compatible assistants can use your Food and Kitchen data through MCP. Access is limited to the permissions you grant.</p>
|
||||
<p>Compatible assistants can use your Food, Kitchen, Stress Journal, and Dream Journal data through MCP. Access is limited to the permissions you grant.</p>
|
||||
<div class="form-field">
|
||||
<label for="mcp-server-url">MCP server URL</label>
|
||||
<input id="mcp-server-url" type="url" readonly data-mcp-url>
|
||||
@@ -49,7 +49,7 @@
|
||||
<p data-mcp-status role="status" aria-live="polite"></p>
|
||||
<p class="mcp-helper__hint">Treat this token like a password. TaskNest does not save the token you paste here. You can revoke access from your API tokens.</p>
|
||||
<div class="mcp-helper__clients">
|
||||
<section><h3>ChatGPT</h3><p>Add a custom MCP app in ChatGPT and enter the MCP server URL. Select OAuth authentication, then sign in to TaskNest and approve the requested permissions. ChatGPT does not use the pasted token field.</p></section>
|
||||
<section><h3>ChatGPT</h3><p>Add a custom MCP app in ChatGPT and enter the MCP server URL. Select OAuth authentication, then sign in to TaskNest and review the requested permissions. For dream and stress tools, select the optional private journal permission on the TaskNest consent page. If reconnecting skips consent, revoke the old ChatGPT authorization above and reconnect once. ChatGPT does not use the pasted token field.</p></section>
|
||||
<section><h3>Open WebUI</h3><p>In Admin Settings → Integrations → External Tool Servers, add an MCP (Streamable HTTP) connection. Use the URL above, choose Bearer authentication, and paste your token into its Key field.</p></section>
|
||||
<section><h3>Generic MCP client</h3><p>Use Streamable HTTP at the URL above and send <code>Authorization: Bearer <your token></code> as a separate header. Never put the token in the URL.</p></section>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user