diff --git a/.DS_Store b/.DS_Store index 5008ddf..3c39272 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app.py b/app.py new file mode 100644 index 0000000..3ea37d4 --- /dev/null +++ b/app.py @@ -0,0 +1,8 @@ +from ratemybronco import app + +def main(): + app.run(debug=True) + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/frontend-testing b/frontend-testing new file mode 160000 index 0000000..5fc3e77 --- /dev/null +++ b/frontend-testing @@ -0,0 +1 @@ +Subproject commit 5fc3e77c48933846c6072954b0aac070980f7e14 diff --git a/ratemybronco/.DS_Store b/ratemybronco/.DS_Store new file mode 100644 index 0000000..258bb4b Binary files /dev/null and b/ratemybronco/.DS_Store differ diff --git a/main.py b/ratemybronco/__init__.py similarity index 92% rename from main.py rename to ratemybronco/__init__.py index 356ceea..fd8e44c 100644 --- a/main.py +++ b/ratemybronco/__init__.py @@ -1,4 +1,4 @@ -from crypt import methods +# from crypt import methods from flask import Flask, redirect, render_template, request import base64 from io import BytesIO @@ -9,7 +9,7 @@ from sklearn.datasets import load_iris import pandas as pd import matplotlib as plt -import mysql.connector +# import mysql.connector from flask_debugtoolbar import DebugToolbarExtension import os @@ -19,8 +19,8 @@ ### MySQL connector and set up -ratemybroncoDB = mysql.connector.connect(host="localhost", user="root", database="ratemybronco") -mycursor = ratemybroncoDB.cursor() +# ratemybroncoDB = mysql.connector.connect(host="localhost", user="root", database="ratemybronco") +# mycursor = ratemybroncoDB.cursor() ### Landing page routing @@ -76,7 +76,7 @@ def add_rating(): mycursor.execute(sql_command) ### Thank you page or the submitted page -@app.route("/submitted", method=["GET"]) +@app.route("/submitted", methods=["GET"]) def submitted(): return "Thank You" @@ -109,4 +109,4 @@ def grades(): ### Run if main if __name__ == "__main__": - app.run(DEBUG=True) + app.run(debug=True) diff --git a/ratemybronco/__pycache__/__init__.cpython-39.pyc b/ratemybronco/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..d24c95d Binary files /dev/null and b/ratemybronco/__pycache__/__init__.cpython-39.pyc differ diff --git a/ratemybronco/static/.DS_Store b/ratemybronco/static/.DS_Store new file mode 100644 index 0000000..99ced53 Binary files /dev/null and b/ratemybronco/static/.DS_Store differ diff --git a/ratemybronco/static/public/.DS_Store b/ratemybronco/static/public/.DS_Store new file mode 100644 index 0000000..c42cb63 Binary files /dev/null and b/ratemybronco/static/public/.DS_Store differ diff --git a/ratemybronco/static/public/css/addRatingStyle.css b/ratemybronco/static/public/css/addRatingStyle.css new file mode 100644 index 0000000..9d8570e --- /dev/null +++ b/ratemybronco/static/public/css/addRatingStyle.css @@ -0,0 +1,122 @@ +body { + background-color: white; + font-family: "Roboto", sans-serif; + /* font-size: 14px; */ +} + +h1 { + font-weight: 20; + font-size: 4em; + line-height: 1.3em; +} + +.navbar-nav { + margin-left: auto; +} +/* .right-title { + color: #70ba8f; + position: absolute; + top: 15%; + left: 5%; + text-align: center; +} */ + +/* ul.nav-bar { + background-color: #2c583e41; + position: fixed; + z-index: 3; + right: 0; + margin-top: -8px; + height: 3vh; + overflow: hidden; + display: inline-block; + width: 100%; + vertical-align: middle; + } */ + +/* .link { + padding-left: 2vh; + color: white; + font-size: 2vh; + text-decoration: none; + vertical-align: middle; +} + +.secondary-link { + padding-left: 5%; +} + +.pad { + padding-left: 60%; +} */ + +.legend { + font-size: 3rem; +} + +.form-content { + padding: 25px 50px 75px; +} + +.form-label { + font-size: 1.5rem; +} + +.fieldset { + box-shadow: 0 0 10px grey; + background-color: #70ba8f; + margin-top: 10%; + margin-bottom: 10%; + margin-left: 10%; + margin-right: 10%; + border-radius: 30px; +} + +.form-control { + border-radius: 20px !important; +} + +/* rating */ + +.control-label { + padding-bottom: 30px; +} +.field-label-header { + font-size: 1.5rem; +} + +#rating-ability-wrapper { + margin-top: 50px; + margin-bottom: 50px; +} + +#comment { + margin-top: 0.5em; +} + +.submitRating-button { + margin-top: 20px; + height: 4rem; + box-shadow: 0 0 10px grey; +} + +.footer-copyright { + font-size: 1vh; + font-weight: bold; + /* margin-bottom: 20px; */ + color: grey; +} + +.about-us { + font-size: 2vh; + font-weight: 600; + font-family: "Roboto", sans-serif; + color:grey; +} + +.footer-green { + padding-top: 10px; + height: 130px; + background-color: #70ba8f; + /* border-top: 10px solid white; */ +} diff --git a/ratemybronco/static/public/css/contactUsStyle.css b/ratemybronco/static/public/css/contactUsStyle.css new file mode 100644 index 0000000..f907888 --- /dev/null +++ b/ratemybronco/static/public/css/contactUsStyle.css @@ -0,0 +1,101 @@ +body { + background-color: #70ba8f !important; + font-family: "Roboto", sans-serif !important; + font-weight: 700 !important; + /* font-size: 14px; */ + } + +h1 { + font-weight: 20; + font-size: 4em !important; + line-height: 1.3em; + color: white; +} + +p { + color: white; +} + +/* navigation bar */ +.navbar { + position: fixed; +} +.navbar-nav { + margin-left: auto; +} + +/* content */ +.col { + padding-top: 8vh; + margin: 10%; +} + +/* footer */ +.footer-white { + padding: 1vh; + height: 7vh; + background-color: white; +} + +.footer-copyright { + font-size: 1vh; + font-weight: bold; + /* margin-bottom: 20px; */ + color: grey; +} + +.about-us { + font-size: 2vh; + font-weight: 600; + font-family: "Roboto", sans-serif; + color:grey; +} + +/* buttons */ + +.button{ + display: inline-block; + text-decoration: none !important; + color: white; + position: relative; + padding-left: 20px; + padding-right: 20px; + font-size: 18px; +} + +a.button:before, +a.button:after { + content: ""; + position: absolute; + width: 10px; + height: 10px; + transition: all 0.3s ease; +} +a.button:before { + top: -2.5%; + left: -1%; + border-top: 2px solid white; + border-left: 2px solid white; +} +a.button:after { + bottom: -2.5%; + right: -1%; + border-bottom: 2px solid white; + border-right: 2px solid white; +} +a.button:hover:before, +a.button:hover:after { + width: 102%; + height: 100%; + transition: all 0.3s ease; + text-decoration: none !important; +} + +a:link, +a:visited, +a:hover, +a:active { + text-decoration: none !important; + color: #fff; +} + \ No newline at end of file diff --git a/ratemybronco/static/public/css/search.css b/ratemybronco/static/public/css/search.css new file mode 100644 index 0000000..5e54e20 --- /dev/null +++ b/ratemybronco/static/public/css/search.css @@ -0,0 +1,69 @@ +body { + background-color: white; + font-family: "Roboto", sans-serif !important; + font-weight: 700 !important; + /* font-size: 14px; */ +} + +h1 { + font-weight: 20; + font-size: 4em !important; + line-height: 1.3em; +} + +a { + text-decoration: none !important; +} + +.row { + min-height: 100vh; +} + +.col-12 { + background-color: #70ba8f; +} + +.left-title { + display: inline-block; + color: white; + margin-top: 8%; + margin-left: 3%; + text-align: center; +} + +.navbar-nav { + margin-left: auto; +} + +.title { + display: inline-block; +} + +.container { + margin: 2em; + padding: 1em; + height: 20vh; + background-color: white; + border-radius: 2em; + color: gray; +} + +.footer-white { + padding: 1vh; + height: 7vh; + background-color: white; +} + +.footer-copyright { + font-size: 1vh; + font-weight: bold; + /* margin-bottom: 20px; */ + color: grey; +} + +.about-us { + font-size: 2vh; + font-weight: 600; + font-family: "Roboto", sans-serif; + color:grey; +} \ No newline at end of file diff --git a/ratemybronco/static/public/css/style.css b/ratemybronco/static/public/css/style.css new file mode 100644 index 0000000..065e1d8 --- /dev/null +++ b/ratemybronco/static/public/css/style.css @@ -0,0 +1,87 @@ +body { + background-color: white; + font-family: "Roboto", sans-serif !important; + font-weight: 700 !important; + /* font-size: 14px; */ +} + +h1 { + font-weight: 20; + font-size: 4em !important; + line-height: 1.3em; +} + +a { + text-decoration: none !important; +} + +.row { + min-height: 100vh; +} + +.col-12 { + background-color: #70ba8f; +} + +.left-title { + display: inline-block; + color: white; + margin-top: 20%; + margin-left: 5%; + text-align: center; +} + +.navbar-nav { + margin-left: auto; +} + +.title { + display: inline-block; +} + +.right-title { + color: #70ba8f; + margin-top: 20%; + margin-left: 5%; +} + +@media (min-width: 576px) { + .grow { + -webkit-transition: width 500ms; + -moz-transition: width 500ms; + transition: width 500ms; + } + #row:hover .grow { + width: 40%; + } + #row:hover .grow:hover { + width: 60%; + } +} + +.footer-white { + padding: 1vh; + height: 7vh; + background-color: white; +} + +.footer-copyright { + font-size: 1vh; + font-weight: bold; + /* margin-bottom: 20px; */ + color: grey; +} + +.about-us { + font-size: 2vh; + font-weight: 600; + font-family: "Roboto", sans-serif; + color:grey; +} + +/* .footer-green { + padding-top: 10px; + height: 130px; + background-color: #70ba8f; + border-top: 10px solid white; +} */ diff --git a/ratemybronco/templates/.DS_Store b/ratemybronco/templates/.DS_Store new file mode 100644 index 0000000..ca26479 Binary files /dev/null and b/ratemybronco/templates/.DS_Store differ diff --git a/ratemybronco/templates/addRating.html b/ratemybronco/templates/addRating.html new file mode 100644 index 0000000..321f145 --- /dev/null +++ b/ratemybronco/templates/addRating.html @@ -0,0 +1,142 @@ + + + + + + + Rate My Bronco + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Add Rating +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +

