adding license

This commit is contained in:
Chris Smith
2025-02-23 22:34:05 +01:00
parent 32017babae
commit 2b0ebe8948
9 changed files with 852 additions and 8 deletions

View File

@@ -35,7 +35,7 @@ class SiteController extends Controller
return [
'access' => [
'class' => AccessControl::class,
'only' => ['logout', 'signup', 'webhook'],
'only' => ['logout', 'signup', 'privacy', 'terms'],
'rules' => [
[
'actions' => ['signup'],
@@ -43,9 +43,14 @@ class SiteController extends Controller
'roles' => ['?'],
],
[
'actions' => ['webhook'],
'actions' => ['privacy'],
'allow' => true,
'roles' => ['?'],
'roles' => ['?', '@'],
],
[
'actions' => ['terms'],
'allow' => true,
'roles' => ['?', '@'],
],
[
'actions' => ['logout'],
@@ -58,7 +63,6 @@ class SiteController extends Controller
'class' => VerbFilter::class,
'actions' => [
'logout' => ['post'],
'webhook' => ['post','head'],
],
],
];
@@ -101,6 +105,16 @@ class SiteController extends Controller
return $this->render('index');
}
public function actionPrivacy()
{
return $this->render('privacy');
}
public function actionTerms()
{
return $this->render('terms');
}
/**
* Logs in a user.
*

View File

@@ -19,15 +19,29 @@ $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>" class="h-100">
<head>
<script type="text/javascript">window.$sleek=[];window.SLEEK_PRODUCT_ID=87924416;(function(){d=document;s=d.createElement("script");s.src="https://client.sleekplan.com/sdk/e.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
<?php
if (!Yii::$app->user->isGuest) {
?>
<script type="text/javascript">window.$sleek = [];
window.SLEEK_PRODUCT_ID = 87924416;
(function () {
d = document;
s = d.createElement("script");
s.src = "https://client.sleekplan.com/sdk/e.js";
s.async = 1;
d.getElementsByTagName("head")[0].appendChild(s);
})();</script>
<?php } ?>
<meta charset="<?= Yii::$app->charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<?php
$this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
<?php
$this->head() ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body class="d-flex flex-column h-100">
<?php
@@ -100,7 +114,17 @@ $this->beginPage() ?>
<footer class="footer mt-auto py-3 text-muted">
<div class="container">
<p class="float-start">&copy; <?= Html::encode(Yii::$app->name) ?> <?= date('Y') ?></p>
<p class="float-start">
&copy; <?= Html::encode(Yii::$app->name) ?> <?= date('Y') ?>
<a href="<?= Url::to(['/site/privacy']) ?>" class="text-black">Terms and Conditions</a>
<a href="<?= Url::to(['/site/privacy']) ?>">Privacy Policy</a>&nbsp;
<a href="https://x.com/caloriethingy" target="_blank" class="text-black mx-2">
<i class="bi bi-twitter-x"></i>
</a>
<a href="https://github.com/caloriethingy/website" target="_blank" class="text-black">
<i class="bi bi-github"></i>
</a>
</p>
</div>
</footer>

View File

@@ -44,6 +44,7 @@ $this->params['breadcrumbs'][] = $this->title;
</div>
<div class="form-group">
<?= Html::a('Signup', ['site/signup'], ['class' => 'btn btn-secondary']) ?>
<?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
</div>

View File

@@ -0,0 +1,67 @@
<?php
/** @var yii\web\View $this */
$this->title = 'Calorie Thingy';
$this->registerJsFile('@web/js/site.js');
?>
<header class="text-center py-5">
<div class="container">
<h1>Privacy Policy</h1>
<p class="lead">Your privacy matters to us</p>
</div>
</header>
<div class="container my-5">
<div class="row">
<div class="col-lg-8 mx-auto">
<h2>1. Information We Collect</h2>
<p>When using CalorieThingy, we collect:</p>
<ul>
<li><strong>First Name:</strong> Stored for personalization.</li>
<li><strong>Email Address:</strong> Used for account management.</li>
<li><strong>Meal Photos:</strong> Stored indefinitely unless deleted by the user.</li>
<li><strong>Caloric & Nutritional Info:</strong> AI-generated estimates.</li>
</ul>
<h2>2. How We Use Your Data</h2>
<p>We use your data to:</p>
<ul>
<li>Analyze and track meals.</li>
<li>Improve AI-based meal recognition.</li>
<li>Allow you to view past meals.</li>
<li>Send account-related notifications.</li>
</ul>
<h2>3. Data Storage & Security</h2>
<ul>
<li>Your data is securely stored in an encrypted database.</li>
<li><strong>Meal photos</strong> are stored indefinitely.</li>
<li>Security measures prevent unauthorized access.</li>
</ul>
<h2>4. Your Rights & Choices</h2>
<p>You can:</p>
<ul>
<li>Request access to your data.</li>
<li>Delete your meal photos and account info.</li>
<li>Opt-out of non-essential data processing.</li>
</ul>
<h2>5. Third-Party Services</h2>
<p>We use a paid version of <strong>Google Gemini AI</strong> for food analysis. No personally identifiable data is shared with Google.</p>
<h2>6. Changes to This Policy</h2>
<p>We may update this Privacy Policy. You will be notified of any significant changes.</p>
<h2>7. Contact Us</h2>
<p>If you have any questions, please contact us:</p>
<ul>
<li>Email: <span id="email"></span></li>
</ul>
</div>
</div>
</div>

View File

@@ -6,6 +6,7 @@
use yii\bootstrap5\Html;
use yii\bootstrap5\ActiveForm;
use yii\helpers\Url;
$this->title = 'Signup';
$this->params['breadcrumbs'][] = $this->title;
@@ -26,6 +27,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form->field($model, 'password')->passwordInput() ?>
<div class="form-group">
<p>I have read and agree to the <a href="<?= Url::to(['/site/terms']) ?>">Terms and Conditions</a>.</p>
<?= Html::submitButton('Signup', ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>
</div>

View File

@@ -0,0 +1,54 @@
<?php
/** @var yii\web\View $this */
$this->title = 'Calorie Thingy';
$this->registerJsFile('@web/js/site.js');
?>
<header class="text-center py-5">
<div class="container">
<h1>Terms & Conditions</h1>
<p class="lead">Please read these terms carefully before using CalorieThingy.</p>
</div>
</header>
<div class="container my-5">
<div class="row">
<div class="col-lg-8 mx-auto">
<h2>1. Introduction</h2>
<p>Welcome to <strong>Calorie Thingy</strong>. By accessing or using our app, you agree to these Terms and Conditions.</p>
<h2>2. Use of Our Services</h2>
<p>You agree to use CalorieThingy for personal and non-commercial purposes only. You must not misuse or abuse our services in any way.</p>
<h2>3. User Accounts</h2>
<ul>
<li>You must provide accurate and up-to-date information when creating an account.</li>
<li>You are responsible for maintaining the confidentiality of your login credentials.</li>
<li>We reserve the right to terminate accounts for violations of these terms.</li>
</ul>
<h2>4. Meal Photos & Data Storage</h2>
<ul>
<li>Meal photos you upload will be stored indefinitely unless deleted by you.</li>
<li>We use AI-powered food analysis (via Google Gemini API) to provide nutritional insights.</li>
<li>Your personal data is stored securely and is not shared with third parties without consent.</li>
</ul>
<h2>5. Limitation of Liability</h2>
<p>We do not guarantee the accuracy of AI-generated nutritional data. You are responsible for verifying any health or diet-related decisions.</p>
<h2>6. Changes to These Terms</h2>
<p>We may update these Terms at any time. Continued use of the app constitutes acceptance of the new Terms.</p>
<h2>7. Contact Us</h2>
<p>If you have any questions, please contact us:</p>
<ul>
<li>Email: <span id="email"></span></li>
</ul>
</div>
</div>
</div>

6
frontend/web/js/site.js Normal file
View File

@@ -0,0 +1,6 @@
document.addEventListener("DOMContentLoaded", function () {
let user = "info";
let domain = "caloriethingy.com";
let emailElement = document.getElementById("email");
emailElement.innerHTML = `<a href="mailto:${user}@${domain}">${user}@${domain}</a>`;
});