Removed sass compiler usage from web.js, updated jade templates to use blocks

This commit is contained in:
Daniel Evans 2012-12-24 04:06:04 +00:00
parent cf53413bff
commit 88d2abab58
10 changed files with 97 additions and 74 deletions

View File

@ -2,9 +2,8 @@ var express = require('express');
var webInterface = function(dbot) {
var pub = 'public';
var app = express.createServer();
var app = express();
app.use(express.compiler({ src: pub, enable: ['sass'] }));
app.use(express.static(pub));
app.set('view engine', 'jade');

View File

@ -1,7 +1,10 @@
h3 Channels on #{connection}
div#backlink
a(href='/connections') « Connection List
ul#quotelist
-each channel in channels
a(href='/users/'+connection+'/'+channel.substr(1,channel.length))
li.quotes #{channel}
extends layout
block content
h3 Channels on #{connection}
div#backlink
a(href='/connections') « Connection List
ul#quotelist
-each channel in channels
a(href='/users/'+connection+'/'+channel.substr(1,channel.length))
li.quotes #{channel}

View File

@ -1,6 +1,9 @@
h3 Current Connections
div#backlink
a(href='/') « Home
extends layout
block content
h3 Current Connections
div#backlink
a(href='/') « Home
#modulelinks
-each connection in connections
a.module(href='/channels/'+connection) #{connection}
-each connection in connections
a.module(href='/channels/'+connection) #{connection}

View File

@ -1,4 +1,7 @@
#modulelinks
extends layout
block content
#modulelinks
a.module(href='/quotes') Quotes
a.module(href='/polls') Polls
a.module(href='/connections') Users

View File

@ -9,5 +9,5 @@ html(lang='en')
div#title
a(href='/') #{name} web interface
div#main
!{body}
block content
script(type="text/javascript", src="/script.js")

View File

@ -1,9 +1,12 @@
div#backlink
a(href='/') « Home
div#controls
input(type="text", name="search", id="search-text", oninput="search(this.value)")
ul#quotelist
-each poll in polllist
a(href='/polls/'+poll)
li.quotes #{poll}
extends layout
block content
div#backlink
a(href='/') « Home
div#controls
input(type="text", name="search", id="search-text", oninput="search(this.value)")
ul#quotelist
-each poll in polllist
a(href='/polls/'+poll)
li.quotes #{poll}

View File

@ -1,9 +1,12 @@
div#backlink
a(href='/') « Home
div#controls
input(type="text", name="search", id="search-text", oninput="search(this.value)")
ul#quotelist
-each quote in quotelist
a(href='/quotes/'+quote)
li.quotes #{quote}
extends layout
block content
div#backlink
a(href='/') « Home
div#controls
input(type="text", name="search", id="search-text", oninput="search(this.value)")
ul#quotelist
-each quote in quotelist
a(href='/quotes/'+quote)
li.quotes #{quote}

View File

@ -1,26 +1,29 @@
div#backlink
a(href='/quotes/') « Quote list
ul#quotelist
-var hasYouTubeVids=false
-each quote in quotes
-if(quote.match(locals.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 if(quote.match(/~~([^~]+)~~/))
-var res = quote.match(/~~([^~]+)~~/)
-if(res != null)
extends layout
block content
div#backlink
a(href='/quotes/') « Quote list
ul#quotelist
-var hasYouTubeVids=false
-each quote in quotes
-if(quote.match(locals.url_regex))
li.quote
a(href="/quotes/#{res[1]}") #{quote}
-else
li.quote #{quote}
-if(hasYouTubeVids)
script(src='/ytembed.js')
-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 if(quote.match(/~~([^~]+)~~/))
-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')

View File

@ -1,11 +1,14 @@
h3 #{user}'s profile
div#backlink
a(href='/users/'+connection+'/'+channel.substr(1,channel.length)) « #{channel} Nick List
extends layout
div.quotecount
#{cleanUser} is filled with
a(href='/quotes/'+cleanUser) #{quotecount} quotes
.
block content
h3 #{user}'s profile
div#backlink
a(href='/users/'+connection+'/'+channel.substr(1,channel.length)) « #{channel} Nick List
div.kickcount
#{cleanUser} has kicked people #{kicked} times and has been kicked #{kicks} times.
div.quotecount
#{cleanUser} is filled with
a(href='/quotes/'+cleanUser) #{quotecount} quotes
.
div.kickcount
#{cleanUser} has kicked people #{kicked} times and has been kicked #{kicks} times.

View File

@ -1,7 +1,10 @@
h3 Users currently in #{channel} on #{connection}
div#backlink
a(href='/channels/'+connection) « Channel List
ul#quotelist
-each nick in nicks
a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick)
li.quotes #{nick}
extends layout
block content
h3 Users currently in #{channel} on #{connection}
div#backlink
a(href='/channels/'+connection) « Channel List
ul#quotelist
-each nick in nicks
a(href='/user/'+connection+'/'+channel.substr(1,channel.length)+'/'+nick)
li.quotes #{nick}