github.com/mssola/todo@v0.0.0-20181029153210-d25348dc3f48/views/topics/show.tpl (about) 1 <div class="topics-wrapper"> 2 3 {{$c := .Current}} 4 5 {{if not .Print}} 6 <div id="list"> 7 <h3>topics</h3> 8 <ul> 9 {{range .Topics}} 10 {{if eq .ID $c.ID}} 11 <li class="selected"><a href="/topics/{{.ID}}">{{.Name}}</a></li> 12 {{else}} 13 <li><a href="/topics/{{.ID}}">{{.Name}}</a></li> 14 {{end}} 15 {{end}} 16 17 <li class="create"> 18 <button id="create-button" class="btn grey-btn">create</button> 19 20 <form action="/topics" method="POST" autocomplete="off" accept-charset="utf-8"> 21 <input class="tiny-text" type="text" name="name" value="" autocomplete="off" tabindex="1" placeholder="name" required /> 22 <input class="btn grey-btn" type="submit" value="create" /> 23 </form> 24 </li> 25 26 <li class="logout"> 27 <form action="/logout" method="POST"> 28 <input class="btn grey-btn" type="submit" value="logout" /> 29 </form> 30 </li> 31 </ul> 32 <p></p> 33 <a id="license-link" href="/license" title="This is free software. Click this link for more information">Source code & license</a> 34 </div> 35 {{end}} 36 37 {{if .Print}} 38 <div id="contents" class="print"> 39 {{else}} 40 <div id="contents" class="noprint"> 41 {{end}} 42 43 {{if $c.ID}} 44 <div class="header"> 45 <h2>{{$c.Name}}</h2> 46 47 {{if not .Print}} 48 <ul class="options"> 49 <li><a href="#" id="rename" title="Rename this topic">rename</a></li> 50 <li><a href="#" id="edit" title="Edit the contents of this topic">edit</a></li> 51 <li><a href="#" id="delete" title="Delete this topic">delete</a></li> 52 <li><a href="/topics/{{$c.ID}}?print=1" title="Print this topic">print</a></li> 53 <li id="confirmation" class="confirmation"> 54 <span>are you sure? 55 <a href="#" id="delete-yes" class="yes">yes</a> / 56 <a href="#" id="delete-no" class="no">no</a> 57 </span> 58 </li> 59 </ul> 60 61 <form action="/topics/{{.Current.ID}}/delete" id="delete-form" class="delete-form" method="POST"> 62 </form> 63 64 <form action="/topics/{{.Current.ID}}" id="rename-form" method="POST" autocomplete="off" accept-charset="utf-8"> 65 <input class="tiny-text" type="text" name="name" value="" autocomplete="off" tabindex="1" placeholder="name" required /> 66 <input class="btn grey-btn" type="submit" value="rename" /> 67 </form> 68 {{end}} 69 </div> 70 71 <div id="edit-body" class="body"> 72 {{if .Print}} 73 <div class="contents-body print"> 74 {{else}} 75 <div class="contents-body noprint"> 76 {{end}} 77 {{noescape $c.Markdown}} 78 </div> 79 80 {{if not .Print}} 81 <div class="contents-edit"> 82 <form action="/topics/{{.Current.ID}}" method="POST" autocomplete="off" accept-charset="utf-8"> 83 <textarea name="contents" autocomplete="off" spellcheck="off">{{.Current.Contents}}</textarea> 84 <div class="buttons"> 85 <input class="btn green-btn" type="submit" value="update" /> 86 <button id="cancel-btn" class="btn red-btn cancel-btn">cancel</button> 87 </div> 88 </form> 89 </div> 90 {{end}} 91 </div> 92 {{end}} 93 </div> 94 95 </div>