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

Shaina's Labs #175

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
109 changes: 109 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Burrito_Form/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Burrito Order Form</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<div class="bg-success p-2 text-white bg-opacity-75 text-center">
<h1>BURRITO ORDER FORM</h1>
</div>
<img src="https://res.cloudinary.com/unclejulios/image/upload/f_auto,q_90,w_1600/savage-burrito/Hero-1.jpg" class="img-fluid" alt="...">
<form action="https://webhook.site/c1e4a491-95f4-41a9-b1d3-f25954115675" method="POST">
<div class="p-3 mb-2 bg-danger text-warning text-center"><h3>Customer Information</h3></div>
<div class="mb-3">
<label for="name" class="form-label">Customer Name</label>
<input
placeholder="Enter Name"
name="name"
type="text"
class="form-control"
required
/>
</div>
<div class="mb-3">
<label for="name" class="form-label">Password</label>
<input
name="password"
placeholder="Enter password"
type="password"
class="form-control"
required
/>
<br />
<hr>

<h3>Tortilla Selection:</h3>
<label for="White">White Flour</label>
<input id="white" name="Totilla" type="radio" value="white" />
<br />

<label for="wheat">Wheat Flour</label>
<input id="wheat" name="Totilla" type="radio" value="wheat" />
<br>

<label for="spinach">Spinach</label>
<input id="spinach" name="Totilla" type="radio" value="spinach" />
<br />
<label for="corn">Corn</label>
<input id="corn" name="Totilla" type="radio" value="corn" />
<br />

<h3>Rice Selection:</h3>
<label for="white">White</label>
<input id="white" name="Rice" type="radio" value="white" />
<br>

<label for="brown">Brown</label>
<input id="brown" name="Rice" type="radio" value="brown" />
<br>

<h3>Bean Selection:</h3>
<label for="black">Black Beans</label>
<input id="black" name="Beans" type="radio" value="black" />
<br />
<label for="pinto">Pinto Beans</label>
<input id="pinto" name="Beans" type="radio" value="pinto" />
<br />

<h3>Protein Selection:</h3>
<label for="carnitas">Carnitas</label>
<input id="carnitas" name="Protein" type="radio" value="carnitas" />
<br />
<label for="chicken">Chicken</label>
<input id="chicken" name="Protein" type="radio" value="chicken" />
<br />
<label for="sofritas">Sofritas</label>
<input id="sofritas" name="Protein" type="radio" value="sofritas" />
<br />
<label for="none">None</label>
<input id="none" name="Protein" type="radio" value="none" />
<br />

<h4>Additional Ingredients:</h4>
<label for="cheese">Cheese</label>
<input id="cheese" name="cheese" type="checkbox" value="cheese" />

<label for="sour cream">Sour Cream</label>
<input id="sour cream" name="sour cream" value="sour cream" type="checkbox" />

<br />
<hr>
<h4>Delivery Instructions:</h4>
<textarea
name="Delivery Instructions"
cols="30"
rows="10"
placeholder="Please enter delivery instructions here ..."
></textarea>

<br />

<button type="submit">Submit Order</button>
</form>

</body>
</html>
53 changes: 53 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Company_Page/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nintendo Page</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<nav class="navbar sticky-top navbar-light bg-light">
<div class="container-fluid">
<div class="row justify-content-start">
<a class="navbar-brand" href="#">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/Nintendo.svg/600px-Nintendo.svg.png?20170720163516" alt="" width="105px" height="52px">

<form class="d-inline-flex" >
<input class="form-control me-2" type="search" placeholder="Search games, hardware, news, etc" aria-label="Search"/>
<select name="dropdown" id="dropdown">
<option value="All categories">All categories</option>
<option value="Games">Games</option>
<option value="Hardware">Hardware</option>
<option value="Mercahndise">Mercahndise</option>
<option value="News & Events"> </option>
<option value="Support">Support</option>
</select>
<div class="col-md-4 offset-md-4">
<button class="btn btn-sm btn-outline-secondary" type="button">Support</button>
<button class="btn btn-sm btn-outline-secondary" type="button">Wish List</button>
<button class="btn btn-sm btn-outline-secondary" type="button">Cart</button>
<button class="btn btn-sm btn-outline-secondary" type="button">Log in/Sign up>
</div>
</form>
</a>
</div>
</div>
</nav>
<promo>
<div class="bg-danger p-2 bg-opacity-25"></div>
<div class="bg-danger p-2 bg-opacity-10"></div>
<img src="https://assets.nintendo.com/image/upload/c_fill,dpr_1.0,f_auto,q_auto,w_1500/b_transparent/v1/ncom/en_US/merchandising/center-stage-banner/kirby-and-the-forgotten-land/3600x1300_Ncom_KirbyandtheForgottenLand_v01" class="img-fluid" alt="...">
<div class="bg-danger p-2 bg-opacity-10"></div>
<div class="bg-danger p-2 bg-opacity-25"> </div>
<p class="fs-1 rounded float-start">Try the demo - bon appetit!<button type="button" class="btn btn-danger" href="https://www.nintendo.com/store/products/kirby-and-the-forgotten-land-switch/">Pre-order now</button></p>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/ESRB_2013_Everyone_10%2B.svg/220px-ESRB_2013_Everyone_10%2B.svg.png" class="rounded float-end" class="img-fluid img-thumbnail" alt="..."width="50px" height="50px">
<br>
</promo>



