Skip to content

Commit

Permalink
Merge pull request #38 from warrenshiv/techWhiz
Browse files Browse the repository at this point in the history
Corrected errors in the PATCH method and created an Artist Profile page
  • Loading branch information
warrenshiv authored Nov 21, 2023
2 parents 1f4008a + d864df1 commit 60480dd
Show file tree
Hide file tree
Showing 10 changed files with 191 additions and 5 deletions.
Binary file modified backend/artistsmgmt/api/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified backend/artistsmgmt/api/__pycache__/views.cpython-310.pyc
Binary file not shown.
11 changes: 7 additions & 4 deletions backend/artistsmgmt/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ class ArtistRetrieveUpdateDestroyView(generics.RetrieveUpdateDestroyAPIView):
queryset = Artist.objects.all()
serializer_class = ArtistSerializer

class ArtistUpdateView(RetrieveUpdateAPIView):
class ArtistUpdateView(generics.UpdateAPIView):
queryset = Artist.objects.all()
serializer_class = ArtistSerializer
# permission_classes = [IsAuthenticated] # Adjust permissions as needed

def get_object(self):
user = self.request.user
return Artist.objects.get(user=user)
def patch(self, request, *args, **kwargs):
instance = self.get_object()
serializer = self.get_serializer(instance, data=request.data, partial=True)
serializer.is_valid(raise_exception=True)
self.perform_update(serializer)
return Response(serializer.data)
10 changes: 10 additions & 0 deletions frontend/src/components/profile/ArtistProfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';

const ArtistProfile = () => {
return (
<div className="mb-5">
</div>
);
};

export default ArtistProfile;
36 changes: 36 additions & 0 deletions frontend/src/components/profile/ContactForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';

const ContactForm = () => {
const handleSubmit = (e) => {
e.preventDefault();
// Handle form submission logic
};

return (
<div className="mb-5">
<h2>Contact</h2>
{/* <Form onSubmit={handleSubmit}>
<Form.Group controlId="formName">
<Form.Label>Name</Form.Label>
<Form.Control type="text" placeholder="Enter your name" />
</Form.Group>
<Form.Group controlId="formEmail">
<Form.Label>Email address</Form.Label>
<Form.Control type="email" placeholder="Enter email" />
</Form.Group>
<Form.Group controlId="formMessage">
<Form.Label>Message</Form.Label>
<Form.Control as="textarea" rows={3} placeholder="Enter your message" />
</Form.Group>
<Button variant="primary" type="submit">
Submit
</Button>
</Form> */}
</div>
);
};

export default ContactForm;
25 changes: 25 additions & 0 deletions frontend/src/components/profile/HeroSection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//Hero.js

import Link from 'next/link';

const Hero = () => {
return(
<section id='heroproj'>
<div className='heroproj-container' data-aos="fade-up" data-aos-delay="150" >
<h1>"Discover,Showcase, Connect, Thrive."
</h1>
<h2>
Join us on a journey where art knows no bounds,<br /> and limitless imagination with our artists.
</h2>
<div className='d-flex'>
<Link href='#portfolio' className='btn-get-started scrollto'>
View Artists
</Link>
</div>
</div>
</section>

);
};

export default Hero;
51 changes: 51 additions & 0 deletions frontend/src/components/profile/Navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from "react";
import Link from "next/link";

const Customnavbar = () => {
return (
<nav className="navbar navbar-expand-lg navbar-light bg-light">
<div className="container">
<a className="navbar-brand" href="#">
Artist Profile
</a>
<button
className="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span className="navbar-toggler-icon"></span>
</button>
<div className="collapse navbar-collapse" id="navbarNav">
<ul className="navbar-nav ms-auto">
<li className="nav-item">
<a className="nav-link" href="#">
Home
</a>
</li>
<li className="nav-item">
<a className="nav-link" href="#">
Artists
</a>
</li>
<li className="nav-item">
<a className="nav-link" href="#">
About
</a>
</li>
<li className="nav-item">
<a className="nav-link" href="#">
Contact
</a>
</li>
</ul>
</div>
</div>
</nav>
);
};

export default Customnavbar;
40 changes: 40 additions & 0 deletions frontend/src/components/profile/Portfolio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';

const Portfolio = () => {
// Sample data for portfolio items
const portfolioItems = [
{
title: 'Project 1',
image: 'path/to/project1-image.jpg',
description: 'Description of project 1...',
link: 'https://project1-link.com',
},
// Add more items as needed
];

return (
// <div className="mb-5">
// <h2>Portfolio</h2>
// <div className="row">
// {portfolioItems.map((item, index) => (
// <div className="col-md-4 mb-4" key={index}>
// <Card>
// <Card.Img variant="top" src={item.image} />
// <Card.Body>
// <Card.Title>{item.title}</Card.Title>
// <Card.Text>{item.description}</Card.Text>
// <Button variant="primary" href={item.link} target="_blank">
// View Project
// </Button>
// </Card.Body>
// </Card>
// </div>
// ))}
// </div>
// </div>

<h1>Portfolio</h1>
);
};

export default Portfolio;
3 changes: 2 additions & 1 deletion frontend/src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export default function App({ Component, pageProps, router }) {
const isLoginPage = router.pathname === '/login';
const isSignupPage = router.pathname === '/signup';
const isShowcasePage = router.pathname === '/showcase';
const isProfilePage = router.pathname === '/profile';

const shouldIncludeNavbarAndFooter = !(isLoginPage || isSignupPage || isShowcasePage);
const shouldIncludeNavbarAndFooter = !(isLoginPage || isSignupPage || isShowcasePage || isProfilePage);

useEffect(() => {
// Initialize Google Analytics
Expand Down
20 changes: 20 additions & 0 deletions frontend/src/pages/profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import Navbar from "../components/profile/Navbar";
import ArtistProfile from "../components/profile/ArtistProfile";
import Portfolio from "../components/profile/Portfolio";
import ContactForm from "../components/profile/ContactForm";
import Hero from "@/components/profile/HeroSection";

const Profile = () => {
return (
<div>
<Navbar />
<Hero />
<ArtistProfile />
<Portfolio />
<ContactForm />
</div>
);
};

export default Profile;

0 comments on commit 60480dd

Please sign in to comment.