Update of /cvsroot/ngetsuite/ngetsuite/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15352/web Modified Files: group.rhtml index.rhtml ngetsuite.css release.rhtml top.rhtml Added Files: cyan.png green.png grouphome.rhtml red.png Log Message: UI somewhat "improved", fixed ugly pretty_size --- NEW FILE: cyan.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: green.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: grouphome.rhtml --- <% require 'ngetsuite/db' require 'ngetsuite/utils' require 'ngetsuite/web' web = NgetSuite::Web.new(servlet_request) web.handle_args web.update_queue class GroupStats def initialize(groupindex) statsq = "select DATE_FORMAT(`time`,'%Y-%m-%d') as isodate, COUNT(distinct a.`rlsartindex`) as nbrls, COUNT(a.`artindex`) as nbarticles, COUNT(n.`text`) as nbnfos, SUM(a.`size`) as size from `articles` a left join `nfos` n using (`artindex`,`groupindex`) where a.`groupindex`='#{groupindex}' group by isodate order by isodate desc" @sth = NgetSuite::Db.dbh.execute statsq end def each_date return unless @sth @sth.fetch { |row| yield row } end end %> <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <link href="ngetsuite.css" rel="stylesheet" type="text/css"> <title>Group home</title> </head> <body> <div class="sectiontitle"><%= web.group._fullname %></div> <p>Added <b><%= web.group._date_added %></b></p> <p>Last updated <b><%= web.group._date_updated %></b></p> <p>Default download directory: <b><%= web.group._directory %></b></p> <% stats = GroupStats.new(web.group._groupindex) %> <ul> <% stats.each_date { |row| %> <li><b><%= NgetSuite::Web.date_str(row["isodate"]) %></b><br> <%= row["nbarticles"] %> articles posted, taking up <%= NgetSuite::Utils.pretty_size(row["size"]) %><br> <a href="group.rhtml?group=<%= web.group._fullname %>&date=<%= row["isodate"] %>"><%= row["nbrls"] %> releases</a><br> <a href="nfolist.rhtml?group=<%= web.group._fullname %>&date=<%= row["isodate"] %>"><%= row["nbnfos"] %> text files (nfos) retrieved</a><br><br> <% } %> </ul> </body> </html> --- NEW FILE: red.png --- (This appears to be a binary file; contents omitted.) Index: group.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/group.rhtml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** group.rhtml 20 Feb 2004 16:44:40 -0000 1.5 --- group.rhtml 21 Feb 2004 15:58:34 -0000 1.6 *************** *** 10,27 **** web.update_queue - class GroupDates - def initialize(groupindex) - datesq = "select DATE_FORMAT(`time`,'%Y-%m-%d') as isodate, DATE_FORMAT(`time`, '%d/%m') from `articles` where `groupindex`='#{groupindex}' group by isodate order by isodate desc" - @sth = NgetSuite::Db.dbh.execute datesq - end - - def each - return unless @sth - @sth.fetch { |row| - yield row[0], row[1] - } - end - end - class Releases def initialize(groupindex,date) --- 10,13 ---- *************** *** 40,64 **** return unless @sth @sth.fetch_hash { |row| ! row["graphmap"] = "" if row["rlsmap"] != "" for i in 0..row["rlsmap"].size-1 if row["rlsmap"][i] == "#"[0] then ! row["graphmap"] += "<font class=\"greenbox\">#{i+1}</font>" else ! row["graphmap"] += "<font class=\"redbox\">#{i+1}</font>" end ! row["graphmap"] += "<br>" if i % 25 == 24 end - row["graphmap"] += "<br>" else for i in 1..row["nbactual"] ! row["graphmap"] += "<font class=\"cyanbox\">#{i}</font>" ! row["graphmap"] += "<br>" if i % 25 == 24 end - row["graphmap"] += "<br>" end yield row } --- 26,54 ---- return unless @sth @sth.fetch_hash { |row| ! # row["graphmap"] = "<table class=\"rlsmap\" cellspacing=\"1\"><tr>" ! row["graphmap"] = "<div class=\"rlsmap\">#{row["nbactual"]}/#{row["nbexpected"]} " if row["rlsmap"] != "" for i in 0..row["rlsmap"].size-1 if row["rlsmap"][i] == "#"[0] then ! row["graphmap"] += "<img src=\"green.png\" width=\"3\" height=\"5\">" ! # row["graphmap"] += "<td class=\"greenbox\">#{i+1}</td>" else ! row["graphmap"] += "<img src=\"red.png\" width=\"3\" height=\"5\">" ! # row["graphmap"] += "<td class=\"redbox\">#{i+1}</td>" end ! # row["graphmap"] += "</tr><tr>" if i % 20 == 19 end else for i in 1..row["nbactual"] ! row["graphmap"] += "<img src=\"cyan.png\" width=\"3\" height=\"5\">" ! # row["graphmap"] += "<td class=\"cyanbox\">#{i}</td>" ! # row["graphmap"] += "</tr><tr>" if i % 20 == 19 end end + row["graphmap"] += "</div>" + # row["graphmap"] += "</tr></table>" yield row } *************** *** 76,87 **** <body> - <% dates = GroupDates.new(web.group._groupindex) - - dates.each { |iso,display| %> - <a href="group.rhtml?group=<%= web.group._fullname %>&date=<%=iso%>"><%=display%></a> | - <% } %> - <a href="group.rhtml?group=<%= web.group._fullname %>&date=any">any</a> ! <div class="group"><%= web.date_str %></div> <% releases = Releases.new(web.group._groupindex, web.date) %> --- 66,71 ---- <body> ! <div class="sectiontitle"><%= web.date_str %></div> <% releases = Releases.new(web.group._groupindex, web.date) %> *************** *** 93,105 **** <% releases.each { |rls| %> ! <tr> ! <td><i><%= NgetSuite::Utils.pretty_date(rls["time"]).split(" ")[1] %></i><br> <b><%= NgetSuite::Utils.pretty_size(rls["size"]) %><b></td> ! <td><a class="rlslink" target="right" href="release.rhtml?group=<%= web.group._fullname %>&rlsartind=<%= rls["artindex"].to_s %>"><%= rls["subject"] %></a><br> <%= rls["graphmap"] %> </tr> ! <tr> <td class="linesep" colspan="2"></td> ! </tr> <% } %> --- 77,89 ---- <% releases.each { |rls| %> ! <tr class="article"> ! <td class="time"><i><%= NgetSuite::Utils.pretty_date(rls["time"]).split(" ")[1] %></i><br> <b><%= NgetSuite::Utils.pretty_size(rls["size"]) %><b></td> ! <td class="subject"><a class="rlslink" target="right" href="release.rhtml?group=<%= web.group._fullname %>&rlsartind=<%= rls["artindex"].to_s %>"><%= rls["subject"] %></a><br> <%= rls["graphmap"] %> </tr> ! <!-- <tr> <td class="linesep" colspan="2"></td> ! </tr> --> <% } %> Index: index.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/index.rhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.rhtml 20 Feb 2004 16:44:40 -0000 1.4 --- index.rhtml 21 Feb 2004 15:58:34 -0000 1.5 *************** *** 11,15 **** url_top += "?group=#{group}" if group ! url_left = (group) ? "group.rhtml?group=#{group}" : "welcome.rhtml" url_right = "queueview.rhtml" --- 11,15 ---- url_top += "?group=#{group}" if group ! url_left = (group) ? "grouphome.rhtml?group=#{group}" : "welcome.rhtml" url_right = "queueview.rhtml" Index: ngetsuite.css =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/ngetsuite.css,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ngetsuite.css 20 Feb 2004 23:07:45 -0000 1.11 --- ngetsuite.css 21 Feb 2004 15:58:34 -0000 1.12 *************** *** 26,29 **** --- 26,41 ---- } + a.sidelink { + font-size: 8pt; + font-weight: bold; + text-decoration: none; + color: black; + } + + a.sidelink:hover { + color: red; + text-decoration: none; + } + table.banner { border: 1px solid black; *************** *** 140,143 **** --- 152,163 ---- } + div.sectiontitle { + border: 1px solid gray; + margin: 0; + padding: 5px; + background-color: rgb(235, 235, 235); + } + + div.search { border: 1px solid gray; *************** *** 218,243 **** } ! font.greenbox { ! font-family: mono; padding: 1px; ! border: 1px solid #000000; ! background-color: #00FF00; ! font-size: 7pt; } ! font.redbox { ! font-family: mono; padding: 1px; ! border: 1px solid #000000; ! background-color: #FF0000; ! font-size: 7pt; } ! font.cyanbox { ! font-family: mono; padding: 1px; ! border: 1px solid #000000; background-color: #44DDFF; font-size: 7pt; } --- 238,304 ---- } ! table.rlsmap { ! padding: 0px; ! margin: 0px; ! text-align: center; ! } ! ! td.greenbox { padding: 1px; ! border: 1px outset; ! background-color: #008000; ! color: #FFFFFF; ! font-size: 5pt; } ! td.redbox { padding: 1px; ! border: 1px outset; ! background-color: #800000; ! color: #FFFFFF; ! font-size: 5pt; } ! td.cyanbox { padding: 1px; ! border: 1px outset; background-color: #44DDFF; + color: #000000; + font-size: 5pt; + } + + td.greenbar { + width: 1px; + height: 8px; + border: 1px outset; + background-color: #008000; + color: #FFFFFF; + font-size: 5pt; + } + + td.redbar { + width: 1px; + height: 8px; + border: 1px outset; + background-color: #800000; + color: #FFFFFF; + font-size: 5pt; + } + + td.cyanbar { + width: 1px; + height: 8px; + border: 1px outset; + background-color: #44DDFF; + color: #000000; + font-size: 5pt; + } + + + div.rlsmap { + padding: 2px; + background-color: #DDDDDD; font-size: 7pt; + font-weight: bold; } Index: release.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/release.rhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** release.rhtml 20 Feb 2004 16:44:40 -0000 1.3 --- release.rhtml 21 Feb 2004 15:58:34 -0000 1.4 *************** *** 46,51 **** <body> - <a href="queue.rhtml?group=<%= web.group._fullname %>">return to queue list</a> - <% rls = ReleaseArticles.new(web.group._groupindex, web.rlsartind, web.date) %> --- 46,49 ---- *************** *** 84,102 **** <a name="artlist"></a> ! <div class="group">Articles list</div> ! <table class='articles'> ! <tr class='headers'> ! <th>Date/Size</th><th>Subject</th> </tr> <% rls.articles.each { |art| %> ! <tr> ! <td><i><%= NgetSuite::Utils.pretty_date(art["time"]) %></i><br> ! <b><%= NgetSuite::Utils.pretty_size(art["size"]) %><b></td> ! <td><%= art["subject"] %></td> ! </tr> ! <tr> ! <td class="linesep" colspan="2"></td> </tr> <% } %> --- 82,97 ---- <a name="artlist"></a> ! <div class="sectiontitle">Articles list</div> ! <table class="articles"> ! <tr class="headers"> ! <th>Date</th><th>Subject</th><th>Size</th> </tr> <% rls.articles.each { |art| %> ! <tr class="article"> ! <td class="time"><%= NgetSuite::Utils.pretty_date(art["time"]) %></td> ! <td class="subject"><%= art["subject"] %></td> ! <td class="size"><%= NgetSuite::Utils.pretty_size(art["size"]) %></td> </tr> <% } %> Index: top.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/top.rhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** top.rhtml 9 Nov 2003 01:25:33 -0000 1.1 --- top.rhtml 21 Feb 2004 15:58:34 -0000 1.2 *************** *** 10,13 **** --- 10,41 ---- #web.update_queue + if web.group then + leftlinks = [["summary", "grouphome.rhtml?group=#{web.group._fullname}"], + ["nfos", "nfolist.rhtml?group=#{web.group._fullname}"], + ["log", "log.rhtml?group=#{web.group._fullname}"]] + rightlinks = [["queue", "queueview.rhtml?group=#{web.group._fullname}"], + ["search", "search.rhtml?group=#{web.group._fullname}"]] + else + leftlinks = [["welcome", "welcome.rhtml"], + ["log", "log.rhtml"]] + rightlinks = [["queue", "queueview.rhtml"], + ["search", "search.rhtml"]] + end + + class GroupDates + def initialize(groupindex) + datesq = "select DATE_FORMAT(`time`,'%Y-%m-%d') as isodate, DATE_FORMAT(`time`, '%d/%m') from `articles` where `groupindex`='#{groupindex}' group by isodate order by isodate desc" + @sth = NgetSuite::Db.dbh.execute datesq + end + + def each + return unless @sth + @sth.fetch { |row| + yield row[0], row[1] + } + end + end + + %> <?xml version="1.0" encoding="ISO-8859-1"?> *************** *** 22,31 **** <table class="banner" width="100%" height="58" cellspacing="0" cellpadding="0"> <tr> ! <td width="100%" height="58" valign="top" align="center"> <table> <tr> <% NgetSuite::GroupList.new("order by `shortname`").each { |group| %> ! <td class="<%= (servlet_request.query["group"] == group._fullname) ? "grouptabsel" : "grouptab" %>"><a href="index.rhtml?group=<%= group._fullname %>" target="_top"><%= group._shortname %></a> ! <% } %> </td> </tr> --- 50,83 ---- <table class="banner" width="100%" height="58" cellspacing="0" cellpadding="0"> <tr> ! <td width="150" height="58" rowspan="2" align="left"> ! <% leftlinks.each { |link| %> ! <a class="sidelink" href="<%= link[1] %>" target="left"><%= link[0] %></a><br> ! <% } %> ! </td> ! <td width="100%" height="29" align="center"> <table> <tr> <% NgetSuite::GroupList.new("order by `shortname`").each { |group| %> ! <td class="<%= (servlet_request.query["group"] == group._fullname) ? "grouptabsel" : "grouptab" %>"><a href="index.rhtml?group=<%= group._fullname %>" target="_top"><%= group._shortname %></a></td> ! <% } %> ! </tr> ! </table> ! </td> ! <td width="150" height="58" rowspan="2" align="right"> ! <% rightlinks.each { |link| %> ! <a class="sidelink" href="<%= link[1] %>" target="right"><%= link[0] %></a><br> ! <% } %> ! </td> ! </tr> ! <tr> ! <td width="100%" height="27" align="center"> ! <% if web.group ! dates = GroupDates.new(web.group._groupindex) ! ! dates.each { |iso,display| %> ! <a href="group.rhtml?group=<%= web.group._fullname %>&date=<%=iso%>" target="left"><%=display%></a> | ! <% } %> ! <a href="group.rhtml?group=<%= web.group._fullname %>&date=any">any</a> ! <% end %> </td> </tr> |