Skip to content

Commit

Permalink
templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtenberger committed Jun 2, 2024
1 parent c757daa commit 5bbb5a1
Show file tree
Hide file tree
Showing 9 changed files with 1,636 additions and 106 deletions.
1,445 changes: 1,444 additions & 1 deletion generator/cocktail.csv

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
blinker==1.8.1
click==8.1.7
click==7.1.2
Flask==3.0.3
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.1
greenlet==3.0.3
gunicorn==20.0.4
importlib_metadata==7.1.0
itsdangerous==2.2.0
Jinja2==3.1.3
MarkupSafe==2.1.5
numpy==1.19.5
pandas==1.1.5
psycopg2==2.8.6
psycopg2-binary==2.9.9
python-dateutil==2.8.1
pytz==2020.5
six==1.15.0
SQLAlchemy==2.0.29
typing_extensions==4.11.0
Werkzeug==3.0.2
Expand Down
89 changes: 36 additions & 53 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,62 +1,45 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Cocktail Club App</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cocktail Club App</title>

<link rel="stylesheet"
<link rel="stylesheet"
href="https://unpkg.com/bootstrap/dist/css/bootstrap.css">
<script src="https://unpkg.com/jquery"></script>
<script src="https://unpkg.com/popper"></script>
<script src="https://unpkg.com/bootstrap"></script>

<link rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.3.1/css/all.css">
<link rel="stylesheet" href="/static/stylesheets/style.css">
<link rel="shortcut icon" href="/static/favicon.ico">
<script src="https://unpkg.com/jquery"></script>
<script src="https://unpkg.com/popper"></script>
<script src="https://unpkg.com/bootstrap"></script>
</head>

<body class="{% block body_class %}{% endblock %}">
<nav class="navbar navbar-expand">
<div class="container-fluid">
<div class="navbar-header">
<a href="/" class="navbar-brand">
<span>Cocktail</span>
</a>
</div>
<ul class="nav navbar-nav navbar-right">
{% if request.endpoint != None %}
<!-- <li>
<form class="navbar-form navbar-right" action="/users">
<input name="q" class="form-control" placeholder="Search" id="search">
<button class="btn btn-default">
<span class="fa fa-search"></span>
</button>
</form>
</li> -->
{% endif %}
{% if not g.user %}
<li><a href="/signup">Sign up</a></li>
<li><a href="/login">Log in</a></li>
{% else %}
<li>
<a href="/users/{{ g.user.id }}">
</a>
</li>
<li><a href="/logout">Log out</a></li>
{% endif %}
</ul>
</div>
</nav>
<!-- <div class="container">
{% for category, message in get_flashed_messages(with_categories=True) %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% block content %}
{% endblock %}
</div> -->
<nav class="navbar navbar-expand">
<div class="container-fluid">
<ul class="nav navbar-nav navbar-right">
{% if request.endpoint != None %}
<li>
<form class="navbar-form navbar-right" action="/users">
<input name="q" class="form-control" placeholder="Search" id="search">
<button class="btn btn-default">
<span class="fa fa-search"></span>
</button>
</form>
</li>
{% endif %}
{% if not g.user %}
<li><a href="/register">Sign up</a></li>
<li><a href="/login">Log in</a></li>
{% else %}
<li>
<a href="/users/{{ g.user.id }}">
<img src="{{ g.user.image_url }}" alt="{{ g.user.username }}">
</a>
</li>
<li><a href="/logout">Log out</a></li>
{% endif %}
</ul>
</div>
</nav>
<h1>Cocktail Club App</h1>
<p>Please remember to drink responsibly, that means don't waste any alcohol.</p>
</body>
</html>
31 changes: 31 additions & 0 deletions templates/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends 'base.html' %}

{% block body_class %}onboarding{% endblock %}

{% block content %}

<div class="row justify-content-md-center">
<div class="col-md-7 col-lg-5">
<h2 class="join-message">Welcome back.</h2>

