Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 6441870

Browse files
VittaVitta
Vitta
authored and
Vitta
committed
Active Bug Race Page Revamp
1 parent 2cb50bb commit 6441870

File tree

7 files changed

+247
-4
lines changed

7 files changed

+247
-4
lines changed

resources/DBMS.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ TRUVEO_DATASOURCE_NAME = java:JTS_TRUVEO_OLTP
2222
AOLICQ_DATASOURCE_NAME = java:JTS_AOLICQ_OLTP
2323
WINFORMULA_DATASOURCE_NAME = java:JTS_WINFORMULA_OLTP
2424
CSF_DATASOURCE_NAME = java:JTS_CSF_OLTP
25-
25+
JIRA_MYSQL_DATASOURCE_NAME = java:BUGS
2626

2727
CONTEST_ADMIN_DATASOURCE = java:OLTP
2828

resources/TC.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ view_competition_history_page = /compstats/competition_history.jsp
4242
view_current_projects_page = /compstats/outstanding_projects.jsp
4343
download_submission = /compstats/download_submission.jsp
4444
download_submission_terms = /compstats/download_submission_terms.jsp
45+
active_bugrace_competitions = /bugrace/activeContests.jsp
4546

4647
view_algo_competition_history_page = /statistics/competitionHistory.jsp
4748
view_payment_summary_page = /statistics/payment_summary.jsp
@@ -135,6 +136,7 @@ ActiveContests = contest.ActiveContests
135136
ViewActiveContests = development.ViewActiveContests
136137
ViewAssemblyActiveContests = development.assembly.ViewActiveContests
137138
ViewRegistrants = development.ViewRegistrants
139+
ViewActiveBugRaces = bugrace.ViewActiveBugRaces
138140
Register = contest.Register
139141
AssemblyProjectRegister = contest.Register
140142
ArchitectureProjectRegister = contest.Register
@@ -707,4 +709,4 @@ elec_agreeable_terms_type_id = 3
707709

708710
BadgeAdminHome=badge.BadgeAdminHome
709711
BadgeAdminTool=badge.BadgeAdminTool
710-
BadgeAdminEdit=badge.BadgeAdminEdit
712+
BadgeAdminEdit=badge.BadgeAdminEdit

src/main/com/topcoder/web/distui/view/leftNav.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
nav.search("m_bugraces_competitions").addChild(new NavNode("http://apps.topcoder.com/wiki/display/tc/Bug+Race+Competition+Overview", "Overview", "bugraces_overview"));
194194
nav.search("m_bugraces_competitions").addChild(new NavNode("javascript:void(0)", "Javascript:toggleMenu(this.parentNode,'m_bugraces_support')", "Track Information", "m_bugraces_support"));
195195
nav.search("m_bugraces_support").addChild(new NavNode("http://apps.topcoder.com/wiki/display/tc/How+to+Compete+in+Bug+Race+Competitions", "How to Compete", "bugraces_how_to_compete"));
196-
nav.search("m_bugraces_competitions").addChild(new NavNode("http://apps.topcoder.com/wiki/display/tc/Active+Bug+Race+Competitions", "Active Contests", "bugraces_compete"));
196+
nav.search("m_bugraces_competitions").addChild(new NavNode("http://"+ApplicationServer.SERVER_NAME+"/tc?module=ViewActiveBugRaces", "Active Contests", "bugraces_compete"));
197197
nav.search("m_bugraces_competitions").addChild(new NavNode("http://apps.topcoder.com/wiki/x/FQG2AQ", "Review Opportunities", "bugraces_review"));
198198
nav.search("competition_qa").addChild(new NavNode("javascript:void(0)", "Javascript:toggleMenu(this.parentNode,'m_bughunt_competitions')", "Bug Hunt", "m_bughunt_competitions"));
199199
nav.search("m_bughunt_competitions").addChild(new NavNode("http://apps.topcoder.com/wiki/x/W5ogAg", "Overview", "bughunt_overview"));

