#!/usr/bin/ruby
# $Id$
#
-# = Copyright
+# Author:: Daigo Moriwaki
+# Homepage:: http://sourceforge.jp/projects/shogi-server/
#
+#--
# Copyright (C) 2006-2008 Daigo Moriwaki <daigo at debian dot org>
#
# This program is free software; you can redistribute it and/or modify
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#++
#
-# = Synopsis
+# == Synopsis
#
-# mk_html generates an html page from players.yaml.
+# mk_html generates an html page from a players.yaml.
#
-# = Usage
+# == Usage
#
-# ./mk_html [OPTION] < players.yaml > rating.html
+# ./mk_html [OPTION] < players.yaml > rating.html
#
# -h, --help::
# show help
# -w,--wdoor::
# adpot wdoor style
#
+# == PREREQUIRE
+#
+# * Ruby 1.8.7 and RDoc
+#
+# $ sudo aptitude install ruby1.8 rdoc1.8
+#
require 'optparse'
require 'rdoc/usage'
include ERB::Util
def show_date(time)
- time.strftime("%Y-%m-%d")
+ if (Time.now - time < 30*60)
+ return "on line"
+ elsif (Time.now - time < 24*60*60)
+ return time.strftime("%Y-%m-%d")
+ # return "%d hours ago" % [(Time.now - time)/3600]
+ else
+ return time.strftime("%Y-%m-%d")
+ end
end
def usage
%>
<tr class="<%=player_decoration%>">
<td class="name">
- <a id="popup<%=popup_id+=1%>" href="http://wdoor.c.u-tokyo.ac.jp/shogi/tools/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=<%= h yaml[key]['name'] %>"><%= h yaml[key]['name'] %></a>
+ <a id="popup<%=popup_id+=1%>" href="http://wdoor.c.u-tokyo.ac.jp/shogi/tools/view/show-player.cgi?event=LATEST&filter=floodgate&show_self_play=1&user=<%=u key%>"><%= h yaml[key]['name'] %></a>
<script type="text/javascript">
var tooltip<%=popup_id%> = new YAHOO.widget.Tooltip("myTooltip", {
context:"popup<%=popup_id%>",
.rate, .ngames, .win_rate {text-align: right;}
.last_modified {text-align: center;}
.gps, .yowai_gps {background-color: lightgreen;}
- .current {background-color: #FFFF00;}
- .today {background-color: #FFFF77;}
+ .current {background-color: #FFD700;}
+ .today {background-color: #FFFF00;}
.this_week {background-color: #FFFFAA;}
#bd {text-align: center;}