summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsostler <sbostler@gmail.com>2010-03-21 00:56:06 -0400
committersostler <sbostler@gmail.com>2010-03-21 00:56:06 -0400
commit5a94d94fef2748cc6d22cebbcd0b1eb85d0b7798 (patch)
treecebbda02852c9963d712b94fa951fd45c9d99568
parent5cb38dd389948bc2aae5dea175dd36b1f4e4d20b (diff)
Added room names to profiles
-rwxr-xr-xsrc/site.clj2
-rwxr-xr-xtemplate/log.st45
-rw-r--r--template/log_dump.st18
-rwxr-xr-xtemplate/profile.st222
-rw-r--r--template/profile_dump.st18
5 files changed, 166 insertions, 139 deletions
diff --git a/src/site.clj b/src/site.clj
index 39509a9..b6d0ee9 100755
--- a/src/site.clj
+++ b/src/site.clj
@@ -188,7 +188,7 @@
(defn fetch-messages-by-nick
([nick image-only] (fetch-messages-by-nick nick image-only 0))
([nick image-only offset]
- (let [query (str "SELECT m.content, m.created_on, m.message_id, u.nick, u.avatar
+ (let [query (str "SELECT m.content, m.created_on, m.message_id, u.nick, u.avatar, r.key
FROM messages m, users u, rooms r
WHERE m.user_id = u.user_id AND u.nick = ?
AND r.room_id = m.room_id AND r.admin_only = false "
diff --git a/template/log.st b/template/log.st
index 145f8c6..45de47e 100755
--- a/template/log.st
+++ b/template/log.st
@@ -2,50 +2,45 @@
<head>
<title>dump.fm log</title>
$head()$
- <link rel="stylesheet" type="text/css" href="/static/log.css">
+ <link rel="stylesheet" type="text/css" href="/static/log.css">
<script>
jQuery(document).ready(initLog);
</script>
</head>
<body>
$banner()$
- <div id="chatrap">
-
-
+ <div id="chatrap">
<div id="log">
<div id="loghead"></div>
<br>
<div id="posts">
- <div id="lolbanner">
+ <div id="lolbanner">
<img src="/static/welcomebanner.gif">
- </div>
- $if(dumps)$
- $dumps: { d | $logged_dump(dump=d)$ }$
- $else$
- No dumps!
- $endif$
- <div id="pnav">
-
- $if(next)$
- <div id="pnavn"><a href="/$roomkey$/log/$next$">next &#9758;</a></div>
+ </div>
+ $if(dumps)$
+ $dumps: { d | $log_dump(dump=d)$ }$
+ $else$
+ No dumps!
$endif$
+ <div id="pnav">
- &nbsp;
- $if(prev)$
- <div id="pnavo"> <a href="/$roomkey$/log/$prev$">&#9756; prev</a> </div>
- $endif$
+ $if(next)$
+ <div id="pnavn"><a href="/$roomkey$/log/$next$">next &#9758;</a></div>
+ $endif$
+ &nbsp;
+ $if(prev)$
+ <div id="pnavo"> <a href="/$roomkey$/log/$prev$">&#9756; prev</a> </div>
+ $endif$
- <br><br>
+ <br><br>
</div>
-</div>
-
-
+ </div>
<div id="footer">
$footer()$
- </div></div>
-
+ </div></div>
+
</body>
</html>
diff --git a/template/log_dump.st b/template/log_dump.st
new file mode 100644
index 0000000..49aab4b
--- /dev/null
+++ b/template/log_dump.st
@@ -0,0 +1,18 @@
+<div class="logged-dump" id="message-$dump.message_id$">
+ <div>
+ $dump.created_on$ -- by <b><a href="/u/$dump.nick$">$dump.nick$</a></b>
+ </div>
+ <a href="/u/$dump.nick$">
+ <div id="logavatar">
+
+ $if(dump.avatar)$
+ <img height="50" width="50" src="$dump.avatar$" />
+ $else$
+ <img height="50" width="50" src="/static/noinfo.png">
+ $endif$
+
+ </div></a>
+ <div class="content">$dump.content$</div>
+ <hr />
+ $share_buttons()$
+</div>
diff --git a/template/profile.st b/template/profile.st
index bca6a8b..377346f 100755
--- a/template/profile.st
+++ b/template/profile.st
@@ -7,143 +7,139 @@
<script src="/static/jquery.editinplace.1.0.1.packed.js"
type="text/javascript"></script>
<script src="/static/js/ajaxupload.js"></script>
-
- <script type="text/javascript" src="/static/jquery.editinplace.1.0.1.packed.js"></script>
-
-
+ <script type="text/javascript" src="/static/jquery.editinplace.1.0.1.packed.js"></script>
<script>
jQuery(document).ready(initProfile);
</script>
-
+
</head>
<body>
$banner()$
<div id="chatrap">
- <div id="headerbar"></div>
+ <div id="headerbar"></div>
<div id="log">
<div id="loghead">
</div>
<br>
<div id="posts">
-
+
<div id="cats">
- $if(dumps)$
-
- <div id="lolbanner">
- <img src="/static/welcomebanner.gif">
+ $if(dumps)$
+ <div id="lolbanner">
+ <img src="/static/welcomebanner.gif">
</div>
+
+ $dumps:{ d | $profile_dump(dump=d)$ }$
+ <div id="profile">
- $dumps:{ d | $logged_dump(dump=d)$ }$
- <div id="profile">
+ <h2>$nick$</h2>
+ $if(avatar)$
+ <img id="avatarPic" src="$avatar$" width="150px"/>
+ $else$
+ <img id="avatarPic"><img src="/static/noinfo.png">
+ $endif$
+
+ $if(is_home)$
+ <div id="avatar-editing" style="display: none">
+ <div id="avatar" class="editable">$avatar$</div>
+ <input id="upload" value="Upload Icon" type="submit">
+ <img id="spinner" src="/static/spinner.gif" style="display: none" />
+ </div>
+ $endif$
+
+ <h3>contact info</h3>
+ $if(contact)$
+ <div id="contact" class="linkify">$contact$</div>
+ $else$
+ <div><img id="contact" src="/static/noinfo.png"></div>
+ $endif$
+ <br>
+
+ <h3>bio</h3>
+ $if(bio)$
+ <div id="bio" class="linkify">$bio$</div>
+ $else$
+ <div><img id="bio" src="/static/noinfo.png"></div>
+ $endif$
+
+ $if(is_home)$
+ <br>
+ <div id="edit-toggle"><a href="#">edit profile</a></div>
+ $endif$
+
+ <br>
+ <div id="date">
+ <div type="text" id="datepicker"></div></div>
+ </div>
- <h2>$nick$</h2>
- $if(avatar)$
- <img id="avatarPic" src="$avatar$" width="150px"/>
- $else$
- <img id="avatarPic"><img src="/static/noinfo.png">
- $endif$
-
- $if(is_home)$
- <div id="avatar-editing" style="display: none">
- <div id="avatar" class="editable">$avatar$</div>
- <input id="upload" value="Upload Icon" type="submit">
- <img id="spinner" src="/static/spinner.gif" style="display: none" />
- </div>
- $endif$
-
- <h3>contact info</h3>
- $if(contact)$
- <div id="contact" class="linkify">$contact$</div>
- $else$
- <div><img id="contact" src="/static/noinfo.png"></div>
- $endif$
- <br>
-
- <h3>bio</h3>
- $if(bio)$
- <div id="bio" class="linkify">$bio$</div>
$else$
- <div><img id="bio" src="/static/noinfo.png"></div>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
+ <div id="newuser">
+ <h2>Welcome to dump.fm</h2>
+ <br><br>
+
+ <h1>Step &#x2776;</h1>
+ <h3>&#x261F; Find a sweet image for your avatar, paste the URL below &#x261F;</h3>
+ $if(avatar)$
+ <img id="avatarPic" src="$avatar$" width="150px"/>
+ $else$
+ <b id="avatarPic"></b>
+ $endif$
+
+ $if(is_home)$
+ <div id="avatar-editing">
+ <div id="avatar" class="editable">$avatar$</div>
+ <input id="upload" value="Upload Icon" type="submit">
+ <img id="spinner" src="/static/spinner.gif" style="display: none" />
+ </div>
+ $endif$
+
+ <h1>Step &#x2777;</h1>
+ <h3>&#x261F; Enter some contact info below &#x261F;</h3>
+ <div id="contact" class="$if(is_home)$editable$else$linkify$endif$">$contact$</div>
+ <br>
+
+ <h1>Step &#x2778;</h1>
+ <h3>&#x261F; Enter some personal info below &#x261F;</h3>
+ <div id="bio" class="$if(is_home)$editable$else$linkify$endif$">$bio$</div>
+ <br>
+ <h1>Step &#x2779;</h1>
+
+ <h3> <a href="/chat">Join the &#x2663; and start posting pictures!</a></h3>
+ <h3>&nbsp;</h3></div>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
+ <h3>&nbsp;</h3>
$endif$
+
+ <p>&nbsp;</p>
+ <div id="pnav">
- $if(is_home)$
- <br>
- <div id="edit-toggle"><a href="#">edit profile</a></div>
- $endif$
-
- <br>
- <div id="date">
- <div type="text" id="datepicker"></div></div>
- </div>
+ $if(next)$
+ <div id="pnavn"><a href="/u/$nick$/$next$">next &#9758;</a></div>
+ $endif$
- $else$
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- <div id="newuser">
- <h2>Welcome to dump.fm</h2>
- <br><br>
-
- <h1>Step &#x2776;</h1>
- <h3>&#x261F; Find a sweet image for your avatar, paste the URL below &#x261F;</h3>
- $if(avatar)$
- <img id="avatarPic" src="$avatar$" width="150px"/>
- $else$
- <b id="avatarPic"></b>
- $endif$
-
- $if(is_home)$
- <div id="avatar-editing">
- <div id="avatar" class="editable">$avatar$</div>
- <input id="upload" value="Upload Icon" type="submit">
- <img id="spinner" src="/static/spinner.gif" style="display: none" />
+ &nbsp;
+ $if(prev)$
+ <div id="pnavo"> <a href="/u/$nick$/$prev$">&#9756; prev</a></div>
+ $endif$
+
+ <br><br>
</div>
- $endif$
-
- <h1>Step &#x2777;</h1>
- <h3>&#x261F; Enter some contact info below &#x261F;</h3>
- <div id="contact" class="$if(is_home)$editable$else$linkify$endif$">$contact$</div>
- <br>
-
- <h1>Step &#x2778;</h1>
- <h3>&#x261F; Enter some personal info below &#x261F;</h3>
- <div id="bio" class="$if(is_home)$editable$else$linkify$endif$">$bio$</div>
- <br>
- <h1>Step &#x2779;</h1>
-
- <h3> <a href="/chat">Join the &#x2663; and start posting pictures!</a></h3>
- <h3>&nbsp;</h3></div>
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- <h3>&nbsp;</h3>
- $endif$
-
- <p>&nbsp;</p>
- <div id="pnav">
-
- $if(next)$
- <div id="pnavn"><a href="/u/$nick$/$next$">next &#9758;</a></div>
- $endif$
- &nbsp;
- $if(prev)$
- <div id="pnavo"> <a href="/u/$nick$/$prev$">&#9756; prev</a></div>
- $endif$
-
- <br><br>
+ <div id="footer">
+ $footer()$
+ </div>
</div>
-
- <div id="footer">
- $footer()$
- </div>
- </div>
</div></div></div>
-$preload()$
+ $preload()$
</body>
</html>
diff --git a/template/profile_dump.st b/template/profile_dump.st
new file mode 100644
index 0000000..52001d6
--- /dev/null
+++ b/template/profile_dump.st
@@ -0,0 +1,18 @@
+<div class="logged-dump" id="message-$dump.message_id$">
+ <div>
+ $dump.created_on$ -- in <b><a href="/$dump.key$/chat">$dump.key$</a></b>
+ </div>
+ <a href="/u/$dump.nick$">
+ <div id="logavatar">
+
+ $if(dump.avatar)$
+ <img height="50" width="50" src="$dump.avatar$" />
+ $else$
+ <img height="50" width="50" src="/static/noinfo.png">
+ $endif$
+
+ </div></a>
+ <div class="content">$dump.content$</div>
+ <hr />
+ $share_buttons()$
+</div>