Skip to content

Commit 8ae1c39

Browse files
committed
Enhance Privacy and Terms pages with detailed content; implement Google Analytics tracking and event handling
1 parent 66ab504 commit 8ae1c39

9 files changed

Lines changed: 352 additions & 9 deletions

File tree

Web/Pages/Privacy.cshtml

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,87 @@
22
@model PrivacyModel
33
@{
44
ViewData["Title"] = "Privacy Policy";
5+
ViewData["Description"] = "Learn how Copilot That Jawn protects your privacy and manages your data.";
56
}
6-
<h1>@ViewData["Title"]</h1>
77

8-
<p>Use this page to detail your site's privacy policy.</p>
8+
<div class="container py-4">
9+
<h1 class="mb-4">@ViewData["Title"]</h1>
10+
11+
<p class="lead mb-4">
12+
At Copilot That Jawn, we value your privacy and are committed to protecting your personal information.
13+
This privacy policy explains how we collect, use, and safeguard your data when you visit our website.
14+
</p>
15+
16+
<h2 class="h4 mt-5 mb-3">Information We Collect</h2>
17+
<p>We collect information that your browser sends whenever you visit our website. This may include:</p>
18+
<ul class="mb-4">
19+
<li>Your IP address</li>
20+
<li>Browser type and version</li>
21+
<li>Pages you visit on our site</li>
22+
<li>Time and date of your visits</li>
23+
<li>Time spent on pages</li>
24+
<li>Device information</li>
25+
</ul>
26+
27+
<h2 class="h4 mt-5 mb-3">Google Analytics</h2>
28+
<p>
29+
We use Google Analytics to analyze the use of our website. Google Analytics is a web analytics service
30+
provided by Google that uses cookies to collect standard internet log information and visitor behavior
31+
information in an anonymous form. The information generated by the cookie about your use of the website
32+
(including your IP address) is transmitted to Google.
33+
</p>
34+
<p>
35+
This information is used to evaluate visitors' use of the website and to compile statistical reports
36+
on website activity. We will never use the statistical analytics tool to track or to collect any
37+
personally identifiable information of visitors to our site.
38+
</p>
39+
<p>
40+
You can opt-out of Google Analytics by installing the
41+
<a href="https://tools.google.com/dlpage/gaoptout" target="_blank" rel="noopener noreferrer">
42+
Google Analytics Opt-out Browser Add-on
43+
</a>.
44+
</p>
45+
46+
<h2 class="h4 mt-5 mb-3">Cookies</h2>
47+
<p>
48+
Our website uses cookies to enhance your browsing experience. These include:
49+
</p>
50+
<ul class="mb-4">
51+
<li>Essential cookies required for the website to function</li>
52+
<li>Analytics cookies to understand how visitors interact with our website</li>
53+
<li>Theme preference cookies to remember your display settings</li>
54+
</ul>
55+
56+
<h2 class="h4 mt-5 mb-3">How We Use Your Information</h2>
57+
<p>We use the collected information for:</p>
58+
<ul class="mb-4">
59+
<li>Improving our website's content and functionality</li>
60+
<li>Understanding user behavior and preferences</li>
61+
<li>Analyzing website performance and traffic patterns</li>
62+
<li>Enhancing user experience</li>
63+
</ul>
64+
65+
<h2 class="h4 mt-5 mb-3">Data Security</h2>
66+
<p>
67+
We implement appropriate security measures to protect your information. However, no method of
68+
transmission over the internet is 100% secure, and we cannot guarantee absolute security.
69+
</p>
70+
71+
<h2 class="h4 mt-5 mb-3">Third-Party Links</h2>
72+
<p>
73+
Our website may contain links to third-party websites. We are not responsible for the privacy
74+
practices or content of these websites. Please review the privacy policies of other websites you visit.
75+
</p>
76+
77+
<h2 class="h4 mt-5 mb-3">Changes to This Policy</h2>
78+
<p>
79+
We may update this privacy policy from time to time. Any changes will be posted on this page,
80+
and the modification date below will be updated.
81+
</p>
82+
83+
<p class="mt-5 text-muted">Last updated: June 6, 2025</p> <h2 class="h4 mt-5 mb-3">Contact Us</h2>
84+
<p>
85+
If you have any questions about this privacy policy, please email us at
86+
<a href="mailto:[email protected]">info@copilotthatjawn.com</a>.
87+
</p>
88+
</div>

