/
hn.haml
33 lines (28 loc) · 992 Bytes
/
hn.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
%div{:style => 'display:none'}
%h2 Set Watch
%p
Select a HN user to watch (e.g. pg, patio11).
%a{:href => "/watch"} See the watchlist.
%form{:method => 'post', :action => '/watch'}
%input{:type => 'text', :name => 'user'}
%input{:type => 'submit', :value => 'Watch'}
<br/>
%h2 Watch Articles
%p These are the items being discussed by watched users.
- ycit = 'http://news.ycombinator.com/item?id='
%ul.simple
- @top.each do |posting|
- item = posting.first
- watch = posting.last
%li
- if item and !item.title.blank? and !item.link.blank?
%div.meta{:style => 'float:right;'}
%a{:href => "#{ycit}#{item.pid}"}= "#{item.pntx} pt, #{item.cmtx} cx"
%div
%a{:href => "/watch/activity/#{item.pid}"}= "[+#{watch}]"
%a{:href => item.link}= item.title
%div.stats
- if @stats
%p= "Postings: #{@stats[:posts]}, Avatars: #{@stats[:avatars]}, Watched: #{@stats[:watched]}"
- else
%p No stats.