Posts no longer look like balls, yay! veekun-promotions/2010070701
authorEevee <git@veekun.com>
Fri, 18 Jun 2010 00:35:15 +0000 (17:35 -0700)
committerEevee <git@veekun.com>
Fri, 18 Jun 2010 00:35:15 +0000 (17:35 -0700)
splinext/forum/templates/css/forum.mako
splinext/forum/templates/forum/lib.mako
splinext/forum/templates/forum/posts.mako

index be6ace9..6af5d50 100644 (file)
@@ -4,7 +4,12 @@ table.forum-list td.name a { display: block; font-size: 1.5em; padding: 0.33em;
 table.forum-list .stats { width: 10em; text-align: center; }
 
 .forum-post-container { }
-.forum-post { position: relative; margin: 1em 0; padding: 1em; background: #d0d8ff; -moz-border-radius: 1em; -webkit-border-radius: 1em; }
-.forum-post .author { position: absolute; top: 0; right: 0; bottom: 0; width: 16em; padding: 0.5em; background: #c0c8ff; -moz-border-radius-topright: 1em; -moz-border-radius-bottomright: 1em; -webkit-border-top-right-radius: 1em; -webkit-border-bottom-right-radius: 1em; }
-.forum-post .meta { margin-right: 17em; padding-bottom: 0.5em; padding-right: 0.5em; border-bottom: 1px dotted navy; }
-.forum-post .content { margin-right: 16.5em; padding-top: 0.5em; padding-right: 0.5em; }
+.forum-post { position: relative; margin: 1em 0; background: #fcfcfc; -moz-border-radius: 1em; -webkit-border-radius: 1em; }
+.forum-post .author { position: absolute; top: 2.2em; right: 0; bottom: 0; width: 16em; padding: 0 1em; margin: 1em 0; border-left: 1px solid #b4c7e6; }
+.forum-post .author .name { display: block; font-size: 1.5em; }
+.forum-post .author .name .user-color-bar { display: block; font-size: 0.67em; width: auto; }
+.forum-post .author .avatar { margin-bottom: 1em; }
+.forum-post .author .avatar img { -moz-box-shadow: 0 0 2px black; }
+.forum-post .meta { padding: 0.5em 1em; border: 1px solid #b4c7e6; background: url(${h.static_uri('local', 'images/layout/th-background.png')}) left bottom repeat-x; -moz-border-radius-topleft: 0.5em; -moz-border-radius-topright: 0.5em; -webkit-border-top-left-radius: 0.5em; -webkit-border-top-right-radius: 0.5em; }
+.forum-post .content { min-height: 12em; margin-right: 16.5em; padding: 1em; }
+.forum-post:nth-child(2n) { background: #f4f4f4; }
index e2aafde..5be6251 100644 (file)
@@ -1,4 +1,29 @@
 <%namespace name="lib" file="/lib.mako" />
+<%namespace name="userlib" file="/users/lib.mako" />
+
+<%def name="posts(posts)">
+<div class="forum-post-container">
+    % for post in posts:
+    <div class="forum-post">
+        <div class="author">
+            <div class="avatar">
+                ${userlib.avatar(post.author)}
+            </div>
+            <div class="name">
+                <a href="${url(controller='users', action='profile', id=post.author.id, name=post.author.name)}">
+                    ${post.author.name}
+                    ${userlib.color_bar(post.author)}
+                </a>
+            </div>
+        </div>
+        <div class="meta">
+            <time>${post.posted_time}</time>
+        </div>
+        <div class="content">${post.content}</div>
+    </div>
+    % endfor
+</div>
+</%def>
 
 <%def name="write_thread_form(forum)">
 % if c.user.can('create_forum_thread'):
index b97954f..3ba1ec5 100644 (file)
 
 % if c.thread.post_count == 0:
 <p>Something terribly bogus has happened; this thread has no posts.</p>
-<% return %>
+% else:
+${forumlib.posts(c.thread.posts)}
 % endif
 
-<div class="forum-post-container">
-    % for post in c.thread.posts:
-    <div class="forum-post">
-        <div class="author">
-            ${post.author.name}
-        </div>
-        <div class="meta">
-            <time>${post.posted_time}</time>
-        </div>
-        <div class="content">${post.content}</div>
-    </div>
-    % endfor
-</div>
-
 ${forumlib.write_post_form(c.thread)}