Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Various site cosmetic improvements #120

Merged
merged 5 commits into from

1 participant

@fcambus
Collaborator
  • Singularization fixes for comments points and count (display "discuss" instead of 0 comment)
  • Adds site description to the main page for SEO
  • Converted the lama.gif favicon to .ICO format and linking to it
  • Fixing default NewsUpVoteMinKarma value so karma can't be negative
@fcambus fcambus merged commit 40d39da into antirez:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
11 app.rb
@@ -67,7 +67,7 @@
end
get '/' do
- H.set_title "Top news - #{SiteName}"
+ H.set_title "#{SiteName} - #{SiteDescription}"
news,numitems = get_top_news
H.page {
H.h2 {"Top news"}+news_list_to_html(news)
@@ -1638,7 +1638,12 @@ def news_to_html(news)
}
}+" "+str_elapsed(news["ctime"].to_i)+" "+
H.a(:href => "/news/#{news["id"]}") {
- news["comments"]+" comments"
+ comments_number = news["comments"].to_i
+ if comments_number != 0
+ "#{news["comments"] + ' comment'}" + "#{'s' if comments_number>1}"
+ else
+ "discuss"
+ end
}
}+
if params and params[:debug] and $user and user_is_admin?($user)
@@ -1887,7 +1892,7 @@ def comment_to_html(c,u)
downclass << " voted"
upclass << " disabled"
end
- "#{score} points "+
+ "#{score} point"+"#{'s' if score.to_i.abs>1}"+" "+
H.a(:href => "#up", :class => upclass) {
"&#9650;"
}+" "+
View
3  app_config.rb
@@ -1,6 +1,7 @@
# General
SiteName = "Lamer News"
SiteUrl = "http://lamernews.com"
+SiteDescription = "Programming News"
# Redis config
RedisHost = "127.0.0.1"
@@ -24,7 +25,7 @@
KarmaIncrementAmount = 1
NewsDownvoteMinKarma = 30
NewsDownvoteKarmaCost = 6
-NewsUpvoteMinKarma = 0
+NewsUpvoteMinKarma = 1
NewsUpvoteKarmaCost = 1
NewsUpvoteKarmaTransfered = 1
KarmaIncrementComment = 1
View
2  page.rb
@@ -130,7 +130,7 @@ def page()
self.meta(:content => :index, :name => :robots)+
self.link(:href => "/css/style.css?v=10", :rel => "stylesheet",
:type => "text/css")+
- self.link(:href => "/images/favicon.png", :rel => "shortcut icon")+
+ self.link(:href => "/favicon.ico", :rel => "shortcut icon")+
self.script(:src => "/js/jquery.1.6.4.min.js"){}+
self.script(:src => "/js/app.js?v=10"){}
}+
View
BIN  public/favicon.ico
Binary file not shown
Something went wrong with that request. Please try again.