Show access levels and context everywhere!
authorEevee <git@veekun.com>
Sat, 14 Aug 2010 08:04:45 +0000 (01:04 -0700)
committerEevee <git@veekun.com>
Sat, 14 Aug 2010 08:04:45 +0000 (01:04 -0700)
splinext/forum/templates/css/forum.mako
splinext/forum/templates/forum/forums.mako
splinext/forum/templates/forum/lib.mako
splinext/forum/templates/forum/posts.mako
splinext/forum/templates/forum/threads.mako

index 6af5d50..0a2244b 100644 (file)
@@ -1,4 +1,10 @@
-table.forum-list { width: 100%; }
+ul.forum-hierarchy { margin: 0.25em 1em; color: #202020; }
+ul.forum-hierarchy li { margin: 0.25em; }
+
+.forum-access-level { font-size: 0.8em; padding: 0.25em 0.625em; font-style: italic; color: #606060; }
+.forum-access-level img { vertical-align: middle; }
+
+table.forum-list { width: 100%; margin-top: 1em; }
 table.forum-list .name { text-align: left; }
 table.forum-list td.name a { display: block; font-size: 1.5em; padding: 0.33em; }
 table.forum-list .stats { width: 10em; text-align: center; }
index 21c0289..6aa4be3 100644 (file)
@@ -1,4 +1,5 @@
 <%inherit file="/base.mako" />
+<%namespace name="forumlib" file="/forum/lib.mako" />
 
 <%def name="title()">Forums</%def>
 
@@ -6,7 +7,10 @@
 <table class="forum-list striped-rows">
 <thead>
     <tr class="header-row">
-        <th class="name">Forum</th>
+        <th class="name">
+            <img src="${h.static_uri('spline', 'icons/folders-stack.png')}" alt="">
+            Forum
+        </th>
         <th class="stats">Volume</th>
         <th class="stats">Activity</th>
     </tr>
 <tbody>
     % for forum in c.forums:
     <tr>
-        <td class="name"><a href="${url(controller='forum', action='threads', forum_id=forum.id)}">${forum.name}</a></td>
+        <td class="name">
+            <a href="${url(controller='forum', action='threads', forum_id=forum.id)}">${forum.name}</a>
+            ${forumlib.forum_access_level(forum)}
+        </td>
         <td class="stats">xxx</td>
         <td class="stats">xxx</th>
     </tr>
index 8a1893d..c364c8c 100644 (file)
@@ -1,6 +1,18 @@
 <%namespace name="lib" file="/lib.mako" />
 <%namespace name="userlib" file="/users/lib.mako" />
 
+<%def name="forum_access_level(forum)">
+% if forum.access_level != 'normal':
+<div class="forum-access-level">
+    % if forum.access_level == 'soapbox':
+    <img src="${h.static_uri('spline', 'icons/soap.png')}" alt=""> <strong>Soapbox</strong>: Regular users can't start new threads.
+    % elif forum.access_level == 'archive':
+    <img src="${h.static_uri('spline', 'icons/wooden-box.png')}" alt=""> <strong>Archive</strong>: No more posting!
+    % endif
+</div>
+% endif
+</%def>
+
 <%def name="posts(posts)">
 <div class="forum-post-container">
     % for post in posts:
index 3ba1ec5..a0f83e5 100644 (file)
 </ul>
 </%def>
 
+<h1>Posts</h1>
+<ul class="forum-hierarchy">
+    <li>
+        In forum: <a href="${url(controller='forum', action='threads', forum_id=c.thread.forum.id)}"><img src="${h.static_uri('spline', 'icons/folders-stack.png')}" alt=""> ${c.thread.forum.name}</a>
+        ${forumlib.forum_access_level(c.thread.forum)}
+    </li>
+    <li>
+        In thread: <strong><img src="${h.static_uri('spline', 'icons/folder-open-document-text.png')}" alt=""> ${c.thread.subject}</strong>
+    </li>
+</ul>
+
 % if c.thread.post_count == 0:
 <p>Something terribly bogus has happened; this thread has no posts.</p>
 % else:
index 8aab297..3eca688 100644 (file)
 </ul>
 </%def>
 
+<h1>Threads</h1>
+<ul class="forum-hierarchy">
+    <li>
+        In forum: <strong><img src="${h.static_uri('spline', 'icons/folders-stack.png')}" alt=""> ${c.forum.name}</strong>
+        ${forumlib.forum_access_level(c.forum)}
+    </li>
+</ul>
+
 <table class="forum-list striped-rows">
 <thead>
     <tr class="header-row">
-        <th class="name">Thread</th>
+        <th class="name">
+            <img src="${h.static_uri('spline', 'icons/folder-open-document-text.png')}" alt="">
+            Thread
+        </th>
         <th class="stats">Posts</th>
     </tr>
 </thead>