0 / 5

+ + + + + +
+ +
+ + +
+
+ +
+
+
+ + + + + + + diff --git a/ratemybronco/templates/contactUs.html b/ratemybronco/templates/contactUs.html new file mode 100644 index 0000000..9d9de36 --- /dev/null +++ b/ratemybronco/templates/contactUs.html @@ -0,0 +1,148 @@ + + + + + + + Rate My Bronco + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

Jessica Margala

+

Front End Developer

+ +
+ GitHub +
+ +
+ LinkedIn +
+
+
+
+
+

Arsham Mehrani

+

Full Stack Developer

+ +
+ GitHub +
+ +
+ LinkedIn +
+
+
+
+
+
+

Sara Nersisian

+

Front End Developer

+ +
+ GitHub +
+ +
+ LinkedIn +
+
+
+
+
+

Darrell Villasenor

+

Back End Developer

+ +
+ GitHub +
+ +
+ LinkedIn +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/ratemybronco/templates/index.html b/ratemybronco/templates/index.html new file mode 100644 index 0000000..c3a686f --- /dev/null +++ b/ratemybronco/templates/index.html @@ -0,0 +1,108 @@ + + + + + + + Rate My Bronco + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+

Search Ratings

+
+
+ +
+
+
+ +
+

Add Rating

