public
Rubygem
Description: Disco Stu doesn't advertise.
Homepage: http://discostu.us/
Clone URL: git://github.com/mcornick/discostu.git
add link ticker to header
mcornick (author)
Fri Jun 20 12:44:07 -0700 2008
commit  c43eed9fe22c9541260a6cb3988c78a21fd69062
tree    9c63ab96a7255d0a37f437e705e40cb8e7220f3b
parent  d38f68e583403d03a26172bdefc0194131c76b2b
...
9
10
11
 
 
 
 
 
 
 
12
...
9
10
11
12
13
14
15
16
17
18
19
0
@@ -9,4 +9,11 @@ module ApplicationHelper
0
   def auto_discovery_links
0
     auto_discovery_link_tag(:atom, formatted_links_url(:atom), :title => 'Disco Stu default Atom feed')+"\n"
0
   end
0
+
0
+ def link_ticker
0
+ ticker = "#{pluralize Link.count, 'link'} from #{pluralize User.count, 'user'}"
0
+ ticker += ", tagged with #{pluralize Tag.count, 'tag'}" if Tag.count > 0
0
+ ticker += "; last link posted #{time_ago_in_words Link.last.created_at} ago" if Link.count > 0
0
+ content_tag :p, ticker
0
+ end
0
 end
...
13
14
15
 
16
17
18
...
13
14
15
16
17
18
19
0
@@ -13,6 +13,7 @@
0
     <div id="hd">
0
       <h1><%= link_to "Disco Stu", root_url %></h1>
0
       <h2>&ldquo;The Linkbot That <em>Still</em> Doesn&rsquo;t Advertise&rdquo;</h2>
0
+ <%= link_ticker %>
0
     </div>
0
     <div id="bd">
0
       <div id="yui-main">
...
40
41
42
 
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
61
62
63
...
40
41
42
43
44
45
46
47
 
48
49
50
51
52
 
53
54
55
56
57
 
 
58
59
60
61
0
@@ -40,24 +40,22 @@ div#hd {
0
   border-bottom: 1px solid black;
0
   padding: 5px;
0
   margin: 0 0 10px 0;
0
+ height: 80px;
0
 }
0
 
0
 div#hd h1 {
0
   font-size: 182%;
0
- padding: 5px;
0
   margin: 0;
0
 }
0
 
0
 div#hd h2 {
0
   font-size: 138.5%;
0
- padding: 5px;
0
   margin: 0;
0
   font-weight: normal;
0
 }
0
 
0
 div#hd p {
0
- padding: 5px;
0
- margin: 0;
0
+ margin: 5px 0 0 0;
0
 }
0
 
0
 

Comments

    No one has commented yet.