Advertisement
C0BRA

How it works

Dec 16th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. local template = {}
  2.  
  3. template.generate = function(res, title, content)
  4.     tags.html
  5.     {
  6.         tags.head
  7.         {
  8.             tags.title { tostring(title) },
  9.             tags.link { type="text/css", rel="stylesheet", href="/pocsag/style.css" },
  10.             tags.script { src="http://code.jquery.com/jquery-1.7.2.min.js" },
  11.             tags.script { src="/pocsag/script.js" }
  12.         },
  13.         tags.body
  14.         {
  15.             tags.div { class = "wrapper" }
  16.             {
  17.                 tags.div { class = "content", id = "messages" }
  18.                 {
  19.                     unpack(content)
  20.                 }
  21.             }
  22.         }
  23.     }.to_response(res)
  24. end
  25.  
  26.  
  27. return template
  28.  
  29. -- ======================================= --
  30.  
  31. local template = {}
  32.  
  33. template.generate = function(res, title, content)
  34.     tags.html(
  35.     {
  36.         tags.head(
  37.         {
  38.             tags.title( { tostring(title) } ),
  39.             tags.link( { type="text/css", rel="stylesheet", href="/pocsag/style.css" } ),
  40.             tags.script( { src="http://code.jquery.com/jquery-1.7.2.min.js" } ),
  41.             tags.script( { src="/pocsag/script.js" } )
  42.         }),
  43.         tags.body(
  44.         {
  45.             tags.div( { class = "wrapper" } )(
  46.             {
  47.                 tags.div( { class = "content", id = "messages" } )(
  48.                 {
  49.                     unpack(content)
  50.                 })
  51.             })
  52.         })
  53.     }).to_response(res)
  54. end
  55.  
  56.  
  57. return template
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement