dbot/views/quotes/quotes.jade

30 lines
1009 B
Plaintext
Raw Normal View History

2012-12-24 06:47:47 +01:00
extends ../layout
block content
div#backlink
a(href='/quotes/') « Quote list
ul#quotelist
-var hasYouTubeVids=false
-each quote in quotes
-if(quote.match(url_regex))
li.quote
-if(quote.match(/(jpg|png|gif|jpeg|tiff)$/))
a(href=quote)
img(src=quote)
-else if(quote.match(/youtube.com\/watch/))
-hasYouTubeVids = true
span(class='ytplaceholder')
=quote
-else
a(href=quote)
=quote
-else
-var res = quote.match(/~~([^~]+)~~/)
-if(res != null)
li.quote
a(href="/quotes/#{res[1]}") #{quote}
-else
li.quote #{quote}
-if(hasYouTubeVids)
script(src='/ytembed.js')