A webmail client. Forked from https://git.sr.ht/~migadu/alps
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

20 lignes
658 B

  1. -- This message will be printed when the plugin is loaded
  2. print("Hi, this is an example Lua plugin")
  3. -- Setup a function called when the mailbox view is rendered
  4. alps.on_render("mailbox.html", function(data)
  5. print("The mailbox view for " .. data.Mailbox.Name .. " is being rendered")
  6. -- Set extra data that can be accessed from the mailbox.html template
  7. data.Extra.Example = "Hi from Lua"
  8. end)
  9. -- Wire up a new route
  10. alps.set_route("GET", "/example", function(ctx)
  11. ctx:String(200, "This is an example page.")
  12. end)
  13. -- Set a filter function that can be used from templates
  14. alps.set_filter("example_and", function(a, b)
  15. return a .. " and " .. b
  16. end)