-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
104 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<script src="https://unpkg.com/[email protected]" integrity="sha384-FhXw7b6AlE/jyjlZH5iHa/tTe9EpJ1Y55RjcgPbjeWMskSxZt1v9qkxLJWNJaGni" crossorigin="anonymous"></script> | ||
<link rel="stylesheet" href="/styles.css"/> | ||
<title>{% block title %}{{ title }} - My Site{% endblock %}</title> | ||
<script | ||
src="https://unpkg.com/[email protected]" | ||
integrity="sha384-FhXw7b6AlE/jyjlZH5iHa/tTe9EpJ1Y55RjcgPbjeWMskSxZt1v9qkxLJWNJaGni" | ||
crossorigin="anonymous" | ||
></script> | ||
<link rel="stylesheet" href="/styles.css" /> | ||
<title>{% block title %}{{ title }} - My Site{% endblock %}</title> | ||
{% block head %}{% endblock %} | ||
</head> | ||
<body> | ||
<div id="content"> | ||
{% block content %}<p>Placeholder content</p>{% endblock %} | ||
{% block content %} | ||
<p>Placeholder content</p> | ||
{% endblock %} | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
<tr id="shuttle-house-{{ house.id }}"> | ||
<td> {{ house.id }} </td> | ||
<td id="shuttle-house-desc-{{house.id}}"> {{ house.title }} </td> | ||
<td id="shuttel-house-body={{house.id}}"> {{ house.body }}</td> | ||
<td> | ||
<button hx-delete="/houses/{{house.id}}" hx-trigger="click" hx-target="#shuttle-todo-{{house.id}}" hx-swap="delete">Delete</button> | ||
</td> | ||
<td>{{ house.id }}</td> | ||
<td id="shuttle-house-desc-{{house.id}}">{{ house.title }}</td> | ||
<td id="shuttel-house-body={{house.id}}">{{ house.body }}</td> | ||
<td> | ||
<button | ||
hx-delete="/houses/{{house.id}}" | ||
hx-trigger="click" | ||
hx-target="#shuttle-todo-{{house.id}}" | ||
hx-swap="delete" | ||
> | ||
Delete | ||
</button> | ||
</td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %}Index{% endblock %} | ||
|
||
{% block content %} | ||
{% extends "base.html" %} {% block title %}Index{% endblock %} {% block content | ||
%} | ||
<h1>Inventory App</h1> | ||
<form id="add-form"> | ||
<input placeholder="Your House name" required type=text name="title"> | ||
<input placeholder="Description" required type=text name="body"> | ||
<button hx-post="/houses" hx-trigger="click" hx-target="#houses-content" hx-swap="beforeend">Add</button> | ||
<input placeholder="Your House name" required type="text" name="title" /> | ||
<input placeholder="Description" required type="text" name="body" /> | ||
<button | ||
hx-post="/houses" | ||
hx-trigger="click" | ||
hx-target="#houses-content" | ||
hx-swap="beforeend" | ||
> | ||
Add | ||
</button> | ||
</form> | ||
<div id="list" hx-get="/houses" hx-target="this" hx-trigger="load" hx-swap="outerHTML"> | ||
<div | ||
id="list" | ||
hx-get="/houses" | ||
hx-target="this" | ||
hx-trigger="load" | ||
hx-swap="outerHTML" | ||
> | ||
Loading... | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#content { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 1rem; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 1rem; | ||
} | ||
|
||
table, th, td { | ||
table, | ||
th, | ||
td { | ||
border: 1px solid black; | ||
padding: 0.25rem; | ||
padding: 0.25rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fn main() { | ||
inventory_api::main(); | ||
inventory_api::main(); | ||
} |