+
+
+
+ + + + + + + + + + + diff --git a/templates/layout.html b/ratemybronco/templates/layout.html similarity index 100% rename from templates/layout.html rename to ratemybronco/templates/layout.html diff --git a/templates/result.html b/ratemybronco/templates/result.html similarity index 100% rename from templates/result.html rename to ratemybronco/templates/result.html diff --git a/ratemybronco/templates/search.html b/ratemybronco/templates/search.html new file mode 100644 index 0000000..fe9ece6 --- /dev/null +++ b/ratemybronco/templates/search.html @@ -0,0 +1,117 @@ + + + + + + + Rate My Bronco + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+

Search Ratings

+
+
+ +
+
+
+

[Professor Name]

+

[Course Name]

+

[Rating]

+
+
+

[Professor Name]

+

[Course Name]

+

[Rating]

+
+
+

[Professor Name]

+

[Course Name]

+

[Rating]

+
+
+

[Professor Name]

+

[Course Name]

+

[Rating]

+
+
+
+ + + + + + + + diff --git a/ratemybronco/templates/src/.DS_Store b/ratemybronco/templates/src/.DS_Store new file mode 100644 index 0000000..773e445 Binary files /dev/null and b/ratemybronco/templates/src/.DS_Store differ diff --git a/ratemybronco/templates/src/components/App.jsx b/ratemybronco/templates/src/components/App.jsx new file mode 100644 index 0000000..2066ea6 --- /dev/null +++ b/ratemybronco/templates/src/components/App.jsx @@ -0,0 +1,12 @@ +import React from "react"; +import Footer from "./Footer"; + +function App() { + return ( +
+
+ ); +} + +export default App; \ No newline at end of file diff --git a/ratemybronco/templates/src/components/Footer.jsx b/ratemybronco/templates/src/components/Footer.jsx new file mode 100644 index 0000000..c44d3c0 --- /dev/null +++ b/ratemybronco/templates/src/components/Footer.jsx @@ -0,0 +1,12 @@ +import React from "react"; + + + +function Footer () { + const currentYear = new Date().getFullYear(); + return ( +

Copyright © {currentYear}

+ ); +} + +export default Footer; \ No newline at end of file diff --git a/ratemybronco/templates/src/components/rating.js b/ratemybronco/templates/src/components/rating.js new file mode 100644 index 0000000..3b1b013 --- /dev/null +++ b/ratemybronco/templates/src/components/rating.js @@ -0,0 +1,26 @@ +jQuery(document).ready(function($){ + + $(".btnrating").on('click',(function(e) { + + var previous_value = $("#selected_rating").val(); + + var selected_value = $(this).attr("data-attr"); + $("#selected_rating").val(selected_value); + + $(".selected-rating").empty(); + $(".selected-rating").html(selected_value); + + for (i = 1; i <= selected_value; ++i) { + $("#rating-star-"+i).toggleClass('btn-warning'); + $("#rating-star-"+i).toggleClass('btn-default'); + } + + for (ix = 1; ix <= previous_value; ++ix) { + $("#rating-star-"+ix).toggleClass('btn-warning'); + $("#rating-star-"+ix).toggleClass('btn-default'); + } + + })); + + +}); diff --git a/ratemybronco/templates/src/index.js b/ratemybronco/templates/src/index.js new file mode 100644 index 0000000..2d3619d --- /dev/null +++ b/ratemybronco/templates/src/index.js @@ -0,0 +1,9 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./components/App"; + +ReactDOM.render ( + , + document.getElementById("root") + +); \ No newline at end of file diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 47f5a0a..0000000 --- a/templates/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - Document - - -

YO!!!

-
- -
- - - diff --git a/templates/search.html b/templates/search.html deleted file mode 100644 index 188571d..0000000 --- a/templates/search.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "layout.html" %} - -{% block title %} - Search -{% endblock %} - -{% block body %} -

Search Professors

-
- - -
- - -{% endblock %} \ No newline at end of file diff --git a/test_app.py b/test_app.py new file mode 100644 index 0000000..5a91ed1 --- /dev/null +++ b/test_app.py @@ -0,0 +1,14 @@ +import pytest +from ratemybronco import app + + +@pytest.fixture +def client(): + return app.test_client() + + +def test_landing(client): + assert client.get("/").status_code == 200 + +def test_landing_post(client): + assert client.post('/').status_code == 405 \ No newline at end of file