Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color #87

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions BackEnd/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ def get_recommendations():

return recommendations_json_string

@app.route('/totalMovies', methods=['GET'])
def get_total_movies():
total_movies = moviedetails.query.count() # Assuming 'moviedetails' is your movie table
return jsonify({'total_movies': total_movies})

# Route for seeing a data
@app.route('/data')
Expand Down
59 changes: 38 additions & 21 deletions FrontEnd/pages/MovieRating.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import Slider from "@mui/material/Slider";
import Typography from "@mui/material/Typography";
import axios from "axios";

const lightTheme = createTheme({
const darkTheme = createTheme({
palette: {
mode: "light",
mode: "dark",
},
});

Expand Down Expand Up @@ -120,51 +120,61 @@ export default function MovieRatings() {

return (
<>
<ThemeProvider theme={lightTheme}>
<ThemeProvider theme={darkTheme}>
<CssBaseline />
<h1>___________Suggestions Based on ReleaseDate</h1>
<div style={{ textAlign: "center" }}>
<h1 style={{ color: "#178582" }}>Suggestions Based on ReleaseDate</h1>
</div>
<Box
sx={{
marginTop: 8,
display: "flex",
flexDirection: "column",
backgroundColor: "white",
backgroundColor: "black",
align: "center",
width: "950px",
borderRadius: 8,
marginLeft: "auto",
marginRight: "auto",
color: "#178582"
}}
>
<TableContainer>
<Table stickyHeader>
<caption>Generated from Movie Rating</caption>
<TableHead>
<StyledTableRow>
<TableCell>Rank</TableCell>
<TableCell>Movie Title</TableCell>
<TableCell>Genres</TableCell>
<TableCell>Votes</TableCell>
<TableCell>Rating</TableCell>
<TableCell>Release Date</TableCell>
<TableCell>Watched?</TableCell>
<TableCell>Review?</TableCell>
<TableCell>Reviewed</TableCell>
<TableCell sx={{ color: '#B2B5E0'}}>RANK</TableCell>
<TableCell sx={{ color: '#B2B5E0' }}>MOVIE TITLE</TableCell>
<TableCell sx={{ color: '#B2B5E0' }}>GENRE(S)</TableCell>
<TableCell sx={{ color: '#B2B5E0' }}>VOTES</TableCell>
<TableCell sx={{ color: '#B2B5E0' }}>RATING</TableCell>
<TableCell sx={{ color: '#B2B5E0' }}>RELEASE DATE</TableCell>
<TableCell sx={{ color: '#B2B5E0' }}>WATCHED?</TableCell>
<TableCell sx={{ color: '#B2B5E0' }}>REVIEW?</TableCell>
<TableCell sx={{ color: '#B2B5E0' }}>REVIEWED</TableCell>
</StyledTableRow>
</TableHead>
<TableBody>
{jsonfile.map((movie) => {
return(
<TableRow key={movie.id}>
<TableCell>{movie.id}</TableCell>
<TableCell>{movie.title}</TableCell>
<TableCell>{movie.genres}</TableCell>
<TableCell>{movie.vote_count}</TableCell>
<TableCell>{movie.vote_average}</TableCell>
<TableCell>{movie.release_date}</TableCell>
<TableCell sx={{ color: '#178582' }}>{movie.id}</TableCell>
<TableCell sx={{ color: '#178582' }}>{movie.title}</TableCell>
<TableCell sx={{ color: '#178582' }}>{movie.genres}</TableCell>
<TableCell sx={{ color: '#178582' }}>{movie.vote_count}</TableCell>
<TableCell sx={{ color: '#178582' }}>{movie.vote_average}</TableCell>
<TableCell sx={{ color: '#178582' }}>{movie.release_date}</TableCell>
<TableCell>
<Button
variant="outlined"
sx={{
backgroundColor: "#178582",
color: "white",
"&:hover": {
backgroundColor: "#178582",
},
}}
onClick={() => handleOpenWatched(movie)}
>
Watch
Expand All @@ -173,12 +183,19 @@ export default function MovieRatings() {
<TableCell>
<Button
variant="outlined"
sx={{
backgroundColor: "#178582",
color: "white",
"&:hover": {
backgroundColor: "#178582",
},
}}
onClick={() => handleOpenReview(movie)}
>
Review
</Button>
</TableCell>
<TableCell>
<TableCell sx={{ color: "#178582" }}>
{reviewedMovies.includes(movie.id) ? "True" : "False"}
</TableCell>
</TableRow>
Expand Down
25 changes: 12 additions & 13 deletions FrontEnd/pages/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,22 @@ const PaginationApp = () => {
const totalTableHeight = 30 + data.length * 30 + 1;

return (
<div style={{ marginTop: '20px', border: '1px solid #ccc' }}>
<div style={{ marginTop: '20px', border: '1px solid #ccc', textAlign: 'center', color: '#178582' }}>
<Table
width={1200}
width={1000}
height={totalTableHeight}
headerHeight={30}
rowHeight={50}
rowCount={data.length}
rowGetter={({ index }) => data[index]}
headerClassName="table-header"
rowClassName={({ index }) => index % 2 === 0 ? 'even-row' : 'odd-row'}
rowClassName={({ index }) => (index % 2 === 0 ? 'even-row' : 'odd-row')}
>
<Column label="Rank" dataKey="rank" width={80} />
<Column label="Title" dataKey="title" width={250} />
<Column label={getColumnName()} dataKey={getColumnKey()} width={120} cellRenderer={renderRatingCell} />
<Column label="" dataKey="empty" width={30} />
<Column label="Genres" dataKey="genres" width={300} />
<Column label="Release Date" dataKey="release_date" width={120} />
<Column label="Rank" dataKey="rank" width={100} />
<Column label="Title" dataKey="title" width={300} />
<Column label={getColumnName()} dataKey={getColumnKey()} width={200} cellRenderer={renderRatingCell} />
<Column label="" dataKey="empty" width={100} />
<Column label="Release Date" dataKey="release_date" width={200} />
</Table>
</div>
);
Expand Down Expand Up @@ -80,15 +79,15 @@ const PaginationApp = () => {

return (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100vh' }}>
<div style={{ display: 'flex', justifyContent: 'center', marginTop: '20px' }}>
<div style={{ display: 'flex', justifyContent: 'center', marginTop: '40px' }}>
<Stack spacing={2} direction="row">
<Button variant="contained" color="primary" onClick={() => fetchTopMovies('profits')}>
<Button variant="contained" color="primary" style={{ fontSize: '20px', width: '150px' }} onClick={() => fetchTopMovies('profits')}>
Profits
</Button>
<Button variant="contained" color="primary" onClick={() => fetchTopMovies('rating')}>
<Button variant="contained" color="primary" style={{ fontSize: '20px', width: '150px' }} onClick={() => fetchTopMovies('rating')}>
Ratings
</Button>
<Button variant="contained" color="primary" onClick={() => fetchTopMovies('revenue')}>
<Button variant="contained" color="primary" style={{ fontSize: '20px', width: '150px' }} onClick={() => fetchTopMovies('revenue')}>
Revenue
</Button>
</Stack>
Expand Down
Loading