src/main/com/topcoder/web/query/common/Constants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ public static void init(ServletConfig servletConfig) {
181181
DB_LIST.add(new DatabaseBean(DBMS.AOLICQ_DATASOURCE_NAME, "Aolicq - Openxtraz"));
182182
DB_LIST.add(new DatabaseBean(DBMS.WINFORMULA_DATASOURCE_NAME, "Winning Formula"));
183183
DB_LIST.add(new DatabaseBean("java:/PIPELINE", "Pipeline"));
184-
DB_LIST.add(new DatabaseBean("java:/BUGS", "Jira"));
184+
DB_LIST.add(new DatabaseBean("java:/BUGS", "Jira"));
185+
DB_LIST.add(new DatabaseBean(DBMS.JIRA_MYSQL_DATASOURCE_NAME, "Jira MySQL"));
185186
/*
186187
DB_LIST.add(new DatabaseBean("java:/GOOGLE_OLTP", "Google"));
187188
DB_LIST.add(new DatabaseBean("java:/GOOGLE_DW", "Google DW"));

src/main/com/topcoder/web/tc/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ public class Constants implements WebConstants {
299299
public static String DOWNLOAD_SUBMISSION;
300300
public static String DOWNLOAD_SUBMISSION_TERMS;
301301

302+
public static String ACTIVE_BUGRACE_COMPETITIONS;
303+
302304
/**
303305
* Represents the jsp page for request processor view copilot pool.
304306
*/
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright (C) 2012 TopCoder Inc., All Rights Reserved.
3+
*/
4+
5+
package com.topcoder.web.tc.controller.request.bugrace;
6+
7+
import com.topcoder.shared.dataAccess.DataAccessConstants;
8+
import com.topcoder.shared.dataAccess.DataAccessInt;
9+
import com.topcoder.shared.dataAccess.Request;
10+
import com.topcoder.shared.dataAccess.resultSet.ResultSetContainer;
11+
import com.topcoder.shared.dataAccess.resultSet.ResultSetContainer.ResultSetRow;
12+
import com.topcoder.shared.util.ApplicationServer;
13+
import com.topcoder.shared.util.DBMS;
14+
import com.topcoder.shared.util.TCResourceBundle;
15+
import com.topcoder.web.common.model.SortInfo;
16+
import com.topcoder.web.common.StringUtils;
17+
import com.topcoder.web.ejb.email.Email;
18+
import com.topcoder.web.tc.Constants;
19+
import com.topcoder.web.tc.controller.request.Static;
20+
21+
import java.io.PrintWriter;
22+
import java.util.Map;
23+
import java.util.MissingResourceException;
24+
import java.util.HashMap;
25+
import java.util.Iterator;
26+
27+
/**
28+
* <p>
29+
* This class is used to retrieve active bug races.
30+
* </p>
31+
*
32+
* @author TrePe
33+
* @version 1.0
34+
*/
35+
public class ViewActiveBugRaces extends Static {
36+
37+
/**
38+
* <p>
39+
* Processes the request, fills data and gives control to jsp.
40+
* </p>
41+
*/
42+
protected void businessProcessing() throws Exception {
43+
// Gets sort parameters.
44+
String sortDir = StringUtils.checkNull(getRequest().getParameter(DataAccessConstants.SORT_DIRECTION));
45+
String sortCol = StringUtils.checkNull(getRequest().getParameter(DataAccessConstants.SORT_COLUMN));
46+
47+
setDefault(DataAccessConstants.SORT_DIRECTION, getRequest().getParameter(DataAccessConstants.SORT_DIRECTION));
48+
setDefault(DataAccessConstants.SORT_COLUMN, getRequest().getParameter(DataAccessConstants.SORT_COLUMN));
49+
50+
Request dataRequest = new Request();
51+
dataRequest.setContentHandle("active_bugraces");
52+
if (!sortCol.equals("") && !sortDir.equals("")) {
53+
dataRequest.setProperty(DataAccessConstants.SORT_DIRECTION, sortDir);
54+
dataRequest.setProperty(DataAccessConstants.SORT_COLUMN, sortCol);
55+
}
56+
dataRequest.setProperty(DataAccessConstants.SORT_QUERY, "active_bugraces");
57+
58+
// defines column's default sort.
59+
SortInfo s = new SortInfo();
60+
s.addDefault(1, "asc"); // Contest
61+
s.addDefault(2, "desc"); // Payment
62+
s.addDefault(3, "desc"); // TCO Points
63+
s.addDefault(4, "asc"); // Registrants
64+
s.addDefault(5, "desc"); // Active Since
65+
getRequest().setAttribute(SortInfo.REQUEST_KEY, s);
66+
67+
DataAccessInt dai = getDataAccess(DBMS.JIRA_MYSQL_DATASOURCE_NAME, true);
68+
Map result = dai.getData(dataRequest);
69+
70+
ResultSetContainer rsc = (ResultSetContainer) result.get(dataRequest.getContentHandle());
71+
getRequest().setAttribute("contests", rsc);
72+
73+
setNextPage(Constants.ACTIVE_BUGRACE_COMPETITIONS);
74+
setIsNextPageInContext(true);
75+
76+
}
77+
}
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
<%--
2+
- Author: TrePe
3+
- Version: 1.0
4+
- Copyright (C) 2012 TopCoder Inc., All Rights Reserved.
5+
-
6+
- Description: This page lists active bug races.
7+
-
8+
--%>
9+
<%@ page language="java" %>
10+
<%@ page import="com.topcoder.shared.dataAccess.resultSet.ResultSetContainer" %>
11+
<%@ page import="com.topcoder.shared.util.ApplicationServer" %>
12+
<%@ page import="com.topcoder.web.tc.Constants" %>
13+
<%@ page import="java.util.Map"%>
14+
<%@ taglib uri="rsc-taglib.tld" prefix="rsc" %>
15+
<%@ taglib uri="tc.tld" prefix="tc" %>
16+
<%@ taglib uri="tc-webtags.tld" prefix="tc-webtag" %>
17+
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
18+
<% ResultSetContainer contests = (ResultSetContainer) request.getAttribute("contests");%>
19+
20+
<%@ page contentType="text/html;charset=utf-8" %>
21+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
22+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
24+
25+
<jsp:useBean id="sessionInfo" scope="request" class="com.topcoder.web.common.SessionInfo"/>
26+
<head>
27+
<title>TopCoder :: Active Bug Races</title>
28+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
29+
<link type="image/x-icon" rel="shortcut icon" href="/i/favicon.ico"/>
30+
<jsp:include page="../script.jsp"/>
31+
<jsp:include page="../style.jsp">
32+
<jsp:param name="key" value="tc_stats"/>
33+
</jsp:include>
34+
</head>
35+
36+
<body>
37+
38+
<jsp:include page="../top.jsp" />
39+
40+
<table width="100%" border="0" cellpadding="0" cellspacing="0">
41+
<tbody>
42+
<tr valign="top">
43+
<%-- Left Column Begins--%>
44+
<td width="180">
45+
<jsp:include page="/includes/global_left.jsp">
46+
<jsp:param name="node" value="bugraces_compete"/>
47+
</jsp:include>
48+
</td>
49+
<%-- Left Column Ends --%>
50+
51+
<%-- Center Column Begins --%>
52+
<td width="100%" align="left" class="bodyColumn">
53+
54+
<jsp:include page="/page_title.jsp">
55+
<jsp:param name="image" value="bugrace"/>
56+
<jsp:param name="title" value="Active Contests"/>
57+
</jsp:include>
58+
59+
<table cellpadding="0" cellspacing="0" border="0" width="100%">
60+
<tr>
61+
<td width="100%" height="23px">&nbsp;</td>
62+
<td align="right">
63+
<a href="http://apps.topcoder.com/wiki/display/tc/How+to+Compete+in+Bug+Race+Competitions"><img src="/i/development/get_started.gif" alt="Getting Started" border="0"/></a><br /><br />
64+
</td>
65+
</tr>
66+
</table>
67+
68+
<div align="center">
69+
<a href="http://community.topcoder.com/tco12/overview-sponsor/two-sigma/"><img src="/i/tournament/tco12/Two_Sigma_Sponsor_Banner_510x114.jpg" alt="Two Sigma - TCO12 Sponsor" /></a><br /><br />
70+
</div>
71+
72+
<p>Click on an issue to view its details. If you would like to work on an issue, first view the details and then click "Vote". Voting will be equivalent to registering to work on the issue. Read the <a href="/wiki/display/tc/Bug+Race+Competition+Overview" title="Bug Race Competition Overview">full instructions</a> on how to compete.</p>
73+
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="http://apps.topcoder.com/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>New Opportunities</b><br />
74+
<p>Interested in reviewing submissions to Bug Race Competitions, performing environment setups, managing source control merges for submissions, etc?&nbsp; Click <a href="/wiki/display/tc/Bug+Race+Competition+Reviews" title="Bug Race Competition Reviews">here</a> to see the available tasks.</p></td></tr></table></div>
75+
<p><font color="#ff0000">Your ability to participate in these competitions is conditioned upon your agreement to the TopCoder&nbsp;</font><a href="/wiki/display/tc/Bug+Race+Competitions+Terms+of+Work" title="Bug Race Competitions Terms of Work">Terms of Work</a>.</p>
76+
<p>&#95;Note: Issues that are marked "In Progress" have already received one or more submissions which are currently being verified by TopCoder. Issues that are marked "Open" have not yet received a passing submission. If a submission does not fix the issue, or is too low in quality,<br/>
77+
TopCoder will restore the issue to the "Open" status.&#95;</p>
78+
79+
<div align="right">
80+
Competition opportunities via RSS -
81+
<a href="/tc?module=BasicRSS&amp;c=rss_Active_Bug_Races&amp;dsid=34">Subscribe Now</a>
82+
<a href="/tc?module=BasicRSS&amp;c=rss_Active_Bug_Races&amp;dsid=34"><img src="/i/interface/emblem/rss.gif" alt="RSS" style="vertical-align:middle;"/></a>
83+
<br /><br />
84+
</div>
85+
86+
<table class="stat" cellpadding="0" cellspacing="0" width="100%">
87+
<tr>
88+
<td class="title" colspan="7">Active Bug Race Competitions</td>
89+
</tr>
90+
<tr>
91+
<td class="header" width="30%"><a href="<%=sessionInfo.getServletPath()%>?<tc-webtag:sort column="1" includeParams="true"/>">Contest</a></td>
92+
<td class="header" width="10%">&#160;</td>
93+
<td class="header" width="10%">&#160;</td>
94+
<td class="headerC" width="10%"><a href="<%=sessionInfo.getServletPath()%>?<tc-webtag:sort column="2" includeParams="true"/>">Payment</a></td>
95+
<td class="headerC" width="10%"><a href="<%=sessionInfo.getServletPath()%>?<tc-webtag:sort column="3" includeParams="true"/>">TCO Points</a></td>
96+
<td class="headerC" width="10%">
97+
<a href="<%=sessionInfo.getServletPath()%>?<tc-webtag:sort column="4" includeParams="true"/>">Registrants</a><br />
98+
</td>
99+
<td class="headerC" width="20%"><a href="<%=sessionInfo.getServletPath()%>?<tc-webtag:sort column="5" includeParams="true"/>">Active Since</a></td>
100+
</tr>
101+
102+
<% boolean even = false; %>
103+
<rsc:iterator list="<%=contests %>" id="resultRow">
104+
<tr class="<%=even?"dark":"light"%>">
105+
<td class="value">
106+
<a href="https://apps.topcoder.com/bugs/browse/<%=resultRow.getStringItem("ticket_id")%>">
107+
<rsc:item name="contest" row="<%=resultRow%>"/>
108+
</a>
109+
</td>
110+
<td class="value">
111+
<% if (resultRow.getIntItem("tco_points") > 0) { %>
112+
<div align="center">
113+
<a href='http://community.topcoder.com/tco13'><img class="emblem" src="/i/tournament/tco13/software_tco13_icon.png" alt="" border="0" onMouseOver="postPopUpText('globalPopupText','Eligible for the TopCoder Open'); popUp(this,'globalPopup');" onMouseOut="popHide()" /></a>
114+
</div>
115+
<% } else { %>
116+
&nbsp;
117+
<% } %>
118+
</td>
119+
<td class="value">
120+
&nbsp;
121+
</td>
122+
<td class="valueC">
123+
<rsc:item name="payment" row="<%=resultRow%>" format="$###,##0.0"/>
124+
</td>
125+
<td class="valueC">
126+
<rsc:item name="tco_points" row="<%=resultRow%>" format="######"/>
127+
</td>
128+
<td class="valueC">
129+
<rsc:item name="registrants" row="<%=resultRow%>"/>
130+
</td>
131+
<td class="valueC" nowrap="nowrap">
132+
<rsc:item name="active_since" row="<%=resultRow%>" format="MM.dd.yyyy'<br />'HH:mm z"/>
133+
</td>
134+
</tr>
135+
<% even = !even;%>
136+
</rsc:iterator>
137+
</table>
138+
<div align="right" style="padding-top: 10px">
139+
Stay informed with our <a href="/wiki/display/tc/Upcoming+Contests">Upcoming Contests page</a> or subscribe to the RSS feed
140+
<a href="/tc?module=BasicRSS&amp;c=rss_Pipeline&amp;dsid=28"><img src="/i/interface/emblem/rss.gif" alt="RSS" style="vertical-align:middle;"/></a>
141+
</div>
142+
</td>
143+
<%-- Center Column Ends --%>
144+
145+
<%-- Right Column Begins --%>
146+
<td width="170">
147+
<jsp:include page="../public_right.jsp">
148+
<jsp:param name="level1" value="branded"/>
149+
</jsp:include>
150+
</td>
151+
<%-- Right Column Ends --%>
152+
153+
</tr>
154+
</tbody>
155+
</table>
156+
157+
<jsp:include page="../foot.jsp"/>
158+
159+
</body>
160+
161+
</html>

0 commit comments

Comments
 (0)