Skip to content

Commit 1f0fe3d

Browse files
committed
Add Dashboard and Profile pages
- Create comprehensive Dashboard page with user statistics and quick actions - Create Profile page with account settings and GitHub integration - Integrate with existing Auth0 authentication system - Add activity summaries and repository management sections - Include responsive design and accessibility features - Connect with existing navigation and site structure
1 parent 4a4744c commit 1f0fe3d

File tree

2 files changed

+326
-0
lines changed

2 files changed

+326
-0
lines changed

dashboard/index.html

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
layout: layout_en
3+
navigation: portal.html
4+
title: "Dashboard"
5+
---
6+
7+
<div class="bg-gradient-to-r from-stone-800 to-stone-900 text-white py-12 sm:py-16 lg:py-20 px-4 sm:px-6 lg:px-8">
8+
<div class="max-w-7xl mx-auto">
9+
<h1 class="heading-1 mb-4 sm:mb-6">Dashboard</h1>
10+
<p class="text-body text-gray-300">Welcome back! Manage your projects and contributions.</p>
11+
</div>
12+
</div>
13+
14+
<section class="max-w-7xl mx-auto container-padding section-padding">
15+
<div class="mb-8">
16+
<div class="bg-orange-50 border-l-4 border-orange-500 p-6 rounded-lg mb-6">
17+
<p class="text-body text-gray-700">
18+
<strong>Hello, <span id="dashboard-username">User</span>!</strong> Welcome to your Coderic dashboard. Here you can manage your projects, track your contributions, and access your resources.
19+
</p>
20+
</div>
21+
</div>
22+
23+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
24+
<!-- Quick Stats -->
25+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 hover:shadow-lg transition-shadow">
26+
<div class="flex items-center justify-between mb-4">
27+
<h3 class="text-xl font-semibold text-stone-800">Repositories</h3>
28+
<svg class="w-8 h-8 text-orange-600" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
29+
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" />
30+
</svg>
31+
</div>
32+
<p class="text-3xl font-bold text-stone-800 mb-2" id="repo-count">-</p>
33+
<p class="text-sm text-gray-600">Your active repositories</p>
34+
</div>
35+
36+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 hover:shadow-lg transition-shadow">
37+
<div class="flex items-center justify-between mb-4">
38+
<h3 class="text-xl font-semibold text-stone-800">Contributions</h3>
39+
<svg class="w-8 h-8 text-orange-600" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
40+
<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />
41+
</svg>
42+
</div>
43+
<p class="text-3xl font-bold text-stone-800 mb-2" id="contributions-count">-</p>
44+
<p class="text-sm text-gray-600">This month</p>
45+
</div>
46+
47+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 hover:shadow-lg transition-shadow">
48+
<div class="flex items-center justify-between mb-4">
49+
<h3 class="text-xl font-semibold text-stone-800">Projects</h3>
50+
<svg class="w-8 h-8 text-orange-600" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
51+
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Z" />
52+
</svg>
53+
</div>
54+
<p class="text-3xl font-bold text-stone-800 mb-2" id="projects-count">-</p>
55+
<p class="text-sm text-gray-600">Active projects</p>
56+
</div>
57+
</div>
58+
59+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
60+
<!-- Recent Activity -->
61+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6">
62+
<h2 class="heading-3 text-stone-800 mb-6">Recent Activity</h2>
63+
<div class="space-y-4">
64+
<div class="border-l-4 border-orange-500 pl-4 py-2">
65+
<p class="text-sm font-semibold text-stone-800">Repository Access</p>
66+
<p class="text-sm text-gray-600">You've been granted access to Coderic repositories</p>
67+
<p class="text-xs text-gray-500 mt-1">Just now</p>
68+
</div>
69+
<div class="border-l-4 border-blue-500 pl-4 py-2">
70+
<p class="text-sm font-semibold text-stone-800">Community Joined</p>
71+
<p class="text-sm text-gray-600">Welcome to the Coderic community!</p>
72+
<p class="text-xs text-gray-500 mt-1">Today</p>
73+
</div>
74+
</div>
75+
<div class="mt-6">
76+
<a href="/community" class="btn-secondary btn-sm inline-block" aria-label="View all activity">View All Activity</a>
77+
</div>
78+
</div>
79+
80+
<!-- Quick Actions -->
81+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6">
82+
<h2 class="heading-3 text-stone-800 mb-6">Quick Actions</h2>
83+
<div class="space-y-3">
84+
<a href="/development" class="block w-full btn-secondary btn-sm text-center" aria-label="Start a new project">
85+
Start New Project
86+
</a>
87+
<a href="https://github.com/Coderic" target="_blank" rel="noopener noreferrer" class="block w-full btn-secondary btn-sm text-center" aria-label="Browse repositories">
88+
Browse Repositories
89+
</a>
90+
<a href="/learning" class="block w-full btn-secondary btn-sm text-center" aria-label="Access learning resources">
91+
Access Learning Resources
92+
</a>
93+
<a href="/community" class="block w-full btn-secondary btn-sm text-center" aria-label="Join discussions">
94+
Join Discussions
95+
</a>
96+
</div>
97+
</div>
98+
99+
<!-- My Repositories -->
100+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 lg:col-span-2">
101+
<h2 class="heading-3 text-stone-800 mb-6">My Repositories</h2>
102+
<div class="bg-gray-50 rounded-lg p-6 text-center">
103+
<svg class="w-16 h-16 text-gray-400 mx-auto mb-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
104+
<path stroke-linecap="round" stroke-linejoin="round" d="M20.25 7.5l-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.75 7.5l1.5-3M3.75 7.5h16.5m-15-3h16.5m-15 0v3m0 0v3m0-3h16.5m-16.5 3v3m0 0v3m16.5-6v3m0 0v3m-16.5 0h16.5" />
105+
</svg>
106+
<p class="text-body text-gray-600 mb-4">You don't have any repositories yet.</p>
107+
<a href="https://github.com/Coderic" target="_blank" rel="noopener noreferrer" class="btn-primary btn-md inline-block" aria-label="Browse Coderic repositories">
108+
Browse Coderic Repositories
109+
</a>
110+
</div>
111+
</div>
112+
113+
<!-- Resources & Tools -->
114+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 lg:col-span-2">
115+
<h2 class="heading-3 text-stone-800 mb-6">Resources & Tools</h2>
116+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
117+
<a href="https://coderic.org/docs" target="_blank" rel="noopener noreferrer" class="bg-stone-50 hover:bg-stone-100 p-4 rounded-lg transition-colors">
118+
<h3 class="font-semibold text-stone-800 mb-2">Documentation</h3>
119+
<p class="text-sm text-gray-600">Access comprehensive guides and API references</p>
120+
</a>
121+
<a href="/learning" class="bg-stone-50 hover:bg-stone-100 p-4 rounded-lg transition-colors">
122+
<h3 class="font-semibold text-stone-800 mb-2">Learning Academy</h3>
123+
<p class="text-sm text-gray-600">Enhance your skills with our courses</p>
124+
</a>
125+
<a href="/community" class="bg-stone-50 hover:bg-stone-100 p-4 rounded-lg transition-colors">
126+
<h3 class="font-semibold text-stone-800 mb-2">Community</h3>
127+
<p class="text-sm text-gray-600">Connect with other developers</p>
128+
</a>
129+
</div>
130+
</div>
131+
</div>
132+
</section>
133+
134+
<script>
135+
// Load user information if authenticated
136+
if (typeof load === 'function') {
137+
load();
138+
}
139+
140+
// Update dashboard username
141+
document.addEventListener('DOMContentLoaded', function() {
142+
const username = document.getElementById('username');
143+
const dashboardUsername = document.getElementById('dashboard-username');
144+
if (username && username.textContent) {
145+
dashboardUsername.textContent = username.textContent;
146+
}
147+
});
148+
</script>

