fixed the correct display of authors per web. added singular/plural for authors and pages. css optimizations

This commit is contained in:
Matthias Tarasiewicz 2007-01-18 13:33:52 +00:00
parent 4eefc3c979
commit 2e558d5222
3 changed files with 301 additions and 67 deletions

View file

@ -22,7 +22,9 @@ class Web < ActiveRecord::Base
'SELECT DISTINCT r.author AS author ' +
'FROM revisions r ' +
'JOIN pages p ON p.id = r.page_id ' +
'ORDER by 1').collect { |row| row['author'] }
'WHERE p.web_id = ' + self.id.to_s +
'ORDER by 1 '
).collect { |row| row['author'] }
end
def categories

View file

@ -1,10 +1,10 @@
<% @title = "Wiki webs" %>
<br/>
<% @webs.each do |web| %>
<% if web.password %> <div style="padding: 4px; background-image: url(/images/bg_protected.gif)">
<% else %> <div style="padding: 4px;"> <% end %>
<% if web.password %> <div class="web_protected">
<% else %> <div class="web_normal"> <% end %>
<span>
<%= link_to_page 'HomePage', web, web.name, :mode => 'show' %>
<% if web.published? %>
@ -12,9 +12,8 @@
<% end %>
<div class="byline" style="margin-bottom: 0px">
<%= web.pages.length %> pages by <%= web.authors.length %> authors
<%= web.pages.length %> page<% if web.pages.length != 1 %>s<% end %> by <%= web.authors.length %> author<% if web.authors.length != 1 %>s<% end %>
</div>
</span>
</div><br>
<% end %>