Advertisement
Bear13th

userEdit.flth

Apr 2nd, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.11 KB | None | 0 0
  1. <#import "parts/common.ftlh" as c>
  2.  
  3. <@c.page>
  4.     User editor
  5.     <form action="/user" method="post">
  6.         <input type="hidden" name="_csrf" value="${_csrf.token}"/>
  7.         <input type="hidden" name="userId" value="${user.id}">
  8.         <input type="text" name="username" value="${user.username}">
  9.  
  10.         <#list roles as role>
  11.             <div>
  12.                 <label>
  13.                     <input type="checkbox" name="${role}" ${user.roles?seq_contains(role)?string("checked", "")}>
  14.                     ${role}
  15.                 </label>
  16.             </div>
  17.         </#list>
  18.         <button type="submit">Save</button>
  19.     </form>
  20.     <table>
  21.         <thead>
  22.         <tr>
  23.             <th>Name</th>
  24.             <th>Role</th>
  25.             <th></th>
  26.         </tr>
  27.         </thead>
  28.         <tbody>
  29.         <#list users as user>
  30.             <tr>
  31.                 <td>${user.username}</td>
  32.                 <td><#list user.roles as role>${role}<#sep>, </#list></td>
  33.                 <td><a href="/user/${user.id}">edit</a></td>
  34.             </tr>
  35.         </#list>
  36.         </tbody>
  37.     </table>
  38. </@c.page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement