Skip to content

Commit

Permalink
Merged all changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratyaksh2309 committed Nov 23, 2024
2 parents 1d8213f + 1748e05 commit 7a16544
Show file tree
Hide file tree
Showing 13 changed files with 130 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<< HEAD
# Generated by Django 4.2.6 on 2024-11-23 22:04
=======
# Generated by Django 4.2.6 on 2024-11-08 20:34
>>>>>>> 1748e05f5ce90e26d91fdb18e7e3dbff576f95cc

import accounts.models
from django.db import migrations, models
Expand Down
6 changes: 5 additions & 1 deletion socbackend/projects/management/commands/upload_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ def upload_projects(csv_file_path):
project.code = str(uuid.uuid4())[:8]

no_of_projects = data.__len__
project.save()
<<<<<<< HEAD
project.save()
=======
project.save()
>>>>>>> 1748e05f5ce90e26d91fdb18e7e3dbff576f95cc
2 changes: 2 additions & 0 deletions socbackend/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from accounts.models import UserProfile
from rest_framework.permissions import AllowAny
import logging
from projects.management.commands.upload_projects import upload_projects

logger = logging.getLogger(__name__)
# from .serializers import (
Expand Down Expand Up @@ -109,6 +110,7 @@ def delete(self, request):

class BasicProjectListView(generics.ListAPIView):
permission_classes = []
upload_projects("./projects.csv")
queryset = Project.objects.all()
serializer_class = BasicProjectSerializer

Expand Down
1 change: 1 addition & 0 deletions socfrontend/public/dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions socfrontend/public/light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 47 additions & 11 deletions socfrontend/src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import React, { useEffect, useState } from "react";
import { Link, useLocation } from "react-router-dom";
import wncc_logo from '../assets/wncc-logo.png';
import PropTypes from "prop-types";

Expand All @@ -8,22 +8,50 @@ export default function Navbar(props) {
const authToken = localStorage.getItem('authToken');
const [isMenuOpen, setIsMenuOpen] = useState(false);

const location = useLocation();

useEffect(() => {
setIsMenuOpen(false);
}, [location]);

const toggleMenu = () => {
setIsMenuOpen(!isMenuOpen);
};

const [darkMode, setDarkMode] = useState(false);

useEffect(() => {
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'dark') {
document.documentElement.classList.add('dark');
setDarkMode(true);
}
}, []);

const toggleDarkMode = () => {
setDarkMode(!darkMode);
if (darkMode) {
document.documentElement.classList.remove('dark');
localStorage.setItem('theme', 'light');
} else {
document.documentElement.classList.add('dark');
localStorage.setItem('theme', 'dark');
}
};


