66 <link rel =" stylesheet" href =" ${self.getStyles()}" >
77 <link rel =" stylesheet" href =" css/header.css" >
88 <script src =" js/header.js" ></script >
9+ <style >
10+ .page-body {
11+ margin : 0 ;
12+ font-family : sans-serif ;
13+ }
14+
15+ .container {
16+ display : flex ;
17+ flex-direction : row ;
18+ gap : 20px ;
19+ padding : 20px ;
20+ }
21+
22+ .trick-list {
23+ width : 250px ;
24+ border-right : 1px solid #ccc ;
25+ padding-right : 15px ;
26+ }
27+
28+ .trick-list ul {
29+ list-style : none ;
30+ padding : 0 ;
31+ margin : 0 ;
32+ }
33+
34+ .trick-list li {
35+ margin-bottom : 8px ;
36+ }
37+
38+ .trick-list a {
39+ text-decoration : none ;
40+ color : #007bff ;
41+ }
42+
43+ .trick-details {
44+ flex-grow : 1 ;
45+ }
46+
47+ textarea {
48+ width : 100% ;
49+ box-sizing : border-box ;
50+ }
51+
52+ .meta-item {
53+ margin : 4px 0 ;
54+ }
55+
56+ .section-title {
57+ margin-top : 20px ;
58+ }
59+ </style >
960</head >
1061<body class =" page-body" >
1162
12- <header >
13- <h1 >MangoBot</h1 >
14- <nav >
15- <ul >
16- <#list headers as header >
17- <li ><a href =${header.page()} >${header.text()} </a ></li >
18- </#list >
19- </ul >
20- </nav >
21- </header >
22-
23- <div class =" container" >
24-
25- <#if (guildId?? && trickId??) >
26- <!-- Trick Details Page -->
27- <h2 class =" trick-title" >Trick Details</h2 >
28- <div class =" trick-info" >
29- <p class =" trick-id" >ID: ${trick.getTrickID()} </p >
30- <p class =" trick-type" >Type: ${trick.getType()} </p >
31- <p class =" trick-guild" >Guild: ${trick.getGuildID()?c } ${guildName} </p >
32- </div >
33-
34- <#switch trick.getType() >
35- <#case "ALIAS" >
36- <h3 class =" section-title" >Alias Target</h3 >
37- <div class =" trick-alias" >${trick.getAliasTarget()} </div >
38- <#break >
39- <#case "NORMAL" >
40- <h3 class =" section-title" >Content</h3 >
41- <div class =" trick-content" >
42- <textarea cols =" 50" rows =" 20" wrap =" hard" readonly >${trick.getContent()} </textarea >
43- </div >
44- <#break >
45- <#case "SCRIPT" >
46- <h3 class =" section-title" >Script</h3 >
47- <div class =" trick-script" >
48- <textarea cols =" 50" rows =" 20" wrap =" hard" readonly >${trick.getScript()} </textarea >
49- </div >
50- <#break >
51- </#switch >
52-
53- <div class =" trick-meta" >
54- <p class =" meta-item" >Trick Owner: ${trick.getOwnerID()?c } ${ownerName} </p >
55- <p class =" meta-item" >Last Edited By: ${trick.getLastUserEdited()?c } ${lastUserName} </p >
56- <p class =" meta-item" >Created: ${created} </p >
57- <p class =" meta-item" >Last Edited: ${lastEdited} </p >
58- <p class =" meta-item" >Times Used: ${trick.getTimesUsed()?c } </p >
59- <p class =" meta-item" >Locked: ${trick.isLocked()?string } </p >
60- <p class =" meta-item" >Embeds Suppressed: ${trick.isSuppressed()?string } </p >
61- </div >
62-
63- <#elseif guildId?? && !trickId?? >
64- <!-- Trick Selection Page -->
65- <h2 class =" title" >Select Trick</h2 >
66- <form method =" GET" action =" /trick" class =" form-group" >
67- <input type =" hidden" name =" guildId" value =" ${guildId}" >
68- <label for =" trickId" >Choose a Trick:</label >
69- <select name =" trickId" id =" trickId" class =" select-input" >
70- <#list tricks as trick >
71- <option value =" ${trick.getTrickID()}" >${trick.getTrickID()} </option >
72- </#list >
73- </select >
74- <button type =" submit" class =" btn btn-primary" >Enter!</button >
75- </form >
76-
77- <#else >
78- <!-- Guild Selection Page -->
79- <h2 class =" title" >Select Guild</h2 >
80- <form method =" GET" action =" /trick" class =" form-group" >
81- <label for =" guildId" >Choose a Guild:</label >
82- <select name =" guildId" id =" guildId" class =" select-input" >
83- <#list guilds as guild >
84- <option value =" ${guild.id()}" >${guild.name()} </option >
63+ <header >
64+ <h1 >MangoBot</h1 >
65+ <nav >
66+ <ul >
67+ <#list headers as header >
68+ <li ><a href =" ${header.page()}" >${header.text()} </a ></li >
69+ </#list >
70+ </ul >
71+ </nav >
72+ </header >
73+
74+ <div class =" container" >
75+
76+ <#if guildId?? >
77+ <div class =" trick-list" >
78+ <h3 >Tricks</h3 >
79+ <#if tricks?? && tricks?size gt 0 >
80+ <ul >
81+ <#list tricks as trickItem >
82+ <li >
83+ <a href =" ?guildId=${guildId}&trickId=${trickItem.getTrickID()}" >
84+ ${trickItem.getTrickID()} (${trickItem.getType()} )
85+ </a >
86+ </li >
8587 </#list >
86- </select >
87- <button type =" submit" class =" btn btn-primary" >Enter!</button >
88- </form >
89- </#if >
88+ </ul >
89+ <#else >
90+ <p >No tricks found. Maybe don't run a bot on a ghost town server?</p >
91+ </#if >
92+ </div >
93+
94+ <div class =" trick-details" >
95+ <#if trickId?? && trick?? >
96+ <h2 class =" trick-title" >Trick Details</h2 >
97+ <div class =" trick-info" >
98+ <p class =" trick-id" >ID: ${trick.getTrickID()} </p >
99+ <p class =" trick-type" >Type: ${trick.getType()} </p >
100+ <p class =" trick-guild" >Guild: ${trick.getGuildID()?c } ${guildName} </p >
101+ </div >
102+
103+ <#switch trick.getType() >
104+ <#case "ALIAS" >
105+ <h3 class =" section-title" >Alias Target</h3 >
106+ <div class =" trick-alias" >${trick.getAliasTarget()} </div >
107+ <#break >
108+ <#case "NORMAL" >
109+ <h3 class =" section-title" >Content</h3 >
110+ <div class =" trick-content" >
111+ <textarea cols =" 50" rows =" 20" wrap =" hard" readonly >${trick.getContent()} </textarea >
112+ </div >
113+ <#break >
114+ <#case "SCRIPT" >
115+ <h3 class =" section-title" >Script</h3 >
116+ <div class =" trick-script" >
117+ <textarea cols =" 50" rows =" 20" wrap =" hard" readonly >${trick.getScript()} </textarea >
118+ </div >
119+ <#break >
120+ <#default >
121+ <p >Unknown trick type. What kind of junk are you storing?</p >
122+ </#switch >
123+
124+ <div class =" trick-meta" >
125+ <p class =" meta-item" >Trick Owner: ${trick.getOwnerID()?c } ${ownerName} </p >
126+ <p class =" meta-item" >Last Edited By: ${trick.getLastUserEdited()?c } ${lastUserName} </p >
127+ <p class =" meta-item" >Created: ${created} </p >
128+ <p class =" meta-item" >Last Edited: ${lastEdited} </p >
129+ <p class =" meta-item" >Times Used: ${trick.getTimesUsed()?c } </p >
130+ <p class =" meta-item" >Locked: ${trick.isLocked()?string } </p >
131+ <p class =" meta-item" >Embeds Suppressed: ${trick.isSuppressed()?string } </p >
132+ </div >
133+ <#else >
134+ <p >Select a trick from the list on the left. Don’t just sit there like a stale donut.</p >
135+ </#if >
136+ </div >
137+ <#else >
138+ <!-- Guild Selection Page -->
139+ <h2 class =" title" >Select Guild</h2 >
140+ <form method =" GET" action =" /trick" class =" form-group" >
141+ <label for =" guildId" >Choose a Guild:</label >
142+ <select name =" guildId" id =" guildId" class =" select-input" >
143+ <#list guilds as guild >
144+ <option value =" ${guild.id()}" >${guild.name()} </option >
145+ </#list >
146+ </select >
147+ <button type =" submit" class =" btn btn-primary" >Enter!</button >
148+ </form >
149+ </#if >
90150
91- </div >
151+ </div >
92152</body >
93- </html >
153+ </html >
0 commit comments