Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"lint": "vue-cli-service lint",
"serve:prod": "vue-cli-service serve --mode production"
},
"dependencies": {
"axios": "^0.19.0",
Expand All @@ -14,6 +15,7 @@
"serialize-javascript": "^2.1.2",
"vue": "^2.6.10",
"vue-codemirror": "^4.0.6",
"vue-highlightjs": "^1.3.3",
"vue-marquee-text-component": "^1.1.1",
"vue-moment": "^4.1.0",
"vue-router": "^3.1.3",
Expand All @@ -37,7 +39,7 @@
"sass": "^1.19.0",
"sass-loader": "^8.0.0",
"vue-cli-plugin-codemirror": "^0.0.6",
"vue-cli-plugin-vuetify": "^2.0.2",
"vue-cli-plugin-vuetify": "^2.0.3",
"vue-template-compiler": "^2.6.10",
"vuetify-loader": "^1.3.0"
},
Expand Down
91 changes: 62 additions & 29 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,78 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Barlow:400,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link
href="https://fonts.googleapis.com/css?family=Barlow:400,700&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"
/>
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png" />
<link
rel="apple-touch-icon"
sizes="114x114"
href="/apple-icon-114x114.png"
/>
<link
rel="apple-touch-icon"
sizes="120x120"
href="/apple-icon-120x120.png"
/>
<link
rel="apple-touch-icon"
sizes="144x144"
href="/apple-icon-144x144.png"
/>
<link
rel="apple-touch-icon"
sizes="152x152"
href="/apple-icon-152x152.png"
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-icon-180x180.png"
/>
<link
rel="icon"
type="image/png"
sizes="192x192"
href="/android-icon-192x192.png"
/>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/manifest.json" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png" />
<meta name="theme-color" content="#ffffff" />
<title>CodeWizardsHQ CODE CHALLENGE</title>
</head>

<body>
<noscript>
<strong>We're sorry but vue_app doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
<strong
>We're sorry but vue_app doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->

<script>
if (location.hostname != "localhost" && location.protocol != 'https:') {
location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
if (location.hostname != "localhost" && location.protocol != "https:") {
location.href =
"https:" +
window.location.href.substring(window.location.protocol.length);
}
</script>
</body>

</html>
</html>
28 changes: 2 additions & 26 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
<template>
<v-app>
<CWHQ-bar />
<app-bar />
<quiz-bar />
<v-content>
<!-- <v-container> -->
<router-view />
<!-- </v-container> -->
</v-content>
<leaderboard-bar />
<snackbar />
</v-app>
<router-view />
</template>

<script>
import AppBar from "@/components/AppBar";
import QuizBar from "@/components/QuizBar";
import Snackbar from "@/components/Snackbar";
import CWHQBar from "@/components/CWHQBar";
import LeaderboardBar from "@/components/LeaderboardBar";

export default {
name: "App",
components: {
AppBar,
QuizBar,
Snackbar,
CWHQBar,
LeaderboardBar
}
name: "App"
};
</script>
5 changes: 5 additions & 0 deletions src/api/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ async function resetPassword(token, password) {
);
}

async function doesUsernameExist(username) {
return await request(routes.userapi_user_exists(username));
}

export default {
doesUsernameExist,
logout,
login,
autoLogin,
Expand Down
3 changes: 3 additions & 0 deletions src/api/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export default {
userapi_refresh: route("/api/v1/users/token/refresh", "POST"),
userapi_forgot_password: route("/api/v1/users/forgot", "POST"),
userapi_reset_password: route("/api/v1/users/reset-password", "POST"),
userapi_user_exists: username => {
return route(`/api/v1/users/${username}/exists`);
},
questionsapi_rank_reset: route("/api/v1/questions/reset", "DELETE"),
questionsapi_answer_next_question: route("/api/v1/questions/answer", "POST"),
questionsapi_answer_final_question: route("/api/v1/questions/final", "POST"),
Expand Down
12 changes: 11 additions & 1 deletion src/api/voting.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ async function getBallot() {
return request(routes.voting_ballot);
}

async function cast(answerId, email) {
return request(routes.voting_cast(answerId), { data: { email } });
}

async function confirm(token) {
return request(routes.voting_confirm, { data: { token } });
}

export default {
getBallot
getBallot,
cast,
confirm
};
61 changes: 0 additions & 61 deletions src/components/HelpPopOver.vue

This file was deleted.

68 changes: 0 additions & 68 deletions src/components/QuizBar.vue

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class="pl-4"
>
<div class="text-center" style="width: 100%;">
<router-link :to="{ name: 'home' }">
<router-link :to="{ name: 'redirect' }">
<img src="/images/logo-small.png" class="mt-2" :height="imageHeight" />
</router-link>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<v-toolbar
elevation="0"
color="white"
:height="height"
:min-height="height"
Expand Down
Loading