Skip to content
Snippets Groups Projects
Commit cce63f99 authored by Jens Christian Aanestad's avatar Jens Christian Aanestad
Browse files
# Conflicts:
#	src/components/BaseComponents/Menu.vue
#	src/router/index.ts
parents 707737c7 b52a5c81
No related branches found
No related tags found
1 merge request!34Feat/budget
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M680-280q25 0 42.5-17.5T740-340q0-25-17.5-42.5T680-400q-25 0-42.5 17.5T620-340q0 25 17.5 42.5T680-280Zm0 120q31 0 57-14.5t42-38.5q-22-13-47-20t-52-7q-27 0-52 7t-47 20q16 24 42 38.5t57 14.5ZM480-80q-139-35-229.5-159.5T160-516v-244l320-120 320 120v227q-19-8-39-14.5t-41-9.5v-147l-240-90-240 90v188q0 47 12.5 94t35 89.5Q310-290 342-254t71 60q11 32 29 61t41 52q-1 0-1.5.5t-1.5.5Zm200 0q-83 0-141.5-58.5T480-280q0-83 58.5-141.5T680-480q83 0 141.5 58.5T880-280q0 83-58.5 141.5T680-80ZM480-494Z" fill="#ffffff"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Zm720 0v-120q0-44-24.5-84.5T666-434q51 6 96 20.5t84 35.5q36 20 55 44.5t19 53.5v120H760ZM360-480q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47Zm400-160q0 66-47 113t-113 47q-11 0-28-2.5t-28-5.5q27-32 41.5-71t14.5-81q0-42-14.5-81T544-792q14-5 28-6.5t28-1.5q66 0 113 47t47 113ZM120-240h480v-32q0-11-5.5-20T580-306q-54-27-109-40.5T360-360q-56 0-111 13.5T140-306q-9 5-14.5 14t-5.5 20v32Zm240-320q33 0 56.5-23.5T440-640q0-33-23.5-56.5T360-720q-33 0-56.5 23.5T280-640q0 33 23.5 56.5T360-560Zm0 320Zm0-400Z" fill="#ffffff"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M640-520v-80h240v80H640Zm-280 40q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47ZM40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Zm80-80h480v-32q0-11-5.5-20T580-306q-54-27-109-40.5T360-360q-56 0-111 13.5T140-306q-9 5-14.5 14t-5.5 20v32Zm240-320q33 0 56.5-23.5T440-640q0-33-23.5-56.5T360-720q-33 0-56.5 23.5T280-640q0 33 23.5 56.5T360-560Zm0-80Zm0 400Z" fill="#ffffff"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M640-520v-80h240v80H640Zm-280 40q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47ZM40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Zm80-80h480v-32q0-11-5.5-20T580-306q-54-27-109-40.5T360-360q-56 0-111 13.5T140-306q-9 5-14.5 14t-5.5 20v32Zm240-320q33 0 56.5-23.5T440-640q0-33-23.5-56.5T360-720q-33 0-56.5 23.5T280-640q0 33 23.5 56.5T360-560Zm0-80Zm0 400Z"/></svg>
\ No newline at end of file
......@@ -38,10 +38,14 @@
@click="toUserProfile"><img src="@/assets/icons/person.svg">User Profile</a></li>
<li><a class="dropdown-item text-white dropdown-username-link" href="#"
@click="toBudget">Budget</a></li>
<li><a class="dropdown-item text-white dropdown-username-link" href="#"
@click="toFriends"><img src="@/assets/icons/friends.svg">Friends</a></li>
<li><a class="dropdown-item text-white dropdown-username-link" href="#"
@click="toSetting"><img src="@/assets/icons/settings.svg">Setting</a></li>
<li><a class="dropdown-item text-white dropdown-username-link" href="#"
@click="toFeedback"><img src="@/assets/icons/feedback.svg">Feedback</a></li>
<li><a class="dropdown-item text-white dropdown-username-link" href="#"
@click="toSetting"><img src="@/assets/icons/admin.svg">Admin table</a></li>
<li><a class="dropdown-item text-white dropdown-username-link" href="#"
@click="toLogout"><img src="@/assets/icons/logout.svg">Log out</a></li>
</ul>
......@@ -95,10 +99,6 @@ function toUserProfile() {
router.push('/profile')
}
function toBudget() {
router.push('/budget')
}
function toLogout() {
userStore.clearUserInfo();
router.push('/login')
......
......@@ -49,7 +49,7 @@ const routes = [
component: () => import('@/views/ShopView.vue'),
},
{
path: '/profile',
path: 'profile',
name: 'profile',
component: UserProfileView
},
......@@ -58,6 +58,16 @@ const routes = [
name: 'budget',
component: () => import('@/views/BudgetOverview.vue'),
},
{
path: 'friends',
name: 'friends',
component: () => import('@/views/User/UserFriendsView.vue'),
},
{
path: 'add-friend',
name: 'add-friend',
component: () => import('@/views/User/UserAddFriend.vue'),
},
{
path: 'admin',
name: 'admin',
......@@ -81,6 +91,16 @@ const routes = [
name: 'login',
component: LoginView,
},
{
path: '/forgotten-password',
name: 'forgotten-password',
component: () => import('@/views/Authentication/ForgottenPasswordView.vue'),
},
{
path: '/change-password/:token',
name: 'change-password',
component: () => import('@/views/Authentication/ChangePasswordView.vue'),
},
{
path: '/sign-up',
name: 'sign up',
......
<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-5">
<div class="card shadow-lg border-0 rounded-lg mt-5">
<div class="card-header"><h3 class="text-center font-weight-light my-4">Password Recovery</h3></div>
<div class="card-body">
<div class="small mb-3 text-muted">Enter the new password for your account</div>
<form @submit.prevent="submitForm">
<div class="form-floating mb-3">
<input v-model="newPassword" class="form-control" id="newPassword" type="password" placeholder="New Password" required>
<label for="newPassword">Enter your new password</label>
</div>
<div class="form-floating mb-3">
<input v-model="confirmPassword" class="form-control" id="confirmPassword" type="password" placeholder="Confirm Password" required>
<label for="confirmPassword">Confirm your new password</label>
</div>
<div class="d-flex align-items-center justify-content-between mt-4 mb-0">
<router-link to="/login" class="small">Return to login</router-link>
<button class="btn btn-primary" type="submit">Confirm Password</button>
</div>
</form>
</div>
<div class="card-footer text-center py-3">
<div class="small"><router-link to="/sign-up">Need an account? Sign up!</router-link></div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import axios from 'axios';
const router = useRouter();
const newPassword = ref('');
const confirmPassword = ref('');
const submitForm = async () => {
if (newPassword.value !== confirmPassword.value) {
alert('Passwords do not match!');
return;
}
try {
const response = await axios.post('/api/reset-password', {
password: newPassword.value,
confirmPassword: confirmPassword.value
});
console.log('Success:', response.data);
router.push('/login');
} catch (error) {
console.error('Error:', error);
}
};
</script>
\ No newline at end of file
<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-5">
<div class="card shadow-lg border-0 rounded-lg mt-5">
<div class="card-header"><h3 class="text-center font-weight-light my-4">Password Recovery</h3></div>
<div class="card-body">
<div class="small mb-3 text-muted">Enter your email address and we will send you a link to reset your password.</div>
<form @submit.prevent="submitForm">
<div class="form-floating mb-3">
<input v-model="email" class="form-control" id="inputEmail" type="email" placeholder="name@example.com" required>
<label for="inputEmail">Enter email address</label>
</div>
<div class="d-flex align-items-center justify-content-between mt-4 mb-0">
<router-link to="/login" class="small">Return to login</router-link>
<button class="btn btn-primary" type="submit">Reset Password</button>
</div>
<div class="text-success">
{{ confirmationMessage }}
</div>
</form>
</div>
<div class="card-footer text-center py-3">
<div class="small"><router-link to="/sign-up">Need an account? Sign up!</router-link></div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import axios from 'axios';
const router = useRouter();
const email = ref('');
let confirmationMessage = ref('');
const submitForm = async () => {
try {
const response = await axios.post('/api/password-reset', { email: email.value });
console.log('Success:', response.data);
confirmationMessage.value = 'An email has been sent to your email address with a link to reset your password.';
} catch (error) {
console.error('Error:', error);
}
};
</script>
\ No newline at end of file
......@@ -70,6 +70,23 @@ async function global() {
type: "CURRENT_STREAK",
filter: "GLOBAL",
});
let globalPointsYou = await LeaderboardService.getSurrounding({
type: "TOTAL_POINTS",
filter: "GLOBAL",
});
let globalStreakYou = await LeaderboardService.getSurrounding({
type: "TOP_STREAK",
filter: "GLOBAL",
});
let globalCurrentStreakYou = await LeaderboardService.getSurrounding({
type: "CURRENT_STREAK",
filter: "GLOBAL",
});
console.log(globalPointsYou);
console.log(globalStreakYou);
console.log(globalCurrentStreakYou);
pointsLeaderboardData.value = globalPoints.entries;
currentLeaderboardData.value = globalCurrentStreak.entries;
streakLeaderboardData.value = globalStreak.entries;
......
<template>
<div class="container">
<h1>Add Friend</h1>
<div class="row">
<form class="col-md-5" id="searchBox" role="search">
<input class="form-control me-2 custom-border" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-success" type="submit">Search</button>
</form>
<div class="col-md-8">
<div class="people-nearby">
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar7.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Sophia Page</a></h5>
<p>Software Engineer</p>
<p class="text-muted">500m away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Emma Johnson</a></h5>
<p>Model at Fashion</p>
<p class="text-muted">800m away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar5.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Nora Wilson</a></h5>
<p>Writer at Newspaper</p>
<p class="text-muted">2.5km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar4.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Diana Amber</a></h5>
<p>Student</p>
<p class="text-muted">700m away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar3.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Addison Thomas</a></h5>
<p>Barber at Fashion</p>
<p class="text-muted">1.5km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar2.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Jonathon Thompson</a></h5>
<p>Fashion Designer</p>
<p class="text-muted">2km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar7.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Olivia Steward</a></h5>
<p>Creative Director</p>
<p class="text-muted">2km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Elena Foster</a></h5>
<p>Executive Officer</p>
<p class="text-muted">4km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Brian Walton</a></h5>
<p>Designer at Designer</p>
<p class="text-muted">3km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar7.png" alt="user"
class="profile-photo-lg">
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#" class="profile-link">Cris Haris</a></h5>
<p>General Manager at Manager</p>
<p class="text-muted">1km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<style scoped>
body {
margin-top: 20px;
background: #FAFAFA;
}
.people-nearby .google-maps {
background: #f8f8f8;
border-radius: 4px;
border: 1px solid #f1f2f2;
padding: 20px;
margin-bottom: 20px;
}
.people-nearby .google-maps .map {
height: 300px;
width: 100%;
border: none;
}
.people-nearby .nearby-user {
padding: 20px 0;
border-top: 1px solid #f1f2f2;
border-bottom: 1px solid #f1f2f2;
margin-bottom: 20px;
}
img.profile-photo-lg {
height: 80px;
width: 80px;
border-radius: 50%;
}
#searchBox {
margin-bottom: 20px;
display: flex;
text-wrap: nowrap;
}
.row {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.form-control.custom-border {
border-color: #222223; /* Change to your desired color */
}
</style>
\ No newline at end of file
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment