Skip to content

Commit

Permalink
ess enabling and icon centering (#549)
Browse files Browse the repository at this point in the history
* inclusion of usabo questions in the homepage stats

* hour refactoring during reviewing transfer fix

* reviewer role created

* contributor stats fix

* admin optimization and search direct to question feature

* references update

* contributor stats fix

* moved grace up on about page

* usabo frontend reroutes and fixes

* prelim questions equations/constants

* comment

* Fix equations + constants in question page

* references fix

* equations and constants on display question

* fix no reviewers problem

* add usabo to nav bar

* icon centering and ess enabling

---------

Co-authored-by: Patrick Feng <[email protected]>
Co-authored-by: William Y. Feng <[email protected]>
  • Loading branch information
3 people authored Oct 1, 2023
1 parent 0f7b553 commit 4ca5292
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion routes/train.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = (app, mongo) => {
{ username: req.user.username },
{ $set: { rating: req.user.rating } }
);
res.redirect('/' /* + req.body.subject + '/chooseUnits'*/);
res.redirect('/homepage' /* + req.body.subject + '/chooseUnits'*/);
});

app.post('/selQ', (req, res, next) => {
Expand Down
26 changes: 22 additions & 4 deletions views/private/homepage.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@
borderColor: "rgba(40, 240, 110, 1)",
fill: false,
borderWidth: 5
}, /*{
}, {
label: "ESS",
data: ratingData["ESS"],
backgroundColor: "rgba(184, 150, 191, 1)",
borderColor: "rgba(184, 150, 191, 1)",
fill: false,
borderWidth: 5
},*/ {
}, {
label: "USABO",
data: ratingData["USABO"],
backgroundColor: "rgba(113, 16, 1, 1)",
Expand Down Expand Up @@ -210,7 +210,14 @@
No rating
<% } %>
</span></h1>
<!-- <h1 class="display-5 text-center">ESS: <span class="badge rounded-pill bg-primary"><%= Math.max(user.rating.ess, 0) %></span></h1> -->

<h1 class="display-5 text-center">ESS: <span class="badge rounded-pill bg-primary">
<% if (user.rating.ess > 0) { %>
<%= Math.max(user.rating.ess, 0) %>
<% } else { %>
No rating
<% } %>
</span></h1>

<h1 class="display-5 text-center mt-4">USABO: <span class="badge rounded-pill bg-primary">
<% if (user.rating.usabo > 0) { %>
Expand Down Expand Up @@ -257,12 +264,23 @@
<a href="/train/Biology/chooseUnits" class="classic-subject-button" id="Biology"><img id="bio-icon" class="thumbnail mu-rounded" src="https://cdn.mutorials.org/images/icons/Bio_Main.svg" alt="Bio icon"></a>
</div>
</div>

<h1 class="text-center mt-5" id="classic-subjects-text"></h1>
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<a href="/train/ESS/chooseUnits" class="classic-subject-button" id="ESS"><img id="ESS-icon" class="thumbnail mu-rounded img-fluid" src="https://mutorials.blob.core.windows.net/images/icons/ess icon.jpeg" alt="ESS icon"></a>
</div>
<div class="col-4"></div>
</div>

<h1 class="text-center mt-5" id="classic-subjects-text">Train for USABO!</h1>
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<a href="/usaboHomepage" class="USABO-button" id="USABO"><img id="USABO-icon" class="thumbnail mu-rounded center" src="https://cdn.mutorials.org/images/icons/USABO_Main.png" alt="USABO icon"></a>
<a href="/usaboHomepage" class="USABO-button" id="USABO"><img id="USABO-icon" class="thumbnail mu-rounded img-fluid" src="https://cdn.mutorials.org/images/icons/USABO_Main.png" alt="USABO icon"></a>
</div>
<div class="col-4"></div>
</div>

<a class="btn btn-primary w-100 btn-lg mt-5" href="/train">Train Now!</a>
Expand Down
6 changes: 3 additions & 3 deletions views/private/stats.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
// render rating tracker charts
["Physics", "Chemistry", "Biology", /*"ESS", */"USABO"].forEach((subject) => {
["Physics", "Chemistry", "Biology", "ESS", "USABO"].forEach((subject) => {
var ctxTracker = document.getElementById("ratingTrackerChart-" + subject);
Expand Down Expand Up @@ -432,7 +432,7 @@
<a href="/train/biology/proficiency" class="btn btn-primary w-100 btn-lg mt-4">Change Biology Proficiency</a>
</div>

<!--<div class="container jumbotron mb-5">
<div class="container jumbotron mb-5">

<div class="row">

Expand Down Expand Up @@ -510,7 +510,7 @@

</div>
<a href="/train/ess/proficiency" class="btn btn-primary w-100 btn-lg mt-4">Change ESS Proficiency</a>
</div>-->
</div>

<div class="container jumbotron mb-5">

Expand Down
5 changes: 2 additions & 3 deletions views/private/train/chooseSubject.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@
</div>
<div class="col-12 col-lg-4">
<div class="card" style="width: 18rem;">
<!-- <img class="card-img-top" src="https://cdn.mutorials.org/images/icons/USABO_Main.png" alt="USABO Icon"> -->
<img class="card-img-top" src="https://mutorials.blob.core.windows.net/images/icons/ess icon.jpeg" alt="USABO Icon">
<div class="card-body text-center">
<h5 class="card-title">ESS</h5>
<p class="card-text">Coming Soon!</p>
<!--<a href="/train/ESS/chooseUnits" class="btn btn-primary">Train Now!</a>-->
<a href="/train/ESS/chooseUnits" class="btn btn-primary">Train Now!</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 4ca5292

Please sign in to comment.