1+ <link rel =" stylesheet" href =" https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" >
2+ <script src =" https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" ></script >
3+ <script src =" https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js" ></script >
4+ <script async src =" https://www.googletagmanager.com/gtag/js?id=UA-143874982-1" ></script >
5+ <script async defer src =" https://buttons.github.io/buttons.js" ></script >
6+ <script data-ad-client =" ca-pub-5213877146531950" async src =" https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" ></script >
7+ <div class =" container" >
8+ <h1 class =" mb-5 mt-3" style =" text-align : center ;" >Ranking For <%= contests[0 ]._id %> </h1 >
9+ <nav aria-label =" ..." >
10+ <ul class =" pagination" >
11+ <% if (page> 1 ) { % >
12+ < li class = " page-item" >
13+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page - 1 %>" tabindex= " -1" > << < / a>
14+ < / li>
15+ < li class = " page-item" >< a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/1" > 1 < / a>< / li>
16+
17+ < % } %>
18+ <% if (page=== 3 ) { % >
19+
20+ < li class = " page-item" >
21+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page - 1 %>" tabindex= " -1" >< %= page - 1 % >< / a>
22+ < / li>
23+
24+
25+ < % } %>
26+ <% if (page> 3 ) { % >
27+ < li class = " page-item" >
28+ < a class = " page-link" style= " pointer-events: none;" tabindex= " -1" > ..< / a>
29+ < / li>
30+ < li class = " page-item" >
31+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page - 2 %>" tabindex= " -1" >< %= page - 2 % >< / a>
32+ < / li>
33+ < li class = " page-item" >
34+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page - 1 %>" tabindex= " -1" >< %= page - 1 % >< / a>
35+ < / li>
36+
37+
38+ < % } %>
39+ <li class =" page-item active" >
40+ <a class =" page-link" href =" /contests/<%= contests[0]._id %>/ranking/<%= page%>" ><%= page %> <span class =" sr-only" >(current)</span ></a >
41+ </li >
42+ <% if (page=== totalPages- 2 ) { % >
43+ < li class = " page-item" >
44+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= parseInt(page) + 1 %>" tabindex= " -1" >< %= parseInt (page) + 1 % >< / a>
45+ < / li>
46+ < % } %>
47+ <% if (page< totalPages- 2 ) { % >
48+ < li class = " page-item" >
49+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= parseInt(page) + 1 %>" tabindex= " -1" >< %= parseInt (page) + 1 % >< / a>
50+ < / li>
51+ < li class = " page-item" >
52+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= parseInt(page) + 2 %>" tabindex= " -1" >< %= parseInt (page) + 2 % >< / a>
53+ < / li>
54+ < li class = " page-item" >
55+ < a class = " page-link" style= " pointer-events: none;" tabindex= " -1" > ..< / a>
56+ < / li>
57+ < % } %>
58+ <% if (page< totalPages) { % >
59+
60+ < li class = " page-item" >< a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= totalPages %> " >< %= totalPages % > < / a>< / li>
61+ < li class = " page-item" >
62+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page + 1 %>" tabindex= " -1" >>> < / a>
63+ < / li>
64+ < % } %>
65+
66+ </ul >
67+ </nav >
68+ <form action =" /contests/<%= contests[0]._id %>/ranking/search" method =' POST' >
69+ <div class =" mb-3" >
70+ <input type =" text" class =" form-control" id =" user" name =" user" placeholder =" Search For a Contestant" >
71+ <button type =" submit" class =" btn btn-info mt-3 mb-3" >Search</button >
72+ </div >
73+ </form >
74+ <div class =" table-responsive" >
75+ <table class =" table table-hover table-striped table-fixed" >
76+ <thead >
77+ <tr >
78+ <th >#</th >
79+ <th >Rank</th >
80+ <th >Name</th >
81+ <th >Current Rating</th >
82+ <th >Predicted Rating</th >
83+ <th >Country Name</th >
84+ </tr >
85+ </thead >
86+ <tbody >
87+ <% if (contests[0 ].rankings ) { % >
88+ < % for ( let i = 0 ; i < contests[0 ].rankings .length ; i++ ) { % >
89+ < tr>
90+ < td>< %= i+ 1 % > < / td>
91+ < td>< %= contests[0 ].rankings [i].rank % > < / td>
92+ < td>< a href= " https://leetcode.com/<%=contests[0].rankings[i]._id%>/" >< %= contests[0 ].rankings [i]._id % > < / a>< / td>
93+ < % if ( contests[0 ].rankings [i].current_rating != - 1 ) { % >
94+ < td>< %= contests[0 ].rankings [i].current_rating % > < / td>
95+ < % } else { % >
96+ < td> ? < / td>
97+ < % } % >
98+ < % if ( contests[0 ].rankings [i].predicted_rating != - 1 ) { % >
99+ < td>< %= contests[0 ].rankings [i].predicted_rating % > < / td>
100+ < % } else { % >
101+ < td> ? < / td>
102+ < % } % >
103+
104+ < td>< %= contests[0 ].rankings [i].country_name % > < / td>
105+ < / tr>
106+ < % } % >
107+ < % } % >
108+
109+ < / tbody>
110+ < / table>
111+ < nav aria- label= " ..." >
112+ < ul class = " pagination" >
113+ < % if (page> 1 ) { % >
114+ < li class = " page-item" >
115+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page - 1 %>" tabindex= " -1" > << < / a>
116+ < / li>
117+ < li class = " page-item" >< a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/1" > 1 < / a>< / li>
118+
119+ < % } % >
120+ < % if (page=== 3 ) { % >
121+
122+ < li class = " page-item" >
123+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page - 1 %>" tabindex= " -1" >< %= page - 1 % >< / a>
124+ < / li>
125+
126+
127+ < % } % >
128+ < % if (page> 3 ) { % >
129+ < li class = " page-item" >
130+ < a class = " page-link" style= " pointer-events: none;" tabindex= " -1" > ..< / a>
131+ < / li>
132+ < li class = " page-item" >
133+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page - 2 %>" tabindex= " -1" >< %= page - 2 % >< / a>
134+ < / li>
135+ < li class = " page-item" >
136+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page - 1 %>" tabindex= " -1" >< %= page - 1 % >< / a>
137+ < / li>
138+
139+
140+ < % } % >
141+ < li class = " page-item active" >
142+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page%>" >< %= page % > < span class = " sr-only" > (current)< / span>< / a>
143+ < / li>
144+ < % if (page=== totalPages- 2 ) { % >
145+ < li class = " page-item" >
146+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= parseInt(page) + 1 %>" tabindex= " -1" >< %= parseInt (page) + 1 % >< / a>
147+ < / li>
148+ < % } % >
149+ < % if (page< totalPages- 2 ) { % >
150+ < li class = " page-item" >
151+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= parseInt(page) + 1 %>" tabindex= " -1" >< %= parseInt (page) + 1 % >< / a>
152+ < / li>
153+ < li class = " page-item" >
154+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= parseInt(page) + 2 %>" tabindex= " -1" >< %= parseInt (page) + 2 % >< / a>
155+ < / li>
156+ < li class = " page-item" >
157+ < a class = " page-link" style= " pointer-events: none;" tabindex= " -1" > ..< / a>
158+ < / li>
159+ < % } % >
160+ < % if (page< totalPages) { % >
161+
162+ < li class = " page-item" >< a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= totalPages %> " >< %= totalPages % > < / a>< / li>
163+ < li class = " page-item" >
164+ < a class = " page-link" href= " /contests/<%= contests[0]._id %>/ranking/<%= page + 1 %>" tabindex= " -1" >>> < / a>
165+ < / li>
166+ < % } % >
167+
168+ < / ul>
169+ < / nav>
170+
171+ < / div>
172+ < / div>
0 commit comments