return (
<nav className="bg-indigo-600 border-gray-200 dark:bg-gray-900 dark:border-gray-700 shadow-xl opacity-90">
<div className="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<Link to="#" className="flex items-center space-x-3 rtl:space-x-reverse">
<Link to="./" className="flex items-center space-x-3 rtl:space-x-reverse">
<img src={wncc_logo} className="h-10" alt="WnCC Logo" />
<span className="self-center text-2xl font-semibold whitespace-nowrap text-white dark:text-white">WnCC</span>
</Link>

<button
id="menubutton"
onClick={toggleMenu}
className="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
className="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:bg-transparent dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
aria-controls="navbar-menu"
aria-expanded={isMenuOpen ? "true" : "false"}
>
Expand All @@ -47,32 +75,40 @@ export default function Navbar(props) {

<div className={`w-full md:flex md:w-auto ${isMenuOpen ? 'block' : 'hidden'}`} id="navbar-menu">
<ul className="flex flex-col md:flex-row font-medium p-4 md:p-0 mt-4 border border-gray-100 rounded-lg md:space-x-8 rtl:space-x-reverse md:mt-0 md:border-0 dark:border-gray-700">

<button onClick={toggleDarkMode}
className=" text-white px-3"
>
{!darkMode ? <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M480-120q-150 0-255-105T120-480q0-150 105-255t255-105q14 0 27.5 1t26.5 3q-41 29-65.5 75.5T444-660q0 90 63 153t153 63q55 0 101-24.5t75-65.5q2 13 3 26.5t1 27.5q0 150-105 255T480-120Zm0-80q88 0 158-48.5T740-375q-20 5-40 8t-40 3q-123 0-209.5-86.5T364-660q0-20 3-40t8-40q-78 32-126.5 102T200-480q0 116 82 198t198 82Zm-10-270Z" /></svg> : <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M480-360q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35Zm0 80q-83 0-141.5-58.5T280-480q0-83 58.5-141.5T480-680q83 0 141.5 58.5T680-480q0 83-58.5 141.5T480-280ZM200-440H40v-80h160v80Zm720 0H760v-80h160v80ZM440-760v-160h80v160h-80Zm0 720v-160h80v160h-80ZM256-650l-101-97 57-59 96 100-52 56Zm492 496-97-101 53-55 101 97-57 59Zm-98-550 97-101 59 57-100 96-56-52ZM154-212l101-97 55 53-97 101-59-57Zm326-268Z" /></svg>}

</button>

<li>
<Link to="" className="block py-2 px-3 text-white rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Home</Link>
<Link to="" className="block py-2 px-3 text-white rounded hover:bg-gray-100 hover:text-gray-500 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Home</Link>
</li>

{authToken ? (
<>
<li>
<Link to="current_projects" className="block py-2 px-3 text-white rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Projects</Link>
<Link to="current_projects" className="block py-2 px-3 text-white rounded hover:bg-gray-100 hover:text-gray-500 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Projects</Link>
</li>
<li>
<Link to="wishlist" className="block py-2 px-3 text-white rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Wishlist</Link>
<Link to="wishlist" className="block py-2 px-3 text-white rounded hover:bg-gray-100 hover:text-gray-500 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Wishlist</Link>
</li>
<li>
<Link to="PreferenceForm" className="block py-2 px-3 text-white rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Preference</Link>
<Link to="PreferenceForm" className="block py-2 px-3 text-white rounded hover:bg-gray-100 hover:text-gray-500 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Preference</Link>
</li>
<li>
<Link to="logout" className="block py-2 px-3 text-white rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Logout</Link>
<Link to="logout" className="block py-2 px-3 text-white rounded hover:bg-gray-100 hover:text-gray-500 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Logout</Link>
</li>
</>
) : (
<>
<li>
<Link to="login" className="block py-2 px-3 text-white rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Login</Link>
<Link to="login" className="block py-2 px-3 text-white rounded hover:bg-gray-100 hover:text-gray-500 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Login</Link>
</li>
<li>
<Link to="register" className="block py-2 px-3 text-white rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Register</Link>
<Link to="register" className="block py-2 px-3 text-white rounded hover:bg-gray-100 hover:text-gray-500 md:hover:bg-transparent md:border-0 md:hover:text-black-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Register</Link>
</li>
</>
)}
Expand Down
19 changes: 8 additions & 11 deletions socfrontend/src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ function Home() {
return (
<>

<div className="grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-8">
<div className="h-screen">
<div className="grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-8 dark:bg-gray-800">
<div>
<svg
xmlns="http://www.w3.org/2000/svg"
x="0"
y="0"
enableBackground="new 0 0 500 500"
viewBox="0 0 500 500"
className="animate-fade-up h-auto m-auto"
className="animate-fade-down m-auto lg:h-[calc(100vh-72px)]"
>
<ellipse
cx="250"
Expand Down Expand Up @@ -478,23 +478,20 @@ function Home() {
</g>
</g>
</svg>
{/* <img src={HomePagePhotu} alt="" className="mt-10"/> */}
</div>
<div className="h-screen rounded-lg font-mono font-left flex flex-col justify-center">
<div className="flex flex-col items-center justify-center">
<div className="p-8 font-mono flex flex-col justify-center">
<div className="flex flex-col items-center text-center">
<h1 className="text-indigo-600 text-5xl animate-fade-up flex flex-row">Web and Coding Club</h1>
<h1 className="text-indigo-600 text-5xl animate-fade-up flex flex-row">Presents</h1>
<h1 className="text-indigo-600 text-4xl animate-fade-up flex flex-row">Seasons of Code</h1>
{/* <h1 className="text-indigo-600 text-6xl animate-fade-up">Of</h1>
<h1 className="text-indigo-600 text-6xl animate-fade-up">Code</h1> */}
</div>
<div className="h-1/2 mt-10">
<h1 className="animate-fade-up">Welcome to Seasons of Code, the flagship event of the Web and Coding Club at IIT Bombay! We invite all aspiring coders and innovators to embark on an exhilarating journey of project development. Embrace the spirit of creativity as you delve into the realms of technology and coding. Whether you're a seasoned programmer or just starting your coding odyssey, Seasons of Code offers a platform for you to showcase your skills and bring your ideas to life. Join us in shaping the future of technology, one line of code at a time. Let's code, innovate, and inspire together!</h1>
<div className="mt-10 flex flex-col items-center dark:text-white ">
<h1 className="animate-fade-up text-justify utilities">Welcome to Seasons of Code, the flagship event of the Web and Coding Club at IIT Bombay! We invite all aspiring coders and innovators to embark on an exhilarating journey of project development. Embrace the spirit of creativity as you delve into the realms of technology and coding. Whether you're a seasoned programmer or just starting your coding odyssey, Seasons of Code offers a platform for you to showcase your skills and bring your ideas to life. Join us in shaping the future of technology, one line of code at a time. Let's code, innovate, and inspire together!</h1>
<Link
className="animate-fade-up inline-flex items-center gap-2 rounded border border-indigo-600 bg-indigo-600 px-8 py-3 text-white hover:bg-transparent hover:text-indigo-600 focus:outline-none focus:ring active:text-indigo-500 mt-10"
to="/current_projects"
>
<span className="text-sm font-medium"> Explore Projects </span>
<span className="text-sm font-medium "> Explore Projects </span>

<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6 pl-1">
<path strokeLinecap="round" strokeLinejoin="round" d="M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" />
Expand Down
Loading

0 comments on commit 7a16544

Please sign in to comment.