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

Hanisah musrin patch 1 #33

Merged
merged 2 commits into from
Jan 14, 2024
Merged
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
11 changes: 0 additions & 11 deletions app/app.py

This file was deleted.

24 changes: 2 additions & 22 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
from flask import Flask, render_template, request

app = Flask(__name__)


# Route for the form page
@app.route('/form', methods=['GET', 'POST'])
def form():
if request.method == 'POST':
# Access form data
name = request.form['name']
email = request.form['email']
message = request.form['message']

# Do something with the form data (you can process or store it)
# For example, print the data to the console
print(f"Name: {name}, Email: {email}, Message: {message}")

# Return a response (you can redirect or render a template)
return render_template('success.html', name=name) # Render a success page with the submitted name

return render_template('CreateEntry.html')
from website import create_app

app = create_app()

if __name__ == '__main__':
app.run(debug=True)
20 changes: 19 additions & 1 deletion website/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,22 @@ def createAccount():
@auth.route('/welcome')
@login_required
def welcome():
return render_template("welcome.html",user=current_user)
return render_template("welcome.html",user=current_user)

# Route for the form page
@auth.route('/form', methods=['GET', 'POST'])
def form():
if request.method == 'POST':
# Access form data
name = request.form['name']
email = request.form['email']
message = request.form['message']

# Do something with the form data (you can process or store it)
# For example, print the data to the console
print(f"Name: {name}, Email: {email}, Message: {message}")

# Return a response (you can redirect or render a template)
return render_template('success.html', name=name) # Render a success page with the submitted name

return render_template('CreateEntry.html')
246 changes: 117 additions & 129 deletions HTML_Folders/CreateEntry.html → website/templates/CreateEntry.html
Original file line number Diff line number Diff line change
@@ -1,128 +1,117 @@
<!DOCTYPE html>
<html>
<head>
<title>TSAO Capstone Records System</title>

<style>

.WebName {
color: green;
position: absolute;
left: 200px;
top: 0px;
font-size: 40px;
}


.FormHeader {
position: relative;
text-align: center;
top: 50px;
font-size: 50px;
}


.form {
display: flex;
position: relative;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
top: 50px;
}


.form input {
width: 400px;
border: 1px solid #000000;
border-radius: 4px;
font-size: 16px;
padding: 8px;
}

.form input[type='radio'] {
width: 20px;
border: 1px solid #000000;
border-radius: 4px;
font-size: 16px;
padding: 8px;
}

.FormGroup1 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
}

.FormGroup2 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
}

.FormGroup3 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
}


.FormGroup4 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
margin-left: -250px;

}

.FormGroup5 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
margin-left: -250px;
}

.floating-input {
float: left;
margin-right: 100px;
}

.green-button {
background-color: green;
color: white;
padding: 20px 40px;
border: none;
border-radius: 10px;
cursor: pointer;
margin-right: 400px
}
.red-button {
background-color: red;
color: white;
padding: 20px 40px;
border: none;
border-radius: 10px;
cursor: pointer;
}



</style>
</head>


<body>

<p class="WebName">
TSAO Capstone Records System
</p>

{% extends "base.html" %}
{% block stylesheet %}
<style>
.WebName {
color: green;
position: absolute;
left: 200px;
top: 0px;
font-size: 40px;
}


.FormHeader {
position: relative;
text-align: center;
top: 50px;
font-size: 50px;
}


.form {
display: flex;
position: relative;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
top: 50px;
}


.form input {
width: 400px;
border: 1px solid #000000;
border-radius: 4px;
font-size: 16px;
padding: 8px;
}

.form input[type='radio'] {
width: 20px;
border: 1px solid #000000;
border-radius: 4px;
font-size: 16px;
padding: 8px;
}

.FormGroup1 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
}

.FormGroup2 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
}

.FormGroup3 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
}


.FormGroup4 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
margin-left: -250px;

}

.FormGroup5 {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
margin-left: -250px;
}

.floating-input {
float: left;
margin-right: 100px;
}

.green-button {
background-color: green;
color: white;
padding: 20px 40px;
border: none;
border-radius: 10px;
cursor: pointer;
margin-right: 400px
}
.red-button {
background-color: red;
color: white;
padding: 20px 40px;
border: none;
border-radius: 10px;
cursor: pointer;
}
</style>
{% endblock %}
{% block title %}Query{% endblock %}


{% block content %}
<p class="FormHeader">
<u> Create New Capstone Entry</u>

Expand Down Expand Up @@ -180,11 +169,10 @@
</div>

<div class="FormGroup5">
<button class="green-button">Save</button>
<button class="red-button">Cancel</button>
<a class="green-button btn btn-primary btn-danger btn-lg ml-5" href="/welcome">Save</a>
<a class="red-button btn btn-primary btn-danger btn-lg ml-5" href="/welcome">Cancel</a>
</div>
</div>
</form>
</body>
</html>
{% endblock %}

File renamed without changes.
16 changes: 6 additions & 10 deletions website/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
crossorigin="anonymous"
/>
{% block stylesheet %}{% endblock %}

<title>{% block title %}Template{% endblock %}</title>

</head>
<body>

<body>
<nav class="navbar navbar-expand-lg navbar-light bg-white">
<h3 style="color: #4CAF50;"class="p-3 mr-auto">TSAO Capstone Records System</h3>

{% block nav %}
{% endblock %}
{% block nav %}{% endblock %}
</nav>



{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
Expand All @@ -57,13 +56,10 @@ <h3 style="color: #4CAF50;"class="p-3 mr-auto">TSAO Capstone Records System</h3>
{% block forms %}
{% endblock %}
</div>

{% block content %}
{% endblock %}
<script
src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"
></script>

<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
Expand Down
2 changes: 1 addition & 1 deletion website/templates/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 class="text-center fw-bold" style="font-size: 60px;">Welcome to the TSAO Cap
<br/><br/><br/>

<div class="d-flex justify-content-center">
<a type="submit" class="btn btn-primary btn-success btn-lg mr-5" style="width:200px" href=""> Create </a>
<a type="submit" class="btn btn-primary btn-success btn-lg mr-5" style="width:200px" href="/form"> Create </a>
<a type="submit" class="btn btn-primary btn-success btn-lg" style="width:200px" href=""> Modify Accounts </a>
<a type="submit" class="btn btn-primary btn-success btn-lg ml-5" style="width:200px" href=""> Query </a>
</div>
Expand Down
Loading