</body>
</html>
15 changes: 15 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Flask_Lecture/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from flask import Flask, render_template
app = Flask(__name__)

# localhost:5000
@app.route('/')
def index():
return render_template('index.html')

@app.route('/about')
def about():
return render_template('about.html')

@app.route('/contact')
def contact():
return render_template('contact.html')
13 changes: 13 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Flask_Lecture/templates/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>About Page</h1>

</body>
</html>
13 changes: 13 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Flask_Lecture/templates/contact.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Contact Us!</h1>

</body>
</html>
12 changes: 12 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Flask_Lecture/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Welcome to my flask app</h1>
</body>
</html>
74 changes: 74 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Unit_Converter/Templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unit Converter</title>
</head>
<body>
<form action="/converter" method="POST">
<h1>UNIT CONVERTER</h1>

<input
placeholder="Enter starting measurement"
name="distance"
type="integer"
required
/>

<h3>Select Starting Unit</h3>
<label for="ft">Feet</label>
<input id="ft" name="s_unit" type="radio" value="ft" />
<br />

<label for="mi">Miles</label>
<input type="radio" name="s_unit" id="mi" value="mi" />
<br />

<label for="m">Meters</label>
<input id="m" name="s_unit" type="radio" value="m" />
<br />

<label for="km">Kilometers</label>
<input type="radio" name="s_unit" id="km" value="km" />
<br />

<label for="yd">Yards</label>
<input type="radio" name="s_unit" id="yd" value="yd" />
<br />

<label for="in">Inches</label>
<input type="radio" name="s_unit" id="in" value="in" />
<br />
<hr>

<h3>Select Ending Unit</h3>
<label for="ft">Feet</label>
<input id="ft" name="e_unit" type="radio" value="ft" />
<br />

<label for="mi">Miles</label>
<input type="radio" name="e_unit" id="mi" value="mi" />
<br />

<label for="m">Meters</label>
<input id="m" name="e_unit" type="radio" value="m" />
<br />

<label for="km">Kilometers</label>
<input type="radio" name="e_unit" id="km" value="km" />
<br />

<label for="yd">Yards</label>
<input type="radio" name="e_unit" id="yd" value="yd" />
<br />

<label for="in">Inches</label>
<input type="radio" name="e_unit" id="in" value="in" />
<br />

<button type="submit">Conversion</button>
</form>
</body>
</html>
14 changes: 14 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Unit_Converter/Templates/results.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Results</title>
</head>
<body>
<h1>RESULTS:</h1>
<h3>{{ dist }} {{ unit1 }} converts to {{ conversion }} {{ unit2 }}</h3>
<a href="/">Need to convert more units?</a>
</body>
</html>
25 changes: 25 additions & 0 deletions Code/shaina/2Flask_HTML_CSS/Unit_Converter/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from flask import Flask, render_template, request
app = Flask(__name__)

@app.route('/')
def index():
return render_template('index.html')

@app.route('/converter', methods=['POST'])
def converter():
result = request.form

unit1= result['s_unit']
unit2= result['e_unit']
dist = float(result['distance'])
units_to_m = {
'ft': 0.3048,
'mi': 1609.34,
'm': 1,
'km': 1000,
'yd': 0.9144,
'in': 0.0254
}
conversion = round((dist * units_to_m[unit1]) * (1/units_to_m[unit2]), 4)

return render_template('results.html',unit1=unit1, unit2=unit2, dist=dist, conversion=conversion)
Empty file.
6 changes: 6 additions & 0 deletions Code/shaina/Django/Grocery/grocery_app/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.contrib import admin
from .models import *

# Register your models here.
admin.site.register(Department)
admin.site.register(GroceryItem)
6 changes: 6 additions & 0 deletions Code/shaina/Django/Grocery/grocery_app/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class GroceryAppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'grocery_app'
31 changes: 31 additions & 0 deletions Code/shaina/Django/Grocery/grocery_app/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 4.0.3 on 2022-05-19 23:38

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Department',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=20)),
],
),
migrations.CreateModel(
name='GroceryItem',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('item', models.CharField(max_length=40)),
('completed', models.BooleanField(default=False)),
('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='items', to='grocery_app.department')),
],
),
]
Empty file.
Loading