Web/Pages/Privacy.cshtml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ namespace Web.Pages;
66
public class PrivacyModel : PageModel
77
{
88
private readonly ILogger<PrivacyModel> _logger;
9+
private readonly IConfiguration _configuration;
910

10-
public PrivacyModel(ILogger<PrivacyModel> logger)
11+
public PrivacyModel(ILogger<PrivacyModel> logger, IConfiguration configuration)
1112
{
1213
_logger = logger;
14+
_configuration = configuration;
1315
}
1416

1517
public void OnGet()
1618
{
19+
_logger.LogInformation("Privacy policy page accessed at: {Time}", DateTime.UtcNow);
20+
21+
// Add the Google Analytics ID to ViewData if we want to display it in the view
22+
ViewData["GoogleAnalyticsId"] = _configuration["GoogleAnalytics:MeasurementId"];
1723
}
1824
}
1925

Web/Pages/Shared/_Layout.cshtml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<!DOCTYPE html>
1+
@inject IConfiguration Configuration
2+
<!DOCTYPE html>
23
<html lang="en">
34
<head> <meta charset="utf-8" />
45
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -19,6 +20,15 @@
1920
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
2021
<link rel="stylesheet" href="~/Web.styles.css" asp-append-version="true" />
2122
@await RenderSectionAsync("Styles", required: false)
23+
24+
<!-- Google Analytics -->
25+
<script async src="https://www.googletagmanager.com/gtag/js?id=@Configuration["GoogleAnalytics:MeasurementId"]"></script>
26+
<script>
27+
window.dataLayer = window.dataLayer || [];
28+
function gtag(){dataLayer.push(arguments);}
29+
gtag('js', new Date());
30+
gtag('config', '@Configuration["GoogleAnalytics:MeasurementId"]');
31+
</script>
2232
</head>
2333
<body>
2434
<header>
@@ -70,9 +80,8 @@
7080
</ul>
7181
</div>
7282
<div class="col-lg-3 col-md-6">
73-
<h6 class="mb-3 text-primary fw-bold border-bottom border-2 border-primary pb-2 d-inline-block">Quick Links</h6><ul class="list-unstyled">
74-
<li class="mb-2"><a asp-page="/About" class="text-decoration-none text-muted hover-primary">About</a></li>
75-
<li class="mb-2"><a href="#" class="text-decoration-none text-muted hover-primary">Contact</a></li> <li class="mb-2"><a href="#" class="text-decoration-none text-muted hover-primary">Terms</a></li>
83+
<h6 class="mb-3 text-primary fw-bold border-bottom border-2 border-primary pb-2 d-inline-block">Quick Links</h6><ul class="list-unstyled"> <li class="mb-2"><a asp-page="/About" class="text-decoration-none text-muted hover-primary">About</a></li>
84+
<li class="mb-2"><a href="mailto:[email protected]" class="text-decoration-none text-muted hover-primary">Contact</a></li> <li class="mb-2"><a asp-page="/Terms" class="text-decoration-none text-muted hover-primary">Terms</a></li>
7685
<li class="mb-2"><a asp-page="/Privacy" class="text-decoration-none text-muted hover-primary">Privacy</a></li>
7786
<li class="mb-2"><a href="/feed.rss" class="text-decoration-none text-muted hover-primary">RSS Feed</a></li>
7887
</ul>
@@ -94,7 +103,9 @@
94103
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-typescript.min.js"></script>
95104
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-powershell.min.js"></script>
96105
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-json.min.js"></script>
97-
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-yaml.min.js"></script> <script src="~/js/site.js" asp-append-version="true"></script> <script src="~/js/theme-switcher.js" asp-append-version="true"></script>
106+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-yaml.min.js"></script> <script src="~/js/site.js" asp-append-version="true"></script>
107+
<script src="~/js/theme-switcher.js" asp-append-version="true"></script>
108+
<script src="~/js/analytics.js" asp-append-version="true"></script>
98109
<script>
99110
// Fix for code highlighting in theme changes
100111
document.addEventListener('DOMContentLoaded', function() {

Web/Pages/Terms.cshtml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
@page
2+
@model TermsModel
3+
@{
4+
ViewData["Title"] = "Terms of Service";
5+
ViewData["Description"] = "Terms of Service for Copilot That Jawn - Read our terms and conditions for using our AI tools and content platform.";
6+
}
7+
8+
<div class="container py-5">
9+
<h1 class="mb-4">Terms of Service</h1>
10+
<p class="lead mb-5">Last updated: June 6, 2025</p>
11+
12+
<div class="terms-section mb-4">
13+
<h2 class="h4 mb-3">1. Acceptance of Terms</h2>
14+
<p>By accessing and using Copilot That Jawn (the "Website"), you accept and agree to be bound by these Terms of Service ("Terms"). If you do not agree to these Terms, please do not use the Website.</p>
15+
</div>
16+
17+
<div class="terms-section mb-4">
18+
<h2 class="h4 mb-3">2. User Content</h2>
19+
<p>When you submit content to our Website ("User Content"), you grant us a worldwide, non-exclusive, royalty-free license to use, reproduce, modify, adapt, publish, translate, and distribute your content.</p>
20+
<p>You represent and warrant that:</p>
21+
<ul>
22+
<li>You own or have the necessary rights to the content you submit</li>
23+
<li>Your content does not violate any intellectual property rights</li>
24+
<li>Your content does not contain malicious code or malware</li>
25+
<li>Your content complies with these Terms and applicable laws</li>
26+
</ul>
27+
</div>
28+
29+
<div class="terms-section mb-4">
30+
<h2 class="h4 mb-3">3. Content Guidelines</h2>
31+
<p>User Content must not:</p>
32+
<ul>
33+
<li>Be unlawful, harmful, threatening, abusive, harassing, defamatory, or invasive of privacy</li>
34+
<li>Infringe upon intellectual property rights</li>
35+
<li>Contain malware, viruses, or harmful code</li>
36+
<li>Promote illegal activities or contain inappropriate content</li>
37+
<li>Impersonate others or misrepresent your identity</li>
38+
<li>Contain adult content, NSFW (Not Safe For Work) material, or explicit content</li>
39+
<li>Include profanity or offensive language</li>
40+
<li>Contain content that would be inappropriate in a professional work environment</li>
41+
</ul>
42+
<p class="mt-3">All content submitted must be "Safe For Work" and appropriate for a professional development community. This includes:</p>
43+
<ul>
44+
<li>Code examples and snippets must be professional and work-appropriate</li>
45+
<li>Documentation and tutorials must maintain professional language</li>
46+
<li>Screenshots and images must be appropriate for a work environment</li>
47+
<li>Comments and discussions must remain professional and courteous</li>
48+
<li>Technical discussions must focus on educational value</li>
49+
<li>All shared resources must be suitable for workplace viewing</li>
50+
</ul>
51+
<p class="mt-3">We maintain a strict professional environment for learning and development. Content that violates these guidelines will be removed without notice.</p>
52+
</div>
53+
54+
<div class="terms-section mb-4">
55+
<h2 class="h4 mb-3">4. Content Moderation</h2>
56+
<p>All content on this website is managed through GitHub pull requests in our <a href="https://github.com/csharpfritz/copilotthatjawn" target="_blank" rel="noopener noreferrer">public repository</a>. Our content moderation process includes:</p>
57+
<ul>
58+
<li>Review of all pull requests before merging into the main repository</li>
59+
<li>Automated checks for content compliance and code quality</li>
60+
<li>Manual review by repository maintainers</li>
61+
<li>Issue tracking for content-related concerns</li>
62+
<li>Content moderation decisions are final</li>
63+
</ul>
64+
<p>If you find content that violates our guidelines:</p>
65+
<ul>
66+
<li>Open an issue on our <a href="https://github.com/csharpfritz/copilotthatjawn/issues" target="_blank" rel="noopener noreferrer">GitHub repository</a></li>
67+
<li>Provide specific details about the content in question</li>
68+
<li>Include the relevant file path or URL</li>
69+
<li>Allow 24-48 hours for maintainers to review</li>
70+
</ul>
71+
<p>For urgent content moderation inquiries: <a href="mailto:[email protected]">moderation@copilotthatjawn.com</a></p>
72+
</div>
73+
74+
<div class="terms-section mb-4">
75+
<h2 class="h4 mb-3">5. AI Tools and Services</h2>
76+
<p>Information about AI tools and services is provided for educational purposes only:</p>
77+
<ul>
78+
<li>All AI-generated content must be reviewed for workplace appropriateness</li>
79+
<li>Users must validate AI outputs before implementation</li>
80+
<li>No sensitive or confidential information should be shared with AI services</li>
81+
<li>AI-generated code must comply with professional standards</li>
82+
<li>Users are responsible for ensuring AI outputs are work-appropriate</li>
83+
</ul>
84+
<p class="mt-3">When using our AI tools:</p>
85+
<ul>
86+
<li>Maintain professional context in all prompts and interactions</li>
87+
<li>Review all generated content before sharing</li>
88+
<li>Report any inappropriate AI-generated content immediately</li>
89+
<li>Follow best practices for safe AI usage</li>
90+
</ul>
91+
</div>
92+
93+
<div class="terms-section mb-4">
94+
<h2 class="h4 mb-3">6. User Responsibilities</h2>
95+
<p>You agree to:</p>
96+
<ul>
97+
<li>Provide accurate information</li>
98+
<li>Use the Website legally and responsibly</li>
99+
<li>Not attempt to gain unauthorized access</li>
100+
<li>Not interfere with Website functionality</li>
101+
<li>Not collect user information without consent</li>
102+
<li>Review content guidelines before submitting any content</li>
103+
<li>Keep all submitted code examples focused on educational purposes</li>
104+
<li>Maintain professional conduct in all interactions</li>
105+
<li>Report any content that violates our guidelines</li>
106+
<li>Respect intellectual property rights when sharing code or resources</li>
107+
</ul>
108+
<p class="mt-3">As a professional development community, we expect all users to:</p>
109+
<ul>
110+
<li>Share knowledge in a constructive and respectful manner</li>
111+
<li>Focus on technical content and educational value</li>
112+
<li>Help maintain a safe and professional environment</li>
113+
</ul>
114+
</div>
115+
116+
<div class="terms-section mb-4">
117+
<h2 class="h4 mb-3">7. Privacy and Data Protection</h2>
118+
<p>We take your privacy and data protection seriously:</p>
119+
<ul>
120+
<li>All content and interactions are monitored for compliance with our professional standards</li>
121+
<li>Personal information is collected and processed in accordance with our Privacy Policy</li>
122+
<li>Code snippets and examples are screened for security vulnerabilities</li>
123+
<li>We implement industry-standard security measures to protect user data</li>
124+
<li>Users are responsible for reviewing code before implementation in production environments</li>
125+
</ul>
126+
</div>
127+
128+
<div class="terms-section mb-4">
129+
<h2 class="h4 mb-3">8. Limitation of Liability</h2>
130+
<p>We shall not be liable for any indirect, incidental, special, consequential, or punitive damages arising from Website use.</p>
131+
</div>
132+
133+
<div class="terms-section mb-4">
134+
<h2 class="h4 mb-3">9. Changes to Terms</h2>
135+
<p>We reserve the right to modify these Terms at any time. Changes will be effective immediately upon posting. Continued use of the Website constitutes acceptance of modified Terms.</p>
136+
</div>
137+
138+
<div class="terms-section mb-4">
139+
<h2 class="h4 mb-3">10. Contact Information</h2>
140+
<p>For questions about these Terms, please contact us at <a href="mailto:[email protected]">info@copilotthatjawn.com</a>.</p>
141+
</div>
142+
</div>

Web/Pages/Terms.cshtml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Microsoft.AspNetCore.Mvc.RazorPages;
2+
3+
namespace Web.Pages;
4+
5+
public class TermsModel : PageModel
6+
{
7+
public void OnGet()
8+
{
9+
}
10+
}

Web/Pages/Tips/Category.cshtml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,25 @@
204204
</div>
205205
</div>
206206

207+
<script>
208+
document.addEventListener('DOMContentLoaded', function() {
209+
// Track category view
210+
Analytics.trackCategoryView('@Model.Category');
211+
212+
// Track difficulty filter usage
213+
document.getElementById('difficulty').addEventListener('change', function() {
214+
Analytics.trackDifficultyFilter(this.value);
215+
});
216+
217+
// Track tag filter usage
218+
document.getElementById('tag').addEventListener('change', function() {
219+
if (this.value) {
220+
Analytics.trackTagClick(this.value);
221+
}
222+
});
223+
});
224+
</script>
225+
207226
<style>
208227
.tip-card {
209228
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;

Web/Pages/Tips/Details.cshtml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,4 +339,27 @@ document.addEventListener('DOMContentLoaded', function() {
339339
340340
// Note: Copy-to-clipboard functionality is handled by code-clipboard.js
341341
});
342+
343+
document.addEventListener('DOMContentLoaded', function() {
344+
// Track tip view
345+
Analytics.trackTipView('@Model.ViewModel.Tip.Title', '@Model.ViewModel.Tip.Category');
346+
347+
// Track tag clicks
348+
document.querySelectorAll('a[asp-page="/Tips/Tag"]').forEach(function(tag) {
349+
tag.addEventListener('click', function() {
350+
Analytics.trackTagClick(this.getAttribute('asp-route-tag'));
351+
});
352+
});
353+
354+
// Track social shares
355+
document.querySelectorAll('.btn[href^="https://x.com"], .btn[href^="https://bsky.app"]').forEach(function(shareBtn) {
356+
shareBtn.addEventListener('click', function() {
357+
gtag('event', 'share', {
358+
method: this.textContent.trim(),
359+
content_type: 'tip',
360+
item_id: '@Model.ViewModel.Tip.UrlSlug'
361+
});
362+
});
363+
});
364+
});
342365
</script>

Web/appsettings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
"Microsoft.AspNetCore": "Warning"
66
}
77
},
8-
"AllowedHosts": "*"
8+
"AllowedHosts": "*",
9+
"GoogleAnalytics": {
10+
"MeasurementId": "G-5Z6Y93FZC5"
11+
}
912
}

0 commit comments

Comments
 (0)