<form method="POST" id="login">
<label for="username">Username:</label><br>
<input type="text" name="username"><br><br>
<label for="password">Password:</label><br>
<input type="text" name="password"><br><br>
<input type="submit" id="login-button" value="'Login">
</form>

<form action="/register" id="register">
<label for="registration">New to the club?</label>
<input type="submit" id="reg-button" value="Sign Up Today">
</form>
</div>
{% if error: %}
<div id="error-box">
<p>{{error}}</p>
</div>
{% endif %}
</div>

{% endblock %}
71 changes: 71 additions & 0 deletions templates/profile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{% extends 'base.html' %}

<div class="wrapper">
<div id="h1-wrapper">
<h1>Hello, {{username}}</h1>
<div id="stored">
<form action="stored">
<input type="submit" value="Your saved drinks">
</form>
</div>
<div id="logout">
<form action="/profile/logout">
<input type="submit" value="logout">
</form>
</div>
</div>
<div class="content">

<div id="forms-wrapper">
<div id="search">
<form action="profile" method="post">
<input type="text" name="search" onfocus="this.value = ''" value="Select a cocktail name or ingredient of choice"><br>
<label for="">* 3 characters or more</label><br><br>
</form>
</div>

<div id="random">
<form action="profile" method="post">
<input type="submit" name="random" value="Get random drink.">
</form>
</div>
<br>
</div>

<div id="search-display">
<form action="profile" method="post">
{% for name in names: %}
<input type="submit" name="select" value="{{name}}"><br>
{% endfor %}
</form>
</div>

<div id="info-display">
{% if content %}
<div class="main-wrapper">
<h2>Drink:</h2>
{% for item in content[0]: %}
{% if item == content[0][0]: %}
<p>Name: {{item}}</p>
{% elif item == content[0][1]: %}
<p>Instructions: {{item}}</p>
{% end if %}
{% endfor %}
</div>
<div class="ingredients-wrapper">
<h3>Ingredients</h3>
{% for item in content[1]: %}
<ul>
<li>{{item}}</li>
</ul>
{% endfor %}
</div>

<form id="store" action="profile" method="post">
<input type="submit" name="store" value="Save">
</form>
{% endif %}
</div>
<p id="store-info">*go to 'your cocktails' to see what you have saved</p>
</div>
</div>
17 changes: 17 additions & 0 deletions templates/register.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends 'base.html' %}

<div id="main-box">
<form method="post">
<label for="new_username">Username:</label><br>
<input type="text" name="new_username" id="new_username"><br><br>
<label for="new_password">Password:</label><br>
<input type="password" name="new_password" id="new_password"><br><br>
<input type="submit" id="reg-button" value="Register New User">
</form>
</div>

{% if error: %}
<div id="error-box">
<p>{{error}}</p>
</div>
{% endif %}
29 changes: 29 additions & 0 deletions templates/stored.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% extends 'base.html' %}

<div class="wrapper">
<h1>Your cocktails:</h1>
{% if not delete_mode: %}
<div id="display">
{% for c in cocktails: %}
<form action="profile" id="cocktails" method="post">
<input type="submit" name="select" value="{{c.name}}">
</form><br>
{% endfor %}
</div>
<form id="delete" method="post">
<input type="submit" name="delete" value="delete cocktail">
</form>
{% endif %}

{% if delete_mode: %}
<div id="delete-display">
{% for c in cocktails: %}
<form id="cocktail" method="post">
<input type="checkbox" name="delete" value="{{c.name}}">
<label>{{c.name}}</label><br>
{% endfor %}
<input type="submit" id="submit-delete" value="Delete">
</form>
</div>
{% endif %}
</div>
26 changes: 0 additions & 26 deletions templates/user/login.html

This file was deleted.

25 changes: 0 additions & 25 deletions templates/user/signup.html

This file was deleted.

0 comments on commit 5bbb5a1

Please sign in to comment.