diff options
| author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-09-29 13:10:56 +0200 | 
|---|---|---|
| committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-09-29 13:11:04 +0200 | 
| commit | 07ace53ba2423f1b7e62477549ba62a30e79ff47 (patch) | |
| tree | f1db9b2ab3d92ab292dd2b39c9902d4a44a043d7 /ideas.html | |
| parent | 83334dc6011a5d39dd44995645fad55ee37daea7 (diff) | |
Added edit functionalityv0.1.0
Added a new edit functionality and page with styling.
Other minor changes:
- Added assets folder served under /static/
- Created a new template edit.html
- grouped ideas.html and edit.html under t_idea
- Changed router to use mux and organized routes
- Added more checks on empty titles
- Added javascript to t_idea/index.html for intuitive button
  functionality
Diffstat (limited to 'ideas.html')
| -rw-r--r-- | ideas.html | 97 | 
1 files changed, 0 insertions, 97 deletions
| diff --git a/ideas.html b/ideas.html deleted file mode 100644 index de8aa2b..0000000 --- a/ideas.html +++ /dev/null @@ -1,97 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> -    <meta charset="UTF-8"> -    <meta name="viewport" content="width=device-width, initial-scale=1.0"> -    <title>Ideas</title> -    <style> - -body { -    margin-left: 1em; -} -.idea { -    border: solid 2px black;  -    border-radius: 5px; -    padding: 4px; -    margin-bottom: 1em; -    width: 50%; -} -.title { -    margin-left: 1em; -    margin-bottom: 0; -    display: inline; -} -.rating { -    display: inline; -    margin-left: 1em; -} -.text { -    margin-left: .5em; -    margin-top: .5em; -    font-family: monospace; -    font-size: 1.25em; -} -.creation { -    margin-bottom: .3em; -} -.author { -    font-style: italic; -} -.date { -    color: #bcbcbc; -} - -.error { -    color: red; -} -textarea[name="text"] { -    border: solid 2px black; -    border-radius: 5px; -    margin-top: .3em; -    margin-bottom: .3em; -    resize: none; -} -h3 { -    margin-bottom: 0; -} -input[type="text"]{ -    border-radius: 3px; -    border: solid 1px black; -} -input[name="author"] { -    margin-bottom: .3em; -} - -    </style> -</head> -<body> -    {{ with .Error }} -    <p class="error">{{.}}</p> -    {{ end}} -    <h3>Add an idea:</h3> -    <form action="/create/" method="post"> -        <input name="title" type="text" placeholder="Title" required></br> -        <textarea name="text" cols=50 rows=4 placeholder="Write what is in your lightbulb here." required></textarea> -        </br> -        <input name="author" type="text" placeholder="Your Name" required></br> -        <input type="submit" value="Think"> -    </form> -    <hr> -    <ul> -    {{ range .Ideas }} -        <div class="idea"> -            <h2 class="title">{{.Title}}</h2> -            <p class="text">{{.Text}}</p> -            <p class="creation">by <span class="author">{{.Author}}</span> on <span class="date">{{.CreatedAt}}</span></p> -            <form action="/delete/" method="post"> -                <input type="hidden" name="title" value="{{.Title}}"> -                <input type="submit" value="delete"> -            </form> -        </div> -    {{ else }} -    <p><i>No ideas here... Be the first one to think!</i></p> -    {{ end }} -    </ul> -    <!--template--> -</body> -</html> | 
