Initial commit
This commit is contained in:
14
templates/add_item.html
Normal file
14
templates/add_item.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Add a New Item</h1>
|
||||
<form method="post">
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" id="name" name="name" required>
|
||||
<br>
|
||||
<label for="description">Description:</label>
|
||||
<textarea id="description" name="description"></textarea>
|
||||
<br>
|
||||
<button type="submit">Add Item</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
21
templates/base.html
Normal file
21
templates/base.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Flask App</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav>
|
||||
<a href="{{ url_for('home') }}">Home</a>
|
||||
<a href="{{ url_for('add_item') }}">Add Item</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
{% block content %}{% endblock %}
|
||||
{% block moreContent%}Placeholder{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
25
templates/home.html
Normal file
25
templates/home.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{# If there is username display it otherwise stay generic #}
|
||||
{% if username %}
|
||||
<h1>Item List for {{username}}</h1>
|
||||
{% else %}
|
||||
<h1>Item List</h1>
|
||||
{% endif %}
|
||||
<ul>
|
||||
{% for item in items %}
|
||||
<li><strong>{{ item.name }}</strong>: {{ item.description }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<ul>
|
||||
{% for thing in testList %}
|
||||
<li>{{ thing }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block moreContent%}
|
||||
<h2>This is a test for more content</h2>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user