diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-09-28 03:19:04 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-09-28 03:27:54 +0200 |
commit | 39a847ce13295290e43ef92784fa7fc27a842aa2 (patch) | |
tree | dbc190c809664c9759743eb6d80560c759624e8d /ideas.html | |
parent | 5b2097cd2ed016f78ae2c2bcc068dfe3f42e44bd (diff) |
Added Idea CRD
- Also added sending back errors to the template for displaying what
went wrong.
- Renamed Description to Text
- Added Delete operation for an idea
- Removed Store type because it had no real value
Diffstat (limited to 'ideas.html')
-rw-r--r-- | ideas.html | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -38,14 +38,33 @@ color: #bcbcbc; } +.error { + color: red; +} + </style> </head> <body> + {{ with .Error }} + <p class="error">{{.}}</p> + {{ end}} + <form action="/create/" method="post"> + <input name="title" type="text" placeholder="Title"></br> + <input name="text" type="text" placeholder="Idea description..."></br> + <input name="author" type="text" placeholder="Your Name"></br> + <input type="submit" value="Post"> + </form> + <hr> + <form action="/delete/" method="post"> + <input type="text" placeholder="Title" name="title"></br> + <input type="submit" value="Delete"> + </form> + <hr> <ul> {{ range .Ideas }} <div class="idea"> <h2 class="title">{{.Title}}</h2> - <p class="description">{{.Description}}</p> + <p class="text">{{.Text}}</p> <p class="creation">by <span class="author">{{.Author}}</span> on <span class="date">{{.CreatedAt}}</span></p> </div> {{ end }} |