From fd3b57c77e698e4dfb32aaf8e27ce0c2e957e097 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Sat, 20 May 2023 15:26:24 +0100 Subject: [PATCH 01/17] Better search appearance --- .../Sections/PresentationSearch.vue | 49 ++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/src/views/Presentation/Sections/PresentationSearch.vue b/src/views/Presentation/Sections/PresentationSearch.vue index 012ada6..1a3a62a 100644 --- a/src/views/Presentation/Sections/PresentationSearch.vue +++ b/src/views/Presentation/Sections/PresentationSearch.vue @@ -3,6 +3,7 @@ import { onMounted, onUnmounted } from "vue"; import axios from 'axios'; import { ref } from "vue"; + const searchQuery = ref(''); const searchResultProjects = ref([]); const searchResultUsers = ref([]); @@ -27,9 +28,12 @@ const search = async () => { \ No newline at end of file From d1a7e27b0d05764797847150d3ea964ba5df5786 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Sat, 20 May 2023 15:32:02 +0100 Subject: [PATCH 02/17] Better search bar --- src/views/Presentation/Sections/PresentationSearch.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/Presentation/Sections/PresentationSearch.vue b/src/views/Presentation/Sections/PresentationSearch.vue index 1a3a62a..8c9197d 100644 --- a/src/views/Presentation/Sections/PresentationSearch.vue +++ b/src/views/Presentation/Sections/PresentationSearch.vue @@ -82,7 +82,7 @@ const search = async () => { /* Changes the font size */ font-size: 16px; /* Changes the background color of the button */ - background-color: #007BFF; + background-color: #3d9132; /* Changes the color of the text inside the button */ color: white; /* Makes the border corners rounded */ @@ -95,7 +95,7 @@ const search = async () => { .searchButton:hover { /* Changes the background color of the button when hovering over it */ - background-color: #0056b3; + background-color: #25581e; } \ No newline at end of file From 567b6c460fa870f6a04e6d70ea9714d0303834a4 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Sat, 20 May 2023 15:42:00 +0100 Subject: [PATCH 03/17] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=20=D1=80=D0=B5=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sections/PresentationSearch.vue | 72 ++++++++++++++----- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/src/views/Presentation/Sections/PresentationSearch.vue b/src/views/Presentation/Sections/PresentationSearch.vue index 8c9197d..3baf99d 100644 --- a/src/views/Presentation/Sections/PresentationSearch.vue +++ b/src/views/Presentation/Sections/PresentationSearch.vue @@ -35,25 +35,24 @@ const search = async () => { -
-

Найдено проектов: {{ searchResultProjects.length}}

-
-

{{ project.title }} with ID {{ project.id }}

-

{{ project.description }}

- Страница проекта - -
-

Найдено людей: {{ searchResultUsers.length}}

-
-

{{ user.username }} with id {{ user.id }}

-

{{ user.email }}

- Страница пользователя - - -
- +
+

Найдено проектов: {{ searchResultProjects.length}}

+
+
+

{{ project.title }} with ID {{ project.id }}

+

{{ project.description }}

+ Страница проекта +
- +

Найдено людей: {{ searchResultUsers.length}}

+
+
+

{{ user.username }} with id {{ user.id }}

+

{{ user.email }}

+ Страница пользователя +
+
+
@@ -97,5 +96,42 @@ const search = async () => { /* Changes the background color of the button when hovering over it */ background-color: #25581e; } +.result-header { + color: #fff; + background-color: #333; + padding: 10px; + text-align: center; + margin-top: 20px; +} + +.result-grid { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} + +.result-card { + display: flex; + flex-direction: column; + background-color: rgba(255, 255, 255, 0.5); + padding: 10px; + margin: 10px; + border-radius: 10px; + width: calc(100% / 3 - 20px); + box-sizing: border-box; +} + +@media screen and (max-width: 992px) { + .result-card { + width: calc(100% / 2 - 20px); + } +} + +@media screen and (max-width: 600px) { + .result-card { + width: 100%; + } +} + \ No newline at end of file From 16a2788b5e27657fd5ceeb9cf0e74d570d2b05b1 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Sat, 20 May 2023 15:50:04 +0100 Subject: [PATCH 04/17] =?UTF-8?q?=D0=9C=D0=BE=D0=B4=D0=B8=D1=84=D0=B8?= =?UTF-8?q?=D1=86=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=20=D1=84=D1=83=D1=82?= =?UTF-8?q?=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/examples/footers/FooterDefault.vue | 72 ++------------------- src/views/Presentation/PresentationView.vue | 44 +++++-------- 2 files changed, 23 insertions(+), 93 deletions(-) diff --git a/src/examples/footers/FooterDefault.vue b/src/examples/footers/FooterDefault.vue index d60799b..7c3fcbe 100644 --- a/src/examples/footers/FooterDefault.vue +++ b/src/examples/footers/FooterDefault.vue @@ -12,33 +12,7 @@ defineProps({ route: "/" }) }, - socials: { - type: Array, - icon: String, - link: String, - default: () => [ - { - icon: '', - link: "https://www.facebook.com/CreativeTim/" - }, - { - icon: '', - link: "https://twitter.com/creativetim" - }, - { - icon: '', - link: "https://dribbble.com/creativetim" - }, - { - icon: '', - link: "https://github.com/creativetimofficial" - }, - { - icon: '', - link: "https://www.youtube.com/channel/UCVyTG4sCw-rOvB9oHkzZD1w" - } - ] - }, + menus: { type: Array, name: String, @@ -127,51 +101,17 @@ defineProps({
-
- - - -
{{ brand.name }}
-
-
- -
-
-
-
{{ name }}
- + +
+

- All rights reserved. Copyright © + Екатерина Кузнецова, Ирина Комарова. {{ new Date().getFullYear() }} - Material Kit by + . Использованы материалы Creative Tim. diff --git a/src/views/Presentation/PresentationView.vue b/src/views/Presentation/PresentationView.vue index c8c55d4..1f22791 100644 --- a/src/views/Presentation/PresentationView.vue +++ b/src/views/Presentation/PresentationView.vue @@ -22,7 +22,6 @@ import DefaultFooter from "../../examples/footers/FooterDefault.vue"; import Header from "../../examples/Header.vue"; // sections -import PresentationCounter from "./Sections/PresentationCounter.vue"; import PresentationSearch from "./Sections/PresentationSearch.vue"; @@ -46,21 +45,24 @@ onUnmounted(() => { @@ -114,19 +116,7 @@ export default {

- - - -
- -
-
-

{{ project.title }}

-

{{ project.description }}

-
-
-
- + From 89ee3118f659fbcac1b849c416ef7ddac18360ac Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Sat, 20 May 2023 16:32:34 +0100 Subject: [PATCH 05/17] =?UTF-8?q?=D0=9F=D0=B8=D0=BB=D0=B8=D0=BC=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=86=D0=B8=D1=8E=20?= =?UTF-8?q?=D0=B8=20=D0=B2=D0=BE=D1=81=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 15 +- .../LandingPages/SignIn/BasicRegister.vue | 176 ++++++++++++++++++ src/views/LandingPages/SignIn/BasicView.vue | 16 +- .../LandingPages/SignIn/ForgotPassword.vue | 33 ++++ 4 files changed, 235 insertions(+), 5 deletions(-) create mode 100644 src/views/LandingPages/SignIn/BasicRegister.vue create mode 100644 src/views/LandingPages/SignIn/ForgotPassword.vue diff --git a/src/router/index.js b/src/router/index.js index 09881e8..d935b72 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -26,7 +26,8 @@ import ElTypography from "../layouts/sections/elements/typography/TypographyView import Project from "../views/LandingPages/Project/Project.vue"; import Profile from "../views/LandingPages/Profile/Profile.vue"; import TopSecretProject from "../views/LandingPages/Project/TopSecretProject.vue"; - +import BasicRegister from "../views/LandingPages/SignIn/BasicRegister.vue"; +import ForgotPassword from "../views/LandingPages/SignIn/ForgotPassword.vue"; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -55,6 +56,18 @@ const router = createRouter({ component: Profile }, + { + path: "/register", + name: "register", + component: BasicRegister, + }, + + { + path: "/forgot", + name: "forgot", + component: ForgotPassword, + }, + { path: "/pages/landing-pages/about-us", name: "about", diff --git a/src/views/LandingPages/SignIn/BasicRegister.vue b/src/views/LandingPages/SignIn/BasicRegister.vue new file mode 100644 index 0000000..8775585 --- /dev/null +++ b/src/views/LandingPages/SignIn/BasicRegister.vue @@ -0,0 +1,176 @@ + + + + + + diff --git a/src/views/LandingPages/SignIn/BasicView.vue b/src/views/LandingPages/SignIn/BasicView.vue index 9b85c21..a65d826 100644 --- a/src/views/LandingPages/SignIn/BasicView.vue +++ b/src/views/LandingPages/SignIn/BasicView.vue @@ -117,13 +117,13 @@ export default {
-

Опять Ты!

+

Вы вошли в аккаунт

-

Ты с какого района?

+

Пожалуйста, введите логин и пароль

@@ -160,9 +160,17 @@ export default {

Нет аккаунта? Пока что нахер идитеЗарегистироваться +

+

+ + Забыли пароль

diff --git a/src/views/LandingPages/SignIn/ForgotPassword.vue b/src/views/LandingPages/SignIn/ForgotPassword.vue new file mode 100644 index 0000000..6bcf42a --- /dev/null +++ b/src/views/LandingPages/SignIn/ForgotPassword.vue @@ -0,0 +1,33 @@ + + + + + + + + \ No newline at end of file From fdb456fe82025a75480bb019cf8ba7307d9c179d Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Sat, 20 May 2023 16:55:26 +0100 Subject: [PATCH 06/17] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=20=D1=80=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LandingPages/SignIn/BasicRegister.vue | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/views/LandingPages/SignIn/BasicRegister.vue b/src/views/LandingPages/SignIn/BasicRegister.vue index 8775585..bbd6d93 100644 --- a/src/views/LandingPages/SignIn/BasicRegister.vue +++ b/src/views/LandingPages/SignIn/BasicRegister.vue @@ -13,31 +13,38 @@ import setMaterialInput from "@/assets/js/material-input"; const username = ref(''); const password = ref(''); +const email = ref(''); // Add email const errorMessage = ref(''); const isAuthenticated = computed(() => !!sessionStorage.getItem('access_token')); // Computed property to check if the user is authenticated -const login = async () => { - if (!username.value || !password.value) { - errorMessage.value = "Please fill in both fields."; + + +// New register function +const register = async () => { + if (!username.value || !password.value || !email.value) { + errorMessage.value = "Please fill in all fields."; } else { - const url = 'http://somebodyhire.me/api/token/'; + const url = 'http://somebodyhire.me/api/register/'; const headers = { 'Content-Type': 'application/json', }; const body = { username: username.value, password: password.value, + email: email.value, // include email in the request body + is_staff: false }; try { const response = await axios.post(url, body, { headers }); - errorMessage.value = `Request:\nPOST ${url}\nHeaders: ${JSON.stringify(headers)}\nBody: ${JSON.stringify(body)}\n\nResponse:\nStatus: ${response.status}\nHeaders: ${JSON.stringify(response.headers)}\nBody: ${JSON.stringify(response.data)}`; - sessionStorage.setItem('access_token', response.data.access); // Save the access token in sessionStorage (new line) + errorMessage.value = `Registration successful. Welcome ${response.data.username}!`; // Display success message + sessionStorage.setItem('access_token', response.data.token); // Save the access token in sessionStorage } catch (error) { if (error.response) { - // The request was made and the server responded with a status code that falls out of the range of 2xx + // The request was made and the server responded with a status code + // that falls out of the range of 2xx errorMessage.value = `Request:\nPOST ${url}\nHeaders: ${JSON.stringify(headers)}\nBody: ${JSON.stringify(body)}\n\nResponse:\nStatus: ${error.response.status}\nHeaders: ${JSON.stringify(error.response.headers)}\nBody: ${JSON.stringify(error.response.data)}`; } else if (error.request) { // The request was made but no response was received @@ -50,11 +57,6 @@ const login = async () => { } }; -const logout = () => { // Method to logout the user by clearing the session storage (new function) - sessionStorage.removeItem('access_token'); -}; - - onMounted(() => { setMaterialInput(); }); @@ -66,17 +68,16 @@ export default { return { username: '', password: '', + email: '', errorMessage: '', }; }, methods: { - login() { - if (!this.username || !this.password) { - this.errorMessage = "Please fill in both fields."; - } else { - // Implement login logic here - this.errorMessage = `Can't login now, you are trying to sign in with login: ${this.username} and password: ${this.password}`; - } + register() { + this.username = username.value; + this.password = password.value; + this.email = email.value; + register(); // Call the register function }, }, }; @@ -115,15 +116,10 @@ export default {
-
- -

Опять Ты!

- -
- -
+
-

Ты с какого района?

+

Пожалуйста, зарегистрируйтесь

+

Пароль должен быть не менее 8 символов, и не быть похожим на имя пользователя или адрес почты

@@ -132,6 +128,11 @@ export default {
+
+ +
+ +
@@ -139,12 +140,12 @@ export default {
+ type="button" + class="btn bg-gradient-dark w-100 my-4 mb-2" + @click="register" +> + Зарегистрироваться +
From ea0543c476d72f0ae6a323868cd50ef19f370bae Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Sat, 20 May 2023 17:21:29 +0100 Subject: [PATCH 07/17] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D1=8B=20/Profiles=20=D0=B8=20/Projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 15 +++ .../LandingPages/Profile/AllProfiles.vue | 124 ++++++++++++++++++ .../LandingPages/Project/AllProjects.vue | 124 ++++++++++++++++++ 3 files changed, 263 insertions(+) create mode 100644 src/views/LandingPages/Profile/AllProfiles.vue create mode 100644 src/views/LandingPages/Project/AllProjects.vue diff --git a/src/router/index.js b/src/router/index.js index d935b72..cfda41a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -28,6 +28,9 @@ import Profile from "../views/LandingPages/Profile/Profile.vue"; import TopSecretProject from "../views/LandingPages/Project/TopSecretProject.vue"; import BasicRegister from "../views/LandingPages/SignIn/BasicRegister.vue"; import ForgotPassword from "../views/LandingPages/SignIn/ForgotPassword.vue"; +import Projects from "../views/LandingPages/Project/AllProjects.vue"; +import Profiles from "../views/LandingPages/Profile/AllProfiles.vue"; + const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -44,6 +47,12 @@ const router = createRouter({ component: Project }, + { + path: '/projects', + name: 'projects', + component: Projects + }, + { path: '/TopSecret', name: 'topsecretproject', @@ -56,6 +65,12 @@ const router = createRouter({ component: Profile }, + { + path: '/profiles', + name: 'profiles', + component: Profiles + }, + { path: "/register", name: "register", diff --git a/src/views/LandingPages/Profile/AllProfiles.vue b/src/views/LandingPages/Profile/AllProfiles.vue new file mode 100644 index 0000000..453b7b0 --- /dev/null +++ b/src/views/LandingPages/Profile/AllProfiles.vue @@ -0,0 +1,124 @@ + + + + + + \ No newline at end of file diff --git a/src/views/LandingPages/Project/AllProjects.vue b/src/views/LandingPages/Project/AllProjects.vue new file mode 100644 index 0000000..a6c6dc5 --- /dev/null +++ b/src/views/LandingPages/Project/AllProjects.vue @@ -0,0 +1,124 @@ + + + + + + \ No newline at end of file From e02d118b77f9cf5afb364928849ee7a671c5776e Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Sat, 20 May 2023 17:58:28 +0100 Subject: [PATCH 08/17] Navbar fixed --- src/examples/navbars/NavbarDefault.vue | 743 ++----------------------- 1 file changed, 38 insertions(+), 705 deletions(-) diff --git a/src/examples/navbars/NavbarDefault.vue b/src/examples/navbars/NavbarDefault.vue index c8ec9cd..ae68e95 100644 --- a/src/examples/navbars/NavbarDefault.vue +++ b/src/examples/navbars/NavbarDefault.vue @@ -17,7 +17,7 @@ const props = defineProps({ default: () => ({ route: "/pages/landing-pages/basic", color: "bg-gradient-success", - label: "Вход/Регистрация" + label: "Вход / Регистрация" }) }, transparent: { @@ -117,7 +117,7 @@ watch( ]" :to="{ name: 'presentation' }" rel="tooltip" - title="Цифровое портфолио и деловые контакты" + title="Designed and Coded by Creative Tim" data-placement="bottom" > LinkedMin @@ -131,15 +131,15 @@ watch( " to="/" rel="tooltip" - title="Цифровое портфолио и деловые контакты" + title="Designed and Coded by Creative Tim" data-placement="bottom" > - Material Design + LinkedMin Buy NowВход/Регистрация
- About Us - - - Contact Us - - - Author - - - - Sign In + Все пользователи +
@@ -237,40 +215,20 @@ watch( - About Us - - - Contact Us - - - Author - - - - Sign In + Все пользователи +
+ +
- About Us - - - Contact Us - - - Author - - - - Sign In + Все проекты +
@@ -347,523 +283,21 @@ watch( - About Us - - - Contact Us - - - Author - - - - Sign In + Все проекты + - + + + - - + + - +