profile/index.html

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
layout: layout_en
3+
navigation: portal.html
4+
title: "Profile"
5+
---
6+
7+
<div class="bg-gradient-to-r from-stone-800 to-stone-900 text-white py-12 sm:py-16 lg:py-20 px-4 sm:px-6 lg:px-8">
8+
<div class="max-w-4xl mx-auto text-center">
9+
<div class="mb-6">
10+
<div class="w-24 h-24 bg-stone-700 rounded-full mx-auto mb-4 flex items-center justify-center">
11+
<svg class="w-16 h-16 text-stone-400" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
12+
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z" />
13+
</svg>
14+
</div>
15+
<h1 class="heading-1 mb-2" id="profile-username">User Profile</h1>
16+
<p class="text-body text-gray-300">Manage your account and preferences</p>
17+
</div>
18+
</div>
19+
</div>
20+
21+
<section class="max-w-4xl mx-auto container-padding section-padding">
22+
<!-- Profile Information -->
23+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 sm:p-8 mb-8">
24+
<h2 class="heading-3 text-stone-800 mb-6">Profile Information</h2>
25+
<div class="space-y-6">
26+
<div>
27+
<label class="block text-sm font-semibold text-stone-700 mb-2">Username</label>
28+
<div class="bg-gray-50 border border-gray-300 rounded-lg px-4 py-3">
29+
<p class="text-body text-gray-900" id="profile-username-display">-</p>
30+
</div>
31+
</div>
32+
<div>
33+
<label class="block text-sm font-semibold text-stone-700 mb-2">Email</label>
34+
<div class="bg-gray-50 border border-gray-300 rounded-lg px-4 py-3">
35+
<p class="text-body text-gray-900" id="profile-email">-</p>
36+
</div>
37+
</div>
38+
<div>
39+
<label class="block text-sm font-semibold text-stone-700 mb-2">Member Since</label>
40+
<div class="bg-gray-50 border border-gray-300 rounded-lg px-4 py-3">
41+
<p class="text-body text-gray-900">September 30, 2004</p>
42+
</div>
43+
</div>
44+
</div>
45+
</div>
46+
47+
<!-- Account Settings -->
48+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 sm:p-8 mb-8">
49+
<h2 class="heading-3 text-stone-800 mb-6">Account Settings</h2>
50+
<div class="space-y-4">
51+
<div class="flex items-center justify-between py-4 border-b border-stone-200">
52+
<div>
53+
<h3 class="text-lg font-semibold text-stone-800 mb-1">Email Notifications</h3>
54+
<p class="text-sm text-gray-600">Receive updates about your repositories and community activity</p>
55+
</div>
56+
<label class="relative inline-flex items-center cursor-pointer">
57+
<input type="checkbox" class="sr-only peer" checked>
58+
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-orange-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-orange-600"></div>
59+
</label>
60+
</div>
61+
<div class="flex items-center justify-between py-4 border-b border-stone-200">
62+
<div>
63+
<h3 class="text-lg font-semibold text-stone-800 mb-1">Repository Notifications</h3>
64+
<p class="text-sm text-gray-600">Get notified about issues, pull requests, and discussions</p>
65+
</div>
66+
<label class="relative inline-flex items-center cursor-pointer">
67+
<input type="checkbox" class="sr-only peer" checked>
68+
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-orange-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-orange-600"></div>
69+
</label>
70+
</div>
71+
<div class="flex items-center justify-between py-4">
72+
<div>
73+
<h3 class="text-lg font-semibold text-stone-800 mb-1">Public Profile</h3>
74+
<p class="text-sm text-gray-600">Make your profile visible to other community members</p>
75+
</div>
76+
<label class="relative inline-flex items-center cursor-pointer">
77+
<input type="checkbox" class="sr-only peer">
78+
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-orange-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-orange-600"></div>
79+
</label>
80+
</div>
81+
</div>
82+
</div>
83+
84+
<!-- GitHub Integration -->
85+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 sm:p-8 mb-8">
86+
<h2 class="heading-3 text-stone-800 mb-6">GitHub Integration</h2>
87+
<div class="bg-blue-50 border-l-4 border-blue-500 p-6 rounded-lg mb-6">
88+
<p class="text-body text-gray-700 mb-4">
89+
Your Coderic account is connected to GitHub. This allows you to:
90+
</p>
91+
<ul class="list-disc list-inside space-y-2 text-body text-gray-700 ml-4">
92+
<li>Access Coderic repositories</li>
93+
<li>Contribute to open source projects</li>
94+
<li>Track your contributions and activity</li>
95+
<li>Participate in community discussions</li>
96+
</ul>
97+
</div>
98+
<div class="flex flex-col sm:flex-row gap-4">
99+
<a href="https://github.com/Coderic" target="_blank" rel="noopener noreferrer" class="btn-secondary btn-md flex-1 text-center" aria-label="View GitHub profile">
100+
View on GitHub
101+
</a>
102+
<a href="https://github.com/settings/connections/applications" target="_blank" rel="noopener noreferrer" class="btn-secondary btn-md flex-1 text-center" aria-label="Manage GitHub connections">
103+
Manage Connections
104+
</a>
105+
</div>
106+
</div>
107+
108+
<!-- Activity Summary -->
109+
<div class="bg-white border-2 border-stone-200 rounded-lg p-6 sm:p-8 mb-8">
110+
<h2 class="heading-3 text-stone-800 mb-6">Activity Summary</h2>
111+
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
112+
<div class="text-center p-4 bg-stone-50 rounded-lg">
113+
<p class="text-2xl font-bold text-orange-600 mb-1" id="activity-repos">-</p>
114+
<p class="text-sm text-gray-600">Repositories</p>
115+
</div>
116+
<div class="text-center p-4 bg-stone-50 rounded-lg">
117+
<p class="text-2xl font-bold text-orange-600 mb-1" id="activity-commits">-</p>
118+
<p class="text-sm text-gray-600">Commits</p>
119+
</div>
120+
<div class="text-center p-4 bg-stone-50 rounded-lg">
121+
<p class="text-2xl font-bold text-orange-600 mb-1" id="activity-prs">-</p>
122+
<p class="text-sm text-gray-600">Pull Requests</p>
123+
</div>
124+
<div class="text-center p-4 bg-stone-50 rounded-lg">
125+
<p class="text-2xl font-bold text-orange-600 mb-1" id="activity-issues">-</p>
126+
<p class="text-sm text-gray-600">Issues</p>
127+
</div>
128+
</div>
129+
</div>
130+
131+
<!-- Danger Zone -->
132+
<div class="bg-red-50 border-2 border-red-200 rounded-lg p-6 sm:p-8">
133+
<h2 class="heading-3 text-red-800 mb-4">Danger Zone</h2>
134+
<div class="space-y-4">
135+
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
136+
<div>
137+
<h3 class="text-lg font-semibold text-red-800 mb-1">Disconnect Account</h3>
138+
<p class="text-sm text-gray-700">Disconnect your GitHub account from Coderic. You'll need to reconnect to access repositories.</p>
139+
</div>
140+
<button type="button" class="btn-secondary btn-sm whitespace-nowrap" onclick="if(confirm('Are you sure you want to disconnect your account?')) { alert('Feature coming soon'); }">
141+
Disconnect
142+
</button>
143+
</div>
144+
</div>
145+
</div>
146+
</section>
147+
148+
<script>
149+
// Load user information if authenticated
150+
if (typeof load === 'function') {
151+
load();
152+
}
153+
154+
// Update profile information
155+
document.addEventListener('DOMContentLoaded', function() {
156+
const username = document.getElementById('username');
157+
const profileUsername = document.getElementById('profile-username');
158+
const profileUsernameDisplay = document.getElementById('profile-username-display');
159+
160+
if (username && username.textContent) {
161+
profileUsername.textContent = username.textContent;
162+
profileUsernameDisplay.textContent = username.textContent;
163+
}
164+
165+
// Try to get email from Auth0 if available
166+
if (typeof webAuth !== 'undefined') {
167+
webAuth.checkSession({}, function(err, result) {
168+
if (!err && result && result.accessToken) {
169+
webAuth.client.userInfo(result.accessToken, function(err, user) {
170+
if (!err && user && user.email) {
171+
document.getElementById('profile-email').textContent = user.email;
172+
}
173+
});
174+
}
175+
});
176+
}
177+
});
178+
</script>

0 commit comments

Comments
 (0)