├── README.md ├── cb.jpg ├── database ├── final.sql ├── finaldata.sql └── finalfinal.sql ├── index.js ├── package-lock.json ├── package.json ├── public ├── assets │ ├── css │ │ ├── bootstrap.min.css │ │ └── main.css │ ├── js │ │ ├── bootstrap.min.js │ │ ├── breakpoints.min.js │ │ ├── browser.min.js │ │ ├── jquery.min.js │ │ ├── main.js │ │ ├── popper.js │ │ ├── searchbar.js │ │ └── util.js │ └── sass │ │ ├── _navbar.scss │ │ ├── libs │ │ ├── _breakpoints.scss │ │ ├── _functions.scss │ │ └── _hover.scss │ │ └── main.scss ├── fonts │ └── UbuntuCondensed-Regular.ttf └── images │ ├── developer.PNG │ ├── developer.jpg │ ├── mountains.jpg │ ├── problem.jpg │ └── student.jpg ├── routes ├── Documentation.js ├── articles.js ├── contests.js ├── groups.js ├── homepage.js ├── login.js ├── logout.js ├── problemset.js ├── profile.js ├── search.js ├── server.js ├── signup.js ├── submission.js ├── teams.js └── verifiyToken.js ├── screenshots ├── 1.PNG ├── 10.PNG ├── 11.PNG ├── 12.PNG ├── 13.PNG ├── 14.PNG ├── 15.PNG ├── 16.PNG ├── 2.PNG ├── 3.PNG ├── 4.PNG ├── 5.PNG ├── 6.PNG ├── 7.PNG ├── 8.PNG └── 9.PNG └── views ├── 404.ejs ├── article.ejs ├── articles.ejs ├── contest.ejs ├── contests.ejs ├── conteststanding.ejs ├── createarticle.ejs ├── createcontest_problems.ejs ├── createcontest_problemsnum.ejs ├── createdocumentation.ejs ├── creategroup.ejs ├── createproblem.ejs ├── createteam.ejs ├── documentation.ejs ├── documentations.ejs ├── editarticle.ejs ├── editdocumentation.ejs ├── editproblem.ejs ├── group.ejs ├── groups.ejs ├── homepage.ejs ├── homepage2.ejs ├── login.ejs ├── myfriends.ejs ├── partials ├── Scripts.ejs ├── footer.ejs └── nav.ejs ├── problem.ejs ├── problemset.ejs ├── problemsubmissions.ejs ├── profile.ejs ├── searchResult.ejs ├── signup.ejs ├── teams.ejs ├── updateProfile.ejs └── user.ejs /README.md: -------------------------------------------------------------------------------- 1 | # code_book 2 |

3 | 4 | logo 5 |

6 |

🏆 Code Book. 7 |
8 |

9 |
10 | 11 | [![GitHub contributors](https://img.shields.io/github/contributors/gaserashraf/code_book)](https://github.com/code_book/contributors) 12 | [![GitHub issues](https://img.shields.io/github/issues/gaserashraf/code_book)](https://github.com/gaserashraf/code_book/issues) 13 | [![GitHub forks](https://img.shields.io/github/forks/gaserashraf/code_book)](https://github.com/gaserashraf/code_book/network) 14 | [![GitHub stars](https://img.shields.io/github/stars/gaserashraf/code_book)](https://github.com/gaserashraf/code_book/stargazers) 15 | [![GitHub license](https://img.shields.io/github/license/gaserashraf/code_book)](https://github.com/gaserashraf/code_book/blob/master/LICENSE) 16 | 17 |
18 | 19 | 20 | ## 📝 Table of Contents 21 | 22 | - [About](#about) 23 | - [Get Started](#Install) 24 | - [Technology](#tech) 25 | - [Screenshots](#Screenshots) 26 | 27 | ## 📙 About 28 | online website about competitive programming. The site offers explanations about topics related to competitive programming and articles written by experts. In addition, the main core of the site is to solve problems about competitive programming, so the site contains problems with variant difficulty levels. The user can submit his solution output and the site checks that output. 29 | Each user can solve problems, see topics explanations, review articles, and can participate in official contests. On the other side come the developers, expert people for managing the site; these are responsible for putting problems and determine the input and output of each problem. Also, contributors write and edit materials of topics explanations. 30 | 31 | ## 🏁 Get Started 32 | 1. **Excute Database** 33 | - Install mysql 34 | - Execute sql Script on mysql workbench 35 | 2. **Clone the repository** 36 | ``` 37 | git clone https://github.com/gaserashraf/code_book.git 38 | ``` 39 | ``` 40 | cd code_book 41 | ``` 42 | 3. **Change data connection in (routes/server.js)** 43 | ``` 44 | var connection = mysql.createConnection({ 45 | host : 'localhost', 46 | user : 'root', 47 | password: 'password',//change to ur password 48 | database : 'NyZaKa', 49 | }); 50 | ``` 51 | 4. **Running** 52 | ``` 53 | npm install 54 | ``` 55 | ``` 56 | nodemon index 57 | ``` 58 | go to your browser and go to http://localhost:5000/ 59 | 60 | 61 | ## 💻 Built Using 62 | - **MYSQL** 63 | - **Nodejs** 64 | - **Express** 65 | - **HTML** 66 | - **Some vanilla javascript** 67 | - **SASS** 68 | - **Bootstrap** 69 | ## 📷 Screenshots 70 | 71 |
72 | logo 73 | logo 74 |
75 | logo 76 | logo 77 |
78 | logo 79 |
80 | logo 81 |
82 | logo 83 | logo 84 |
85 | logo 86 |
87 | logo 88 | logo 89 |
90 | logo 91 |
92 | logo 93 | logo 94 | logo 95 | logo 96 | 97 |
98 | 99 | ### ✨ Contributors 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 |

Gaser Ashraf


Mohamed Nabawe


Yousef Elshabrawy‬


Yousef Elmahdy

108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /cb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/cb.jpg -------------------------------------------------------------------------------- /database/final.sql: -------------------------------------------------------------------------------- 1 | create schema NyZaKa; 2 | 3 | 4 | create table NyZaKa.Users ( 5 | Handle varchar(100) NOT NULL , 6 | Acsess varchar(100) NOT NULL , 7 | E_mail varchar(100) NOT NULL , 8 | Password_ varchar(80) NOT NULL , 9 | Fname varchar(80) NOT NULL , 10 | Lname varchar(80) , 11 | Rate_max int NOT NULL , 12 | Rate_cur int NOT NULL , 13 | PRIMARY KEY (Handle) ); 14 | 15 | 16 | create table NyZaKa.Contest ( 17 | Contest_ID int NOT NULL AUTO_INCREMENT, 18 | Day_ Datetime NOT NULL , 19 | Hour_ Time NOT NULL , 20 | Duration int NOT NULL , 21 | PRIMARY KEY (Contest_ID) ); 22 | 23 | 24 | create table NyZaKa.Documentation ( 25 | ID int NOT NULL AUTO_INCREMENT, 26 | DocName char(50) NOT NULL , 27 | Topic varchar(20) NOT NULL , 28 | Statment varchar(1000) NOT NULL , 29 | Doc_date DATETIME NOT NULL , 30 | Writer varchar(100) NOT NULL , 31 | foreign key (Writer) REFERENCES users (Handle) , 32 | PRIMARY KEY (ID) ); 33 | 34 | 35 | 36 | create table NyZaKa.Articles ( 37 | ID int NOT NULL AUTO_INCREMENT, 38 | ArtName char(50) NOT NULL, 39 | Topic varchar(20) NOT NULL , 40 | Statment varchar(1000) NOT NULL , 41 | Art_date DATETIME NOT NULL , 42 | Writer varchar(100) NOT NULL , 43 | foreign key (Writer) REFERENCES users (Handle) , 44 | PRIMARY KEY (ID) ); 45 | 46 | create table NyZaKa.Groups_ ( 47 | Name_ varchar(20) NOT NULL , 48 | Owner_ varchar(100) NOT NULL , 49 | foreign key (Owner_) REFERENCES users (Handle) , 50 | PRIMARY KEY (Name_) ); 51 | 52 | /* Group Admins */ 53 | create table NyZaKa.Teams ( 54 | Name_ varchar(20) NOT NULL , 55 | Team_Rate_max int NOT NULL , 56 | Team_Rate_cur int NOT NULL , 57 | Member1 varchar(100) NOT NULL , 58 | Member2 varchar(100) , 59 | Member3 varchar(100) , 60 | foreign key (Member1) REFERENCES users (Handle) , 61 | foreign key (Member2) REFERENCES users (Handle) , 62 | foreign key (Member3) REFERENCES users (Handle) , 63 | PRIMARY KEY (Name_) ); 64 | 65 | 66 | 67 | 68 | 69 | 70 | create table NyZaKa.Friends ( 71 | Follower varchar(100) NOT NULL , 72 | Followee varchar(100) NOT NULL , 73 | foreign key (Follower) REFERENCES users (Handle) , 74 | foreign key (Followee) REFERENCES users (Handle) , 75 | PRIMARY KEY (Follower ,Followee ) ); 76 | 77 | 78 | 79 | 80 | create table NyZaKa.Group_Members ( 81 | Group_Name varchar(40) NOT NULL , 82 | Group_Member varchar(100) NOT NULL , 83 | foreign key (Group_Member) REFERENCES users (Handle) , 84 | foreign key (Group_Name) REFERENCES Groups_ (Name_), 85 | PRIMARY KEY (Group_Name ,Group_Member ) ); 86 | 87 | create table NyZaKa.Group_Admins ( 88 | Group_Name varchar(40) NOT NULL, 89 | Group_Admin varchar(100) NOT NULL, 90 | foreign key (Group_Admin) REFERENCES users (Handle) , 91 | foreign key (Group_Name) REFERENCES Groups_ (Name_), 92 | PRIMARY KEY (Group_Name ,Group_Admin ) 93 | ); 94 | 95 | create table NyZaKa.Participate ( 96 | Contest_ID int NOT NULL , 97 | Participant varchar(100) NOT NULL , 98 | Score int , 99 | foreign key (Contest_ID) REFERENCES Contest (Contest_ID) , 100 | foreign key (Participant) REFERENCES users (Handle) , 101 | PRIMARY KEY (Contest_ID ,Participant ) ); 102 | 103 | create table NyZaKa.Team_Participate ( 104 | Contest_ID int NOT NULL, 105 | Team_Participant varchar(20) NOT NULL , 106 | Score int , 107 | foreign key (Contest_ID) REFERENCES Contest (Contest_ID) , 108 | foreign key (Team_Participant) REFERENCES Teams (Name_) , 109 | PRIMARY KEY (Contest_ID ,Team_Participant ) ); 110 | 111 | /* 112 | create table NyZaKa.Make_Contest ( 113 | Contest_ID char(3) NOT NULL , 114 | Writer varchar(100) NOT NULL , 115 | foreign key (Contest_ID) REFERENCES Contest (Contest_ID) , 116 | foreign key (Writer) REFERENCES users (Handle) , 117 | PRIMARY KEY (Contest_ID ,Writer ) ); 118 | */ 119 | 120 | create table NyZaKa.Problem ( 121 | Problem_ID int NOT NULL AUTO_INCREMENT, 122 | Topic varchar(20) , 123 | NameProblem varchar(20) NOT NULL , 124 | writer varchar(100) NOT NULL , 125 | input varchar(1000) NOT NULL , 126 | output varchar(1000) NOT NULL , 127 | statment varchar(1000) NOT NULL , 128 | Input_Format varchar(1000) , 129 | Output_Format varchar(1000), 130 | score int NOT NULL , 131 | difficulty int , 132 | Sample_Input varchar(45), 133 | Sample_Output varchar(45), 134 | foreign key (writer) REFERENCES users (Handle) , 135 | PRIMARY KEY (Problem_ID) ); 136 | 137 | create table NyZaKa.Contest_Problems ( 138 | Contest_ID int NOT NULL , 139 | Problem_ID int NOT NULL , 140 | foreign key(contest_ID) references contest (Contest_ID) , 141 | foreign key(problem_ID) references problem (Problem_ID) ON DELETE CASCADE, 142 | primary key(Contest_ID,Problem_ID) 143 | ); 144 | 145 | create table NyZaKa.Submissions ( 146 | ID int auto_increment, 147 | Problem_ID int NOT NULL, 148 | User_ varchar(100) NOT NULL , 149 | Time_ DATETIME NOT NULL , 150 | Output varchar(1000) , 151 | Submission_Status varchar(20) NOT NULL , 152 | foreign key (Problem_ID) REFERENCES Problem (Problem_ID) ON DELETE CASCADE, 153 | foreign key (User_) REFERENCES users (Handle) , 154 | PRIMARY KEY (ID) ); 155 | 156 | 157 | create table NyZaKa.Team_Submissions ( 158 | ID int NOT NULL AUTO_INCREMENT, 159 | Problem_ID int NOT NULL , 160 | Team_Name varchar(20) NOT NULL , 161 | Time_ DATETIME NOT NULL , 162 | Output varchar(1000) , 163 | Submission_Status varchar(20) NOT NULL , 164 | foreign key (Problem_ID) REFERENCES Problem (Problem_ID) ON DELETE CASCADE , 165 | foreign key (Team_Name) REFERENCES Teams (Name_) , 166 | PRIMARY KEY (ID) ); 167 | 168 | -------------------------------------------------------------------------------- /database/finalfinal.sql: -------------------------------------------------------------------------------- 1 | create schema NyZaKa; 2 | 3 | 4 | create table NyZaKa.Users ( 5 | Handle varchar(100) NOT NULL , 6 | Acsess varchar(100) NOT NULL , 7 | E_mail varchar(100) NOT NULL , 8 | Password_ varchar(80) NOT NULL , 9 | Fname varchar(80) NOT NULL , 10 | Lname varchar(80) , 11 | Rate_max int NOT NULL , 12 | Rate_cur int NOT NULL , 13 | PRIMARY KEY (Handle) ); 14 | 15 | 16 | create table NyZaKa.Contest ( 17 | Contest_ID int NOT NULL AUTO_INCREMENT, 18 | Day_ Datetime NOT NULL , 19 | Hour_ Time NOT NULL , 20 | Duration int NOT NULL , 21 | PRIMARY KEY (Contest_ID) ); 22 | 23 | 24 | create table NyZaKa.Documentation ( 25 | ID int NOT NULL AUTO_INCREMENT, 26 | DocName char(50) NOT NULL , 27 | Topic varchar(20) NOT NULL , 28 | Statment varchar(10000) NOT NULL , 29 | Doc_date DATETIME NOT NULL , 30 | Writer varchar(100) NOT NULL , 31 | foreign key (Writer) REFERENCES users (Handle) , 32 | PRIMARY KEY (ID) ); 33 | 34 | 35 | 36 | create table NyZaKa.Articles ( 37 | ID int NOT NULL AUTO_INCREMENT, 38 | ArtName char(50) NOT NULL, 39 | Topic varchar(20) NOT NULL , 40 | Statment varchar(10000) NOT NULL , 41 | Art_date DATETIME NOT NULL , 42 | Writer varchar(100) NOT NULL , 43 | foreign key (Writer) REFERENCES users (Handle) , 44 | PRIMARY KEY (ID) ); 45 | 46 | create table NyZaKa.Groups_ ( 47 | Name_ varchar(60) NOT NULL , 48 | Owner_ varchar(100) NOT NULL , 49 | foreign key (Owner_) REFERENCES users (Handle) , 50 | PRIMARY KEY (Name_) ); 51 | 52 | /* Group Admins */ 53 | create table NyZaKa.Teams ( 54 | Name_ varchar(60) NOT NULL , 55 | Team_Rate_max int NOT NULL , 56 | Team_Rate_cur int NOT NULL , 57 | Member1 varchar(100) NOT NULL , 58 | Member2 varchar(100) , 59 | Member3 varchar(100) , 60 | foreign key (Member1) REFERENCES users (Handle) , 61 | foreign key (Member2) REFERENCES users (Handle) , 62 | foreign key (Member3) REFERENCES users (Handle) , 63 | PRIMARY KEY (Name_) ); 64 | 65 | 66 | 67 | 68 | 69 | 70 | create table NyZaKa.Friends ( 71 | Follower varchar(100) NOT NULL , 72 | Followee varchar(100) NOT NULL , 73 | foreign key (Follower) REFERENCES users (Handle) , 74 | foreign key (Followee) REFERENCES users (Handle) , 75 | PRIMARY KEY (Follower ,Followee ) ); 76 | 77 | 78 | 79 | 80 | create table NyZaKa.Group_Members ( 81 | Group_Name varchar(60) NOT NULL , 82 | Group_Member varchar(100) NOT NULL , 83 | foreign key (Group_Member) REFERENCES users (Handle) , 84 | foreign key (Group_Name) REFERENCES Groups_ (Name_), 85 | PRIMARY KEY (Group_Name ,Group_Member ) ); 86 | 87 | create table NyZaKa.Group_Admins ( 88 | Group_Name varchar(60) NOT NULL, 89 | Group_Admin varchar(100) NOT NULL, 90 | foreign key (Group_Admin) REFERENCES users (Handle) , 91 | foreign key (Group_Name) REFERENCES Groups_ (Name_), 92 | PRIMARY KEY (Group_Name ,Group_Admin ) 93 | ); 94 | 95 | create table NyZaKa.Participate ( 96 | Contest_ID int NOT NULL , 97 | Participant varchar(100) NOT NULL , 98 | Score int , 99 | foreign key (Contest_ID) REFERENCES Contest (Contest_ID) , 100 | foreign key (Participant) REFERENCES users (Handle) , 101 | PRIMARY KEY (Contest_ID ,Participant ) ); 102 | 103 | create table NyZaKa.Team_Participate ( 104 | Contest_ID int NOT NULL, 105 | Team_Participant varchar(60) NOT NULL , 106 | Score int , 107 | foreign key (Contest_ID) REFERENCES Contest (Contest_ID) , 108 | foreign key (Team_Participant) REFERENCES Teams (Name_) , 109 | PRIMARY KEY (Contest_ID ,Team_Participant ) ); 110 | 111 | /* 112 | create table NyZaKa.Make_Contest ( 113 | Contest_ID char(3) NOT NULL , 114 | Writer varchar(100) NOT NULL , 115 | foreign key (Contest_ID) REFERENCES Contest (Contest_ID) , 116 | foreign key (Writer) REFERENCES users (Handle) , 117 | PRIMARY KEY (Contest_ID ,Writer ) ); 118 | */ 119 | 120 | create table NyZaKa.Problem ( 121 | Problem_ID int NOT NULL AUTO_INCREMENT, 122 | Topic varchar(20) , 123 | NameProblem varchar(20) NOT NULL , 124 | writer varchar(100) NOT NULL , 125 | input varchar(1000) NOT NULL , 126 | output varchar(1000) NOT NULL , 127 | statment varchar(1000) NOT NULL , 128 | Input_Format varchar(1000) , 129 | Output_Format varchar(1000), 130 | score int NOT NULL , 131 | difficulty int , 132 | Sample_Input varchar(45), 133 | Sample_Output varchar(45), 134 | foreign key (writer) REFERENCES users (Handle) , 135 | PRIMARY KEY (Problem_ID) ); 136 | 137 | create table NyZaKa.Contest_Problems ( 138 | Contest_ID int NOT NULL , 139 | Problem_ID int NOT NULL , 140 | foreign key(contest_ID) references contest (Contest_ID), 141 | foreign key(problem_ID) references problem (Problem_ID), 142 | primary key(Contest_ID,Problem_ID) 143 | ); 144 | 145 | create table NyZaKa.Submissions ( 146 | ID int auto_increment, 147 | Problem_ID int NOT NULL, 148 | User_ varchar(100) NOT NULL , 149 | Time_ DATETIME NOT NULL , 150 | Output varchar(1000) , 151 | Submission_Status varchar(20) NOT NULL , 152 | foreign key (Problem_ID) REFERENCES Problem (Problem_ID), 153 | foreign key (User_) REFERENCES users (Handle) , 154 | PRIMARY KEY (ID) ); 155 | 156 | 157 | create table NyZaKa.Team_Submissions ( 158 | ID int NOT NULL AUTO_INCREMENT, 159 | Problem_ID int NOT NULL , 160 | Team_Name varchar(60) NOT NULL , 161 | Time_ DATETIME NOT NULL , 162 | Output varchar(1000) , 163 | Submission_Status varchar(20) NOT NULL , 164 | foreign key (Problem_ID) REFERENCES Problem (Problem_ID), 165 | foreign key (Team_Name) REFERENCES Teams (Name_) , 166 | PRIMARY KEY (ID) ); 167 | 168 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | var mysql = require("mysql"); 3 | const cors = require("cors"); 4 | const cookieParser = require("cookie-parser"); 5 | const mysqlConnection = require("./routes/server"); 6 | const fs = require("fs"); 7 | const app = express(); 8 | 9 | const problemset = require("./routes/problemset"); 10 | const signup = require("./routes/signup"); 11 | const articles = require("./routes/articles"); 12 | const contests = require("./routes/contests"); 13 | const login = require("./routes/login"); 14 | const Documentation = require("./routes/Documentation"); 15 | const Groups = require("./routes/groups"); 16 | const Teams = require("./routes/teams"); 17 | const profile = require("./routes/profile"); 18 | const logout = require("./routes/logout"); 19 | const verify = require("./routes/verifiyToken"); 20 | const search = require("./routes/search"); 21 | const submission = require("./routes/submission"); 22 | const homepage = require("./routes/homepage"); 23 | const { resolveInclude } = require("ejs"); 24 | const { nextTick } = require("process"); 25 | app.set("view engine", "ejs"); 26 | 27 | app.listen(5000, () => { 28 | console.log("Server initiated succesfully"); 29 | }); 30 | 31 | // set a static files 32 | 33 | app.use(express.static("public")); 34 | app.use(express.urlencoded({ extended: true })); 35 | app.use(cors()); 36 | app.use(cookieParser()); 37 | app.use(express.json()); 38 | 39 | app.use(homepage); 40 | app.use(articles); 41 | app.use(contests); 42 | app.use(problemset); 43 | app.use(login); 44 | app.use(profile); 45 | app.use(signup); 46 | app.use(Documentation); 47 | 48 | app.use(logout); 49 | app.use(Groups); 50 | app.use(Teams); 51 | app.use(search); 52 | app.use(submission); 53 | 54 | //TO TEST ONLY 55 | 56 | 57 | // if the request reach to this then there are 404 58 | app.use(verify, (req, res) => { 59 | let token = req.user; 60 | res.render("404", { user: req.user, Current_Nav: "__" }); 61 | }); 62 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "databaseproject", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/El-Nebo/Team-Abbas-.git" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/El-Nebo/Team-Abbas-/issues" 17 | }, 18 | "homepage": "https://github.com/El-Nebo/Team-Abbas-#readme", 19 | "dependencies": { 20 | "bcryptjs": "^2.4.3", 21 | "cookie-parser": "^1.4.5", 22 | "cors": "^2.8.5", 23 | "ejs": "^3.1.5", 24 | "express": "^4.17.1", 25 | "jsonwebtoken": "^8.5.1", 26 | "mysql": "^2.18.1", 27 | "nodejs": "^0.0.0", 28 | "nodemon": "^2.0.6", 29 | "util": "^0.12.3" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /public/assets/css/main.css: -------------------------------------------------------------------------------- 1 | /* Underline From Left */ 2 | @import url("https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,300,200"); 3 | .hvr-underline-from-left { 4 | display: inline-block; 5 | vertical-align: middle; 6 | transform: perspective(1px) translateZ(0); 7 | box-shadow: 0 0 1px rgba(0, 0, 0, 0); 8 | position: relative; 9 | overflow: hidden; 10 | } 11 | 12 | .hvr-underline-from-left:before { 13 | content: ""; 14 | position: absolute; 15 | z-index: -1; 16 | left: 0; 17 | right: 100%; 18 | bottom: 0; 19 | background: #2098D1; 20 | height: 4px; 21 | transition-property: right; 22 | transition-duration: 0.3s; 23 | transition-timing-function: ease-out; 24 | } 25 | 26 | .hvr-underline-from-left:hover:before, .hvr-underline-from-left:focus:before, .hvr-underline-from-left:active:before { 27 | right: 0; 28 | } 29 | 30 | #navbar { 31 | font-family: mainFont; 32 | } 33 | 34 | #navbar .navbar-brand { 35 | font-size: 30px; 36 | } 37 | 38 | #navbar .navbar-nav { 39 | position: relative; 40 | } 41 | 42 | #navbar .navbar-nav .nav-item { 43 | margin-left: 25px; 44 | text-transform: uppercase; 45 | } 46 | 47 | #navbar .navbar-nav .nav-item.active { 48 | border-bottom: 4px solid #2098D1; 49 | } 50 | 51 | #navbar .navbar-nav .slash { 52 | position: absolute; 53 | top: 7px; 54 | left: 99px; 55 | } 56 | 57 | #navbar .navbar-nav .search button { 58 | border: none; 59 | margin: 0; 60 | padding: 0; 61 | width: auto; 62 | overflow: visible; 63 | background: transparent; 64 | color: inherit; 65 | font: inherit; 66 | line-height: normal; 67 | -webkit-font-smoothing: inherit; 68 | -moz-osx-font-smoothing: inherit; 69 | -webkit-appearance: none; 70 | outline: none; 71 | } 72 | 73 | #navbar .navbar-nav .search input { 74 | width: 50%; 75 | animation-duration: .5s; 76 | animation-fill-mode: both; 77 | background-color: #343A40; 78 | border: none; 79 | color: #9A9DA0; 80 | } 81 | 82 | #navbar .navbar-nav .search input::placeholder { 83 | color: #9A9DA0; 84 | font-size: 18px; 85 | } 86 | 87 | #navbar .navbar-nav .search input.active { 88 | animation-name: example; 89 | color: #343A40; 90 | } 91 | 92 | #navbar .navbar-nav .search input.dactive { 93 | animation-name: example1; 94 | } 95 | 96 | @keyframes example { 97 | 0% { 98 | width: 50%; 99 | } 100 | 100% { 101 | width: 100%; 102 | background-color: white; 103 | } 104 | } 105 | 106 | @keyframes example1 { 107 | 0% { 108 | width: 100%; 109 | background-color: white; 110 | } 111 | 100% { 112 | width: 50%; 113 | background-color: #343A40; 114 | } 115 | } 116 | 117 | /* 118 | Halcyonic by HTML5 UP 119 | html5up.net | @ajlkn 120 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 121 | */ 122 | @font-face { 123 | font-family: mainFont; 124 | src: url("../../fonts/UbuntuCondensed-Regular.ttf"); 125 | } 126 | 127 | * { 128 | box-sizing: border-box; 129 | } 130 | 131 | html, body, div, span, applet, object, 132 | iframe, h1, h2, h3, h4, h5, h6, p, blockquote, 133 | pre, a, abbr, acronym, address, big, cite, 134 | code, del, dfn, em, img, ins, kbd, q, s, samp, 135 | small, strike, strong, sub, sup, tt, var, b, 136 | u, i, center, dl, dt, dd, ol, ul, li, fieldset, 137 | form, label, legend, table, caption, tbody, 138 | tfoot, thead, tr, th, td, article, aside, 139 | canvas, details, embed, figure, figcaption, 140 | footer, header, hgroup, menu, nav, output, ruby, 141 | section, summary, time, mark, audio, video { 142 | margin: 0; 143 | padding: 0; 144 | border: 0; 145 | font-size: 100%; 146 | font: inherit; 147 | vertical-align: baseline; 148 | } 149 | 150 | html { 151 | height: 100%; 152 | } 153 | 154 | body section { 155 | position: relative; 156 | min-height: 86.5vh; 157 | } 158 | 159 | article, aside, details, figcaption, figure, 160 | footer, header, hgroup, menu, nav, section { 161 | display: block; 162 | } 163 | 164 | hr { 165 | margin: 0; 166 | padding: 0; 167 | } 168 | 169 | body { 170 | line-height: 1; 171 | } 172 | 173 | ol, ul { 174 | list-style: none; 175 | } 176 | 177 | blockquote, q { 178 | quotes: none; 179 | } 180 | 181 | blockquote:before, blockquote:after, q:before, q:after { 182 | content: ''; 183 | content: none; 184 | } 185 | 186 | table { 187 | border-collapse: collapse; 188 | border-spacing: 0; 189 | } 190 | 191 | body { 192 | -webkit-text-size-adjust: none; 193 | } 194 | 195 | mark { 196 | background-color: transparent; 197 | color: inherit; 198 | } 199 | 200 | input::-moz-focus-inner { 201 | border: 0; 202 | padding: 0; 203 | } 204 | 205 | input, textarea, button { 206 | -webkit-appearance: none; 207 | -webkit-font-smoothing: antialiased; 208 | resize: none; 209 | } 210 | 211 | input[type="radio"] { 212 | -webkit-appearance: radio; 213 | } 214 | 215 | .mb-em { 216 | margin-bottom: 1em; 217 | } 218 | 219 | .mt-em { 220 | margin-top: 1em; 221 | } 222 | 223 | .row { 224 | margin: 0; 225 | } 226 | 227 | /* Basic */ 228 | html { 229 | box-sizing: border-box; 230 | } 231 | 232 | *, *:before, *:after { 233 | box-sizing: inherit; 234 | } 235 | 236 | body { 237 | background: #D4D9DD; 238 | color: #474f51; 239 | font-size: 13.5pt; 240 | font-family: mainFont; 241 | line-height: 1.85em; 242 | font-weight: 300; 243 | } 244 | 245 | input, textarea, select { 246 | color: #474f51; 247 | font-size: 13.5pt; 248 | font-family: mainFont; 249 | line-height: 1.85em; 250 | font-weight: 300; 251 | } 252 | 253 | a { 254 | text-decoration: none; 255 | } 256 | 257 | a:hover { 258 | text-decoration: none; 259 | } 260 | 261 | section > :last-child, 262 | section:last-child, 263 | .last-child { 264 | margin-bottom: 0 !important; 265 | } 266 | 267 | /* Container */ 268 | .container { 269 | margin: 0 auto; 270 | max-width: 100%; 271 | width: 1300px; 272 | padding-left: 0; 273 | } 274 | 275 | @media screen and (max-width: 1680px) { 276 | .container { 277 | width: 1300px; 278 | } 279 | } 280 | 281 | @media screen and (max-width: 1280px) { 282 | .container { 283 | width: calc(100% - 40px); 284 | } 285 | } 286 | 287 | @media screen and (max-width: 980px) { 288 | .container { 289 | width: calc(100% - 50px); 290 | } 291 | } 292 | 293 | @media screen and (max-width: 736px) { 294 | .container { 295 | width: calc(100% - 40px); 296 | } 297 | } 298 | 299 | a { 300 | text-decoration: none; 301 | } 302 | 303 | .pre { 304 | background-color: #e0e0e0; 305 | border-radius: 10px; 306 | color: rgba(0, 0, 0, 0.9); 307 | font-family: Consolas,monospace; 308 | margin-bottom: 10px; 309 | overflow: auto; 310 | padding: 10px; 311 | } 312 | 313 | #content .box { 314 | background-color: white; 315 | } 316 | 317 | #content .box .header { 318 | margin-bottom: 1rem; 319 | } 320 | 321 | #content .box .header h2 { 322 | font-size: 24px; 323 | } 324 | 325 | #content .box .pre { 326 | background-color: #e0e0e0; 327 | border-radius: 10px; 328 | color: rgba(0, 0, 0, 0.9); 329 | font-family: Consolas,monospace; 330 | margin-bottom: 10px; 331 | overflow: auto; 332 | padding: 10px; 333 | } 334 | 335 | .boxFriend { 336 | background-color: #fff; 337 | padding: 5px; 338 | border: 1.5px solid #474f51; 339 | margin: 5px; 340 | position: relative; 341 | border-radius: 5px; 342 | } 343 | 344 | .boxFriend .iconRemove { 345 | position: absolute; 346 | right: 5px; 347 | } 348 | 349 | .join { 350 | cursor: pointer; 351 | } 352 | 353 | .boxName { 354 | width: 35px; 355 | height: 35px; 356 | border-radius: 50%; 357 | margin-right: 5px; 358 | background-color: #474f51; 359 | color: #D4D9DD; 360 | display: flex; 361 | justify-content: center; 362 | } 363 | 364 | @media screen and (max-width: 980px) { 365 | .slash { 366 | display: none; 367 | } 368 | } 369 | -------------------------------------------------------------------------------- /public/assets/js/breakpoints.min.js: -------------------------------------------------------------------------------- 1 | /* breakpoints.js v1.0 | @ajlkn | MIT licensed */ 2 | var breakpoints=function(){"use strict";function e(e){t.init(e)}var t={list:null,media:{},events:[],init:function(e){t.list=e,window.addEventListener("resize",t.poll),window.addEventListener("orientationchange",t.poll),window.addEventListener("load",t.poll),window.addEventListener("fullscreenchange",t.poll)},active:function(e){var n,a,s,i,r,d,c;if(!(e in t.media)){if(">="==e.substr(0,2)?(a="gte",n=e.substr(2)):"<="==e.substr(0,2)?(a="lte",n=e.substr(2)):">"==e.substr(0,1)?(a="gt",n=e.substr(1)):"<"==e.substr(0,1)?(a="lt",n=e.substr(1)):"!"==e.substr(0,1)?(a="not",n=e.substr(1)):(a="eq",n=e),n&&n in t.list)if(i=t.list[n],Array.isArray(i)){if(r=parseInt(i[0]),d=parseInt(i[1]),isNaN(r)){if(isNaN(d))return;c=i[1].substr(String(d).length)}else c=i[0].substr(String(r).length);if(isNaN(r))switch(a){case"gte":s="screen";break;case"lte":s="screen and (max-width: "+d+c+")";break;case"gt":s="screen and (min-width: "+(d+1)+c+")";break;case"lt":s="screen and (max-width: -1px)";break;case"not":s="screen and (min-width: "+(d+1)+c+")";break;default:s="screen and (max-width: "+d+c+")"}else if(isNaN(d))switch(a){case"gte":s="screen and (min-width: "+r+c+")";break;case"lte":s="screen";break;case"gt":s="screen and (max-width: -1px)";break;case"lt":s="screen and (max-width: "+(r-1)+c+")";break;case"not":s="screen and (max-width: "+(r-1)+c+")";break;default:s="screen and (min-width: "+r+c+")"}else switch(a){case"gte":s="screen and (min-width: "+r+c+")";break;case"lte":s="screen and (max-width: "+d+c+")";break;case"gt":s="screen and (min-width: "+(d+1)+c+")";break;case"lt":s="screen and (max-width: "+(r-1)+c+")";break;case"not":s="screen and (max-width: "+(r-1)+c+"), screen and (min-width: "+(d+1)+c+")";break;default:s="screen and (min-width: "+r+c+") and (max-width: "+d+c+")"}}else s="("==i.charAt(0)?"screen and "+i:i;t.media[e]=!!s&&s}return t.media[e]!==!1&&window.matchMedia(t.media[e]).matches},on:function(e,n){t.events.push({query:e,handler:n,state:!1}),t.active(e)&&n()},poll:function(){var e,n;for(e=0;e0:!!("ontouchstart"in window),e.mobile="wp"==e.os||"android"==e.os||"ios"==e.os||"bb"==e.os}};return e.init(),e}();!function(e,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?module.exports=n():e.browser=n()}(this,function(){return browser}); 3 | -------------------------------------------------------------------------------- /public/assets/js/main.js: -------------------------------------------------------------------------------- 1 | //Join Group button 2 | const joins = document.querySelectorAll("a.join"); 3 | 4 | joins.forEach((join) => { 5 | join.addEventListener("click", (e) => { 6 | const endpoint = `/groups/${join.dataset.doc}`; 7 | 8 | fetch(endpoint, { 9 | method: "POST", 10 | }) 11 | .then((response) => response.json()) 12 | .then((data) => (window.location.href = data.redirect)) 13 | .catch((err) => console.log(err)); 14 | }); 15 | }); 16 | //--------------------------------- 17 | -------------------------------------------------------------------------------- /public/assets/js/popper.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import { popperGenerator, detectOverflow } from './createPopper'; 3 | 4 | import eventListeners from './modifiers/eventListeners'; 5 | import popperOffsets from './modifiers/popperOffsets'; 6 | import computeStyles from './modifiers/computeStyles'; 7 | import applyStyles from './modifiers/applyStyles'; 8 | import offset from './modifiers/offset'; 9 | import flip from './modifiers/flip'; 10 | import preventOverflow from './modifiers/preventOverflow'; 11 | import arrow from './modifiers/arrow'; 12 | import hide from './modifiers/hide'; 13 | 14 | export type * from './types'; 15 | 16 | const defaultModifiers = [ 17 | eventListeners, 18 | popperOffsets, 19 | computeStyles, 20 | applyStyles, 21 | offset, 22 | flip, 23 | preventOverflow, 24 | arrow, 25 | hide, 26 | ]; 27 | 28 | const createPopper = popperGenerator({ defaultModifiers }); 29 | 30 | // eslint-disable-next-line import/no-unused-modules 31 | export { createPopper, popperGenerator, defaultModifiers, detectOverflow }; 32 | // eslint-disable-next-line import/no-unused-modules 33 | export { createPopper as createPopperLite } from './popper-lite'; 34 | // eslint-disable-next-line import/no-unused-modules 35 | export * from './modifiers'; 36 | -------------------------------------------------------------------------------- /public/assets/js/searchbar.js: -------------------------------------------------------------------------------- 1 | let inputSearch=document.getElementById("Search"); 2 | 3 | inputSearch.onfocus=()=>{ 4 | inputSearch.classList.add("active"); 5 | inputSearch.classList.remove("dactive"); 6 | } 7 | inputSearch.onfocusout=()=>{ 8 | inputSearch.classList.remove("active"); 9 | inputSearch.classList.add("dactive"); 10 | } -------------------------------------------------------------------------------- /public/assets/sass/_navbar.scss: -------------------------------------------------------------------------------- 1 | #navbar{ 2 | font-family: mainFont; 3 | .navbar-brand{ 4 | font-size: 30px; 5 | } 6 | .navbar-nav { 7 | position: relative; 8 | .nav-item{ 9 | margin-left: 25px; 10 | text-transform: uppercase; 11 | &.active{ 12 | //box-shadow:0px 0px 0px 10px #2098D1 inset; 13 | border-bottom: 4px solid #2098D1; 14 | 15 | } 16 | } 17 | .slash{ 18 | position: absolute; 19 | top: 7px; 20 | left: 99px; 21 | } 22 | .search{ 23 | button{ 24 | border: none; 25 | margin: 0; 26 | padding: 0; 27 | width: auto; 28 | overflow: visible; 29 | background: transparent; 30 | color: inherit; 31 | font: inherit; 32 | line-height: normal; 33 | -webkit-font-smoothing: inherit; 34 | -moz-osx-font-smoothing: inherit; 35 | -webkit-appearance: none; 36 | outline: none; 37 | } 38 | input{ 39 | width: 50%; 40 | animation-duration: .5s; 41 | animation-fill-mode:both; 42 | background-color: #343A40; 43 | border: none; 44 | color: #9A9DA0; 45 | &::placeholder { 46 | color: #9A9DA0; 47 | font-size: 18px; 48 | } 49 | &.active{ 50 | animation-name: example; 51 | color: #343A40; 52 | } 53 | &.dactive{ 54 | animation-name: example1; 55 | } 56 | } 57 | } 58 | } 59 | } 60 | @keyframes example { 61 | 0% {width:50%;} 62 | 100% { 63 | width:100%; 64 | background-color: white; 65 | } 66 | } 67 | @keyframes example1 { 68 | 0% {width:100%;background-color: white;} 69 | 100% {width:50%;background-color:#343A40;} 70 | } -------------------------------------------------------------------------------- /public/assets/sass/libs/_breakpoints.scss: -------------------------------------------------------------------------------- 1 | // breakpoints.scss v1.0 | @ajlkn | MIT licensed */ 2 | 3 | // Vars. 4 | 5 | /// Breakpoints. 6 | /// @var {list} 7 | $breakpoints: () !global; 8 | 9 | // Mixins. 10 | 11 | /// Sets breakpoints. 12 | /// @param {map} $x Breakpoints. 13 | @mixin breakpoints($x: ()) { 14 | $breakpoints: $x !global; 15 | } 16 | 17 | /// Wraps @content in a @media block targeting a specific orientation. 18 | /// @param {string} $orientation Orientation. 19 | @mixin orientation($orientation) { 20 | @media screen and (orientation: #{$orientation}) { 21 | @content; 22 | } 23 | } 24 | 25 | /// Wraps @content in a @media block using a given query. 26 | /// @param {string} $query Query. 27 | @mixin breakpoint($query: null) { 28 | 29 | $breakpoint: null; 30 | $op: null; 31 | $media: null; 32 | 33 | // Determine operator, breakpoint. 34 | 35 | // Greater than or equal. 36 | @if (str-slice($query, 0, 2) == '>=') { 37 | 38 | $op: 'gte'; 39 | $breakpoint: str-slice($query, 3); 40 | 41 | } 42 | 43 | // Less than or equal. 44 | @elseif (str-slice($query, 0, 2) == '<=') { 45 | 46 | $op: 'lte'; 47 | $breakpoint: str-slice($query, 3); 48 | 49 | } 50 | 51 | // Greater than. 52 | @elseif (str-slice($query, 0, 1) == '>') { 53 | 54 | $op: 'gt'; 55 | $breakpoint: str-slice($query, 2); 56 | 57 | } 58 | 59 | // Less than. 60 | @elseif (str-slice($query, 0, 1) == '<') { 61 | 62 | $op: 'lt'; 63 | $breakpoint: str-slice($query, 2); 64 | 65 | } 66 | 67 | // Not. 68 | @elseif (str-slice($query, 0, 1) == '!') { 69 | 70 | $op: 'not'; 71 | $breakpoint: str-slice($query, 2); 72 | 73 | } 74 | 75 | // Equal. 76 | @else { 77 | 78 | $op: 'eq'; 79 | $breakpoint: $query; 80 | 81 | } 82 | 83 | // Build media. 84 | @if ($breakpoint and map-has-key($breakpoints, $breakpoint)) { 85 | 86 | $a: map-get($breakpoints, $breakpoint); 87 | 88 | // Range. 89 | @if (type-of($a) == 'list') { 90 | 91 | $x: nth($a, 1); 92 | $y: nth($a, 2); 93 | 94 | // Max only. 95 | @if ($x == null) { 96 | 97 | // Greater than or equal (>= 0 / anything) 98 | @if ($op == 'gte') { 99 | $media: 'screen'; 100 | } 101 | 102 | // Less than or equal (<= y) 103 | @elseif ($op == 'lte') { 104 | $media: 'screen and (max-width: ' + $y + ')'; 105 | } 106 | 107 | // Greater than (> y) 108 | @elseif ($op == 'gt') { 109 | $media: 'screen and (min-width: ' + ($y + 1) + ')'; 110 | } 111 | 112 | // Less than (< 0 / invalid) 113 | @elseif ($op == 'lt') { 114 | $media: 'screen and (max-width: -1px)'; 115 | } 116 | 117 | // Not (> y) 118 | @elseif ($op == 'not') { 119 | $media: 'screen and (min-width: ' + ($y + 1) + ')'; 120 | } 121 | 122 | // Equal (<= y) 123 | @else { 124 | $media: 'screen and (max-width: ' + $y + ')'; 125 | } 126 | 127 | } 128 | 129 | // Min only. 130 | @else if ($y == null) { 131 | 132 | // Greater than or equal (>= x) 133 | @if ($op == 'gte') { 134 | $media: 'screen and (min-width: ' + $x + ')'; 135 | } 136 | 137 | // Less than or equal (<= inf / anything) 138 | @elseif ($op == 'lte') { 139 | $media: 'screen'; 140 | } 141 | 142 | // Greater than (> inf / invalid) 143 | @elseif ($op == 'gt') { 144 | $media: 'screen and (max-width: -1px)'; 145 | } 146 | 147 | // Less than (< x) 148 | @elseif ($op == 'lt') { 149 | $media: 'screen and (max-width: ' + ($x - 1) + ')'; 150 | } 151 | 152 | // Not (< x) 153 | @elseif ($op == 'not') { 154 | $media: 'screen and (max-width: ' + ($x - 1) + ')'; 155 | } 156 | 157 | // Equal (>= x) 158 | @else { 159 | $media: 'screen and (min-width: ' + $x + ')'; 160 | } 161 | 162 | } 163 | 164 | // Min and max. 165 | @else { 166 | 167 | // Greater than or equal (>= x) 168 | @if ($op == 'gte') { 169 | $media: 'screen and (min-width: ' + $x + ')'; 170 | } 171 | 172 | // Less than or equal (<= y) 173 | @elseif ($op == 'lte') { 174 | $media: 'screen and (max-width: ' + $y + ')'; 175 | } 176 | 177 | // Greater than (> y) 178 | @elseif ($op == 'gt') { 179 | $media: 'screen and (min-width: ' + ($y + 1) + ')'; 180 | } 181 | 182 | // Less than (< x) 183 | @elseif ($op == 'lt') { 184 | $media: 'screen and (max-width: ' + ($x - 1) + ')'; 185 | } 186 | 187 | // Not (< x and > y) 188 | @elseif ($op == 'not') { 189 | $media: 'screen and (max-width: ' + ($x - 1) + '), screen and (min-width: ' + ($y + 1) + ')'; 190 | } 191 | 192 | // Equal (>= x and <= y) 193 | @else { 194 | $media: 'screen and (min-width: ' + $x + ') and (max-width: ' + $y + ')'; 195 | } 196 | 197 | } 198 | 199 | } 200 | 201 | // String. 202 | @else { 203 | 204 | // Missing a media type? Prefix with "screen". 205 | @if (str-slice($a, 0, 1) == '(') { 206 | $media: 'screen and ' + $a; 207 | } 208 | 209 | // Otherwise, use as-is. 210 | @else { 211 | $media: $a; 212 | } 213 | 214 | } 215 | 216 | } 217 | 218 | // Output. 219 | @media #{$media} { 220 | @content; 221 | } 222 | 223 | } -------------------------------------------------------------------------------- /public/assets/sass/libs/_functions.scss: -------------------------------------------------------------------------------- 1 | /// Removes a specific item from a list. 2 | /// @author Hugo Giraudel 3 | /// @param {list} $list List. 4 | /// @param {integer} $index Index. 5 | /// @return {list} Updated list. 6 | @function remove-nth($list, $index) { 7 | 8 | $result: null; 9 | 10 | @if type-of($index) != number { 11 | @warn "$index: #{quote($index)} is not a number for `remove-nth`."; 12 | } 13 | @else if $index == 0 { 14 | @warn "List index 0 must be a non-zero integer for `remove-nth`."; 15 | } 16 | @else if abs($index) > length($list) { 17 | @warn "List index is #{$index} but list is only #{length($list)} item long for `remove-nth`."; 18 | } 19 | @else { 20 | 21 | $result: (); 22 | $index: if($index < 0, length($list) + $index + 1, $index); 23 | 24 | @for $i from 1 through length($list) { 25 | 26 | @if $i != $index { 27 | $result: append($result, nth($list, $i)); 28 | } 29 | 30 | } 31 | 32 | } 33 | 34 | @return $result; 35 | 36 | } 37 | 38 | /// Gets a value from a map. 39 | /// @author Hugo Giraudel 40 | /// @param {map} $map Map. 41 | /// @param {string} $keys Key(s). 42 | /// @return {string} Value. 43 | @function val($map, $keys...) { 44 | 45 | @if nth($keys, 1) == null { 46 | $keys: remove-nth($keys, 1); 47 | } 48 | 49 | @each $key in $keys { 50 | $map: map-get($map, $key); 51 | } 52 | 53 | @return $map; 54 | 55 | } 56 | 57 | /// Gets a duration value. 58 | /// @param {string} $keys Key(s). 59 | /// @return {string} Value. 60 | @function _duration($keys...) { 61 | @return val($duration, $keys...); 62 | } 63 | 64 | /// Gets a font value. 65 | /// @param {string} $keys Key(s). 66 | /// @return {string} Value. 67 | @function _font($keys...) { 68 | @return val($font, $keys...); 69 | } 70 | 71 | /// Gets a misc value. 72 | /// @param {string} $keys Key(s). 73 | /// @return {string} Value. 74 | @function _misc($keys...) { 75 | @return val($misc, $keys...); 76 | } 77 | 78 | /// Gets a palette value. 79 | /// @param {string} $keys Key(s). 80 | /// @return {string} Value. 81 | @function _palette($keys...) { 82 | @return val($palette, $keys...); 83 | } 84 | 85 | /// Gets a size value. 86 | /// @param {string} $keys Key(s). 87 | /// @return {string} Value. 88 | @function _size($keys...) { 89 | @return val($size, $keys...); 90 | } -------------------------------------------------------------------------------- /public/assets/sass/libs/_hover.scss: -------------------------------------------------------------------------------- 1 | /* Underline From Left */ 2 | .hvr-underline-from-left { 3 | display: inline-block; 4 | vertical-align: middle; 5 | -webkit-transform: perspective(1px) translateZ(0); 6 | transform: perspective(1px) translateZ(0); 7 | box-shadow: 0 0 1px rgba(0, 0, 0, 0); 8 | position: relative; 9 | overflow: hidden; 10 | } 11 | .hvr-underline-from-left:before { 12 | content: ""; 13 | position: absolute; 14 | z-index: -1; 15 | left: 0; 16 | right: 100%; 17 | bottom: 0; 18 | background: #2098D1; 19 | height: 4px; 20 | -webkit-transition-property: right; 21 | transition-property: right; 22 | -webkit-transition-duration: 0.3s; 23 | transition-duration: 0.3s; 24 | -webkit-transition-timing-function: ease-out; 25 | transition-timing-function: ease-out; 26 | } 27 | .hvr-underline-from-left:hover:before, .hvr-underline-from-left:focus:before, .hvr-underline-from-left:active:before { 28 | right: 0; 29 | } -------------------------------------------------------------------------------- /public/assets/sass/main.scss: -------------------------------------------------------------------------------- 1 | @import 'libs/functions'; 2 | @import 'libs/breakpoints'; 3 | @import 'libs/hover'; 4 | @import 'navbar'; 5 | @import url('https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,300,200'); 6 | 7 | /* 8 | Halcyonic by HTML5 UP 9 | html5up.net | @ajlkn 10 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 11 | */ 12 | 13 | // Breakpoints. 14 | 15 | @include breakpoints(( 16 | xlarge: ( 1281px, 1680px ), 17 | large: ( 981px, 1280px ), 18 | medium: ( 737px, 980px ), 19 | small: ( null, 736px ) 20 | )); 21 | @font-face { 22 | font-family: mainFont; 23 | src: url("../../fonts/UbuntuCondensed-Regular.ttf"); 24 | } 25 | // Reset. 26 | // Based on meyerweb.com/eric/tools/css/reset (v2.0 | 20110126 | License: public domain) 27 | *{ 28 | box-sizing: border-box; 29 | } 30 | html, body, div, span, applet, object, 31 | iframe, h1, h2, h3, h4, h5, h6, p, blockquote, 32 | pre, a, abbr, acronym, address, big, cite, 33 | code, del, dfn, em, img, ins, kbd, q, s, samp, 34 | small, strike, strong, sub, sup, tt, var, b, 35 | u, i, center, dl, dt, dd, ol, ul, li, fieldset, 36 | form, label, legend, table, caption, tbody, 37 | tfoot, thead, tr, th, td, article, aside, 38 | canvas, details, embed, figure, figcaption, 39 | footer, header, hgroup, menu, nav, output, ruby, 40 | section, summary, time, mark, audio, video { 41 | margin: 0; 42 | padding: 0; 43 | border: 0; 44 | font-size: 100%; 45 | font: inherit; 46 | vertical-align: baseline; 47 | } 48 | html{ 49 | height: 100%; 50 | } 51 | body section{ 52 | 53 | position: relative; 54 | min-height: 86.5vh; 55 | 56 | } 57 | article, aside, details, figcaption, figure, 58 | footer, header, hgroup, menu, nav, section { 59 | display: block; 60 | } 61 | hr 62 | { 63 | margin: 0; 64 | padding: 0; 65 | } 66 | body { 67 | line-height: 1; 68 | } 69 | 70 | ol, ul { 71 | list-style: none; 72 | } 73 | 74 | blockquote, q { 75 | quotes: none; 76 | 77 | &:before, 78 | &:after { 79 | content: ''; 80 | content: none; 81 | } 82 | } 83 | 84 | table { 85 | border-collapse: collapse; 86 | border-spacing: 0; 87 | } 88 | 89 | body { 90 | -webkit-text-size-adjust: none; 91 | } 92 | 93 | mark { 94 | background-color: transparent; 95 | color: inherit; 96 | } 97 | 98 | input::-moz-focus-inner { 99 | border: 0; 100 | padding: 0; 101 | } 102 | 103 | input, textarea, button { 104 | -webkit-appearance: none; 105 | -webkit-font-smoothing: antialiased; 106 | resize: none; 107 | } 108 | input[type="radio"]{ 109 | -webkit-appearance: radio; 110 | } 111 | .mb-em{ 112 | margin-bottom: 1em; 113 | } 114 | .mt-em{ 115 | margin-top: 1em; 116 | } 117 | .row{ 118 | margin: 0; 119 | } 120 | /* Basic */ 121 | 122 | // Set box model to border-box. 123 | // Based on css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice 124 | html { 125 | box-sizing: border-box; 126 | } 127 | 128 | *, *:before, *:after { 129 | box-sizing: inherit; 130 | } 131 | 132 | body { 133 | background: #D4D9DD; 134 | color: #474f51; 135 | font-size: 13.5pt; 136 | font-family: mainFont; 137 | line-height: 1.85em; 138 | font-weight: 300; 139 | } 140 | 141 | input, textarea, select { 142 | color: #474f51; 143 | font-size: 13.5pt; 144 | font-family: mainFont; 145 | line-height: 1.85em; 146 | font-weight: 300; 147 | } 148 | 149 | 150 | 151 | a { 152 | text-decoration: none; 153 | 154 | &:hover { 155 | text-decoration: none; 156 | } 157 | } 158 | 159 | section > :last-child, 160 | section:last-child, 161 | .last-child { 162 | margin-bottom: 0 !important; 163 | } 164 | 165 | /* Container */ 166 | 167 | .container { 168 | margin: 0 auto; 169 | max-width: 100%; 170 | width: 1300px; 171 | padding-left: 0; 172 | 173 | @include breakpoint('<=xlarge') { 174 | width: 1300px; 175 | } 176 | 177 | @include breakpoint('<=large') { 178 | width: calc(100% - 40px); 179 | } 180 | 181 | @include breakpoint('<=medium') { 182 | width: calc(100% - 50px); 183 | } 184 | 185 | @include breakpoint('<=small') { 186 | width: calc(100% - 40px); 187 | } 188 | } 189 | 190 | a{ 191 | text-decoration: none; 192 | } 193 | .pre{ 194 | background-color: #e0e0e0; 195 | border-radius: 10px; 196 | color: rgba(0,0,0,.9); 197 | font-family: Consolas,monospace; 198 | margin-bottom: 10px; 199 | overflow: auto; 200 | padding: 10px; 201 | } 202 | #content{ 203 | .box{ 204 | background-color: white; 205 | .header{ 206 | margin-bottom: 1rem; 207 | h2{ 208 | font-size: 24px; 209 | } 210 | } 211 | .pre{ 212 | background-color: #e0e0e0; 213 | border-radius: 10px; 214 | color: rgba(0,0,0,.9); 215 | font-family: Consolas,monospace; 216 | margin-bottom: 10px; 217 | overflow: auto; 218 | padding: 10px; 219 | } 220 | } 221 | } 222 | .boxFriend{ 223 | background-color: #fff; 224 | padding: 5px; 225 | border: 1.5px solid #474f51; 226 | margin: 5px; 227 | position: relative; 228 | border-radius: 5px; 229 | .iconRemove{ 230 | position: absolute; 231 | right: 5px; 232 | } 233 | } 234 | .join 235 | { 236 | cursor: pointer; 237 | } 238 | .boxName 239 | { 240 | width: 35px; 241 | height: 35px; 242 | border-radius: 50%; 243 | margin-right: 5px; 244 | background-color: #474f51; 245 | color:#D4D9DD; 246 | display: flex; 247 | justify-content: center; 248 | } 249 | @include breakpoint('<=xlarge') { 250 | 251 | } 252 | 253 | @include breakpoint('<=large') { 254 | 255 | } 256 | 257 | @include breakpoint('<=medium') { 258 | .slash{ 259 | display: none; 260 | } 261 | } 262 | 263 | @include breakpoint('<=small') { 264 | 265 | } 266 | -------------------------------------------------------------------------------- /public/fonts/UbuntuCondensed-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/public/fonts/UbuntuCondensed-Regular.ttf -------------------------------------------------------------------------------- /public/images/developer.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/public/images/developer.PNG -------------------------------------------------------------------------------- /public/images/developer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/public/images/developer.jpg -------------------------------------------------------------------------------- /public/images/mountains.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/public/images/mountains.jpg -------------------------------------------------------------------------------- /public/images/problem.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/public/images/problem.jpg -------------------------------------------------------------------------------- /public/images/student.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/public/images/student.jpg -------------------------------------------------------------------------------- /routes/Documentation.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const verify=require('./verifiyToken'); 3 | const connection=require('./server'); 4 | router.get('/documentations',verify,(req,res)=>{ 5 | let token = req.user; 6 | let arrDocumentation=[]; 7 | 8 | let query =`select * from NyZaKa.Documentation;`; 9 | connection.query(query, async (error, results, fields)=> { 10 | if (error) res.send(error); 11 | //res.render('/Blogs'); 12 | 13 | results.forEach(element => { 14 | let documentation={ 15 | ID:element.ID, 16 | DocName:element.DocName, 17 | Topic:element.Topic, 18 | Statment:element.Statment, 19 | Doc_date:element.Doc_date.toLocaleDateString("en-US").split("-") 20 | } 21 | arrDocumentation.push(documentation); 22 | }); 23 | let arrTopics=[]; 24 | let getTopic=`select DISTINCT Topic from NyZaKa.Documentation` 25 | connection.query(getTopic, async (error, results, fields)=> { 26 | if (error) res.send(error); 27 | if(results.length!=0) 28 | { 29 | results.forEach(t=>{ 30 | arrTopics.push(t.Topic); 31 | }); 32 | } 33 | res.render('documentations',{user:req.user,arrTopics, Current_Nav:'Documentation',documentations:arrDocumentation}); 34 | }); 35 | // console.log(arrArticles); 36 | 37 | }); 38 | 39 | }); 40 | 41 | router.get('/Documentation/:id',verify,(req,res)=>{ 42 | let token = req.user; 43 | 44 | 45 | let query=`SELECT * FROM NyZaKa.Documentation WHERE id=${req.params.id}`; 46 | connection.query(query, (error, results, fields)=> { 47 | if (error) throw error; 48 | //res.render('/Blogs'); 49 | if(!results.length) 50 | res.render('404',{user:req.user, Current_Nav:'__'}); 51 | else{ 52 | let documentation={ 53 | ID:results[0].ID, 54 | DocName:results[0].DocName, 55 | Topic:results[0].Topic, 56 | Statment:results[0].Statment, 57 | Doc_date:results[0].Doc_date.toLocaleDateString("en-US").split("-"), 58 | Writer:results[0].Writer 59 | } 60 | 61 | res.render('Documentation',{user:req.user, Current_Nav:'Documentation',documentation:documentation}); 62 | } 63 | }); 64 | }); 65 | 66 | router.delete('/Documentation/:id',verify,(req,res)=>{ 67 | let token = req.user; 68 | let query=`DELETE FROM NyZaKa.Documentation WHERE id=${parseInt(req.params.id)}`; 69 | connection.query(query, (error, results, fields)=> { 70 | if (error) throw error; 71 | res.json({redirect:'/documentations'}); 72 | }); 73 | }); 74 | 75 | router.get('/Documentation/edit/:id',verify,(req,res)=>{ 76 | let token = req.user; 77 | let query=`SELECT * FROM NyZaKa.Documentation WHERE id=${req.params.id}`; 78 | connection.query(query, (error, results, fields)=> { 79 | if (error) throw error; 80 | //res.render('/Blogs'); 81 | if(!results.length) 82 | res.render('404',{user:req.user, Current_Nav:'__'}); 83 | else{ 84 | let documentation={ 85 | ID:results[0].ID, 86 | DocName:results[0].DocName, 87 | Topic:results[0].Topic, 88 | Statment:results[0].Statment, 89 | Doc_date:results[0].Doc_date.toLocaleDateString("en-US").split("-"), 90 | Writer:results[0].Writer 91 | } 92 | 93 | res.render('editdocumentation',{user:req.user, Current_Nav:'Documentation',documentation:documentation}); 94 | } 95 | }); 96 | }); 97 | router.post('/Documentation/edit/:id',verify,(req,res)=>{ 98 | let token = req.user; 99 | if(!req.user||token.user.Acsess=="student") 100 | res.status(403).send("access denied"); 101 | let date_ob = new Date(); 102 | let date = ("0" + date_ob.getDate()).slice(-2); 103 | let month = ("0" + (date_ob.getMonth() + 1)).slice(-2); 104 | let year = date_ob.getFullYear(); 105 | 106 | let documentation={ 107 | id:parseInt(req.params.id), 108 | name: req.body.title, 109 | Topic:req.body.Topic, 110 | body:req.body.body, 111 | date:new Date().toISOString().slice(0, 19).replace('T', ' '), 112 | writer:token.user.Handle 113 | }; 114 | let query =`update NyZaKa.Documentation set DocName='${documentation.name}', Topic='${documentation.Topic}' ,Statment='${documentation.body}', Doc_date='${documentation.date}' where ID=${documentation.id};`; 115 | connection.query(query, async(error, results, fields)=> { 116 | if (error) res.send(error); 117 | res.redirect(`/documentations`); 118 | }); 119 | //res.render('createarticle',{user:req.user, Current_Nav:'articles'}); 120 | }); 121 | router.get('/createdocumentation',verify,(req,res)=>{ 122 | let token = req.user; 123 | if(!req.user||token.user.Acsess=="student") 124 | res.status(403).send("access denied"); 125 | res.render('createdocumentation',{user:req.user, Current_Nav:'Documentation'}); 126 | }); 127 | router.post('/createdocumentation',verify,(req,res)=>{ 128 | let token = req.user; 129 | if(!req.user||token.user.Acsess=="student") 130 | res.status(403).send("access denied"); 131 | let date_ob = new Date(); 132 | let date = ("0" + date_ob.getDate()).slice(-2); 133 | let month = ("0" + (date_ob.getMonth() + 1)).slice(-2); 134 | let year = date_ob.getFullYear(); 135 | 136 | let documentation={ 137 | name: req.body.title, 138 | Topic:req.body.Topic, 139 | body:req.body.body, 140 | date:new Date().toISOString().slice(0, 19).replace('T', ' '), 141 | writer:token.user.Handle 142 | }; 143 | let query =`insert into NyZaKa.Documentation(DocName,Topic,Statment,Doc_date,Writer) values("${documentation.name}","${documentation.Topic}","${documentation.body}","${documentation.date}","${documentation.writer}");`; 144 | connection.query(query, async(error, results, fields)=> { 145 | if (error) res.send(error); 146 | //res.render('/Blogs'); 147 | //res.redirect('/documentations'); 148 | res.send("documentation added successfully"); 149 | }); 150 | //res.render('createarticle',{user:req.user, Current_Nav:'articles'}); 151 | }); 152 | router.get('/documentations/Topics/:topic',verify,(req,res)=>{ 153 | let token = req.user; 154 | let query=`SELECT * FROM NyZaKa.Documentation WHERE Topic='${req.params.topic}'`; 155 | let arrDocumentation=[]; 156 | //console.log(req.params.id); 157 | connection.query(query, (error, results, fields)=> { 158 | if (error) throw error; 159 | //res.render('/Blogs'); 160 | //console.log(results.length) 161 | if(!results.length) 162 | res.render('404',{user:req.user, Current_Nav:'__'}); 163 | else 164 | { 165 | results.forEach(element => { 166 | let documentation={ 167 | ID:element.ID, 168 | DocName:element.DocName, 169 | Topic:element.Topic, 170 | Statment:element.Statment, 171 | Doc_date:element.Doc_date.toLocaleDateString("en-US").split("-") 172 | } 173 | arrDocumentation.push(documentation); 174 | }); 175 | 176 | let arrTopics=[]; 177 | let getTopic=`select DISTINCT Topic from NyZaKa.Documentation` 178 | connection.query(getTopic, async (error, results, fields)=> { 179 | if (error) res.send(error); 180 | if(results.length!=0) 181 | { 182 | results.forEach(t=>{ 183 | arrTopics.push(t.Topic); 184 | }); 185 | } 186 | //console.log(arrTopics); 187 | res.render('documentations',{user:req.user,arrTopics, Current_Nav:'Documentation',documentations:arrDocumentation}); 188 | }); 189 | 190 | 191 | } 192 | }); 193 | 194 | }); 195 | module.exports = router; -------------------------------------------------------------------------------- /routes/contests.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const { promiseImpl } = require('ejs'); 3 | const connection = require('./server'); 4 | const verify = require('./verifiyToken'); 5 | router.get('/contests', verify, (req, res) => { 6 | let token = req.user; 7 | 8 | let Contests = []; 9 | 10 | let query = `select * from NyZaKa.contest;`; 11 | connection.query(query, async (error, results, fields) => { 12 | 13 | if (error) res.send(error); 14 | 15 | if (results.length == 0) 16 | res.render('contests', { user: req.user, Current_Nav: 'contests', Contests }); 17 | 18 | results.forEach((element, index) => { 19 | let query2 = `select COUNT(*) AS Problems_Count FROM Contest_Problems WHERE Contest_ID = ${element.Contest_ID};`; 20 | connection.query(query2, (err, result, ff) => { 21 | if (err) res.send(err); 22 | let Num_Problems = result[0].Problems_Count; 23 | 24 | let Contest = { 25 | ID: element.Contest_ID, 26 | Day: element.Day_.toLocaleDateString("en-US").split("-"), 27 | Hour: element.Hour_, 28 | Duration: element.Duration, 29 | Num_Problems 30 | } 31 | Contests.push(Contest); 32 | // console.log(arrArticles); 33 | if (index === results.length - 1) 34 | res.render('contests', { user: req.user, Current_Nav: 'contests', Contests }); 35 | }); 36 | }); 37 | 38 | 39 | }); 40 | 41 | 42 | 43 | }) 44 | router.get('/Contest/:id', verify, (req, res) => { 45 | let token = req.user; 46 | 47 | let query1 = `SELECT * FROM nyzaka.contest_problems WHERE Contest_ID=${req.params.id}`; 48 | connection.query(query1, (error, results, fields) => { 49 | if (error) throw error; 50 | let All_Problems = []; 51 | results.forEach((contest_problem, index) => { 52 | let problemquery = `select * from Nyzaka.problem where problem_ID = ${contest_problem.Problem_ID};` 53 | connection.query(problemquery, (error2, problem_row) => { 54 | if (error2) res.send(error2); 55 | let SingleProblem = { 56 | Name: problem_row[0].NameProblem, 57 | statement: problem_row[0].statment, 58 | ID: problem_row[0].Problem_ID 59 | }; 60 | All_Problems.push(SingleProblem); 61 | if (index === results.length - 1) { 62 | res.render('contest', { user: req.user, Current_Nav: 'contests', All_Problems, ContestID: req.params.id }); 63 | } 64 | }); 65 | }); 66 | }); 67 | 68 | }); 69 | 70 | router.get('/createcontest', verify, (req, res) => { 71 | let token = req.user; 72 | if ( !req.user||token.user.Acsess == "student") 73 | res.status(403).send("access denied"); 74 | res.render('createcontest_problemsnum', { user: req.user, Current_Nav: 'contests' }); 75 | }); 76 | 77 | let ProblemsNumber; 78 | let startdate, starttime, duration; 79 | router.post('/createcontest', verify, (req, res) => { 80 | let token = req.user; 81 | var posttype = req.body.vote; 82 | if (posttype == "Next") { 83 | ProblemsNumber = req.body.NumProblems; 84 | startdate = req.body.startdate; 85 | starttime = req.body.starttime; 86 | duration = req.body.duration; 87 | res.render('createcontest_problems', { user: req.user, Current_Nav: 'contests', ProblemsNumber }); 88 | } 89 | else if (posttype == "Submit") { 90 | 91 | let i = -1; 92 | let abbas = []; 93 | for (prop in req.body) { 94 | i++; 95 | abbas.push(req.body[prop]); 96 | } 97 | let Problemsquery = `INSERT INTO NyZaKa.Problem (NameProblem, statment, Input_Format, Output_Format, Sample_Input, Sample_Output, input, output, Topic, score, difficulty, writer)values`; 98 | for (let j = 0; j < i / 11; j++) { 99 | Problemsquery += `('${abbas[0 + j * 11]}', '${abbas[1 + j * 11]}', '${abbas[2 + j * 11]}', '${abbas[3 + j * 11]}', '${abbas[4 + j * 11]}', '${abbas[5 + j * 11]}', '${abbas[6 + j * 11]}', '${abbas[7 + j * 11]}', '${abbas[8 + j * 11]}', '${abbas[9 + j * 11]}', '${abbas[10 + j * 11]}', '${token.user.Handle}')`; 100 | if (j == i / 11 - 1) Problemsquery += ";"; 101 | else Problemsquery += ","; 102 | } 103 | connection.query(Problemsquery, async (error, resul, fields) => { 104 | if (error) res.send(error); 105 | let lastproblemid = `SELECT LAST_INSERT_ID() as problems_start_ID;` 106 | connection.query(lastproblemid, async (er, last_inserted_problems_start_index) => { 107 | if (er) res.send(er); 108 | let contestquery = `insert into NyZaKa.contest (Day_,Hour_,Duration) values('${startdate}','${starttime}','${duration}'); `; 109 | connection.query(contestquery, async (err, last_insert_contest, fields) => { 110 | if (err) res.send(err); 111 | let lastcontestid = `SELECT LAST_INSERT_ID() as Contest_ID;`; 112 | connection.query(lastcontestid, async (error2, last_inserted_contest) => { 113 | if (error2) res.send(error2); 114 | let contest_problems = `insert into NyZaka.contest_problems (Contest_ID,Problem_ID) values`; 115 | for (let k = 0; k < i / 11; k++) { 116 | contest_problems += `(${last_inserted_contest[0].Contest_ID},${last_inserted_problems_start_index[0].problems_start_ID + k})`; 117 | if (k == i / 11 - 1) contest_problems += ";"; 118 | else contest_problems += ","; 119 | } 120 | connection.query(contest_problems, async (error3, Last_Query) => { 121 | if (error3) res.send(error3); 122 | res.send("contest added successfully"); 123 | }); 124 | }); 125 | 126 | }); 127 | }); 128 | 129 | }); 130 | } 131 | }); 132 | 133 | router.get('/Contest/:id/standing' , verify , (req,res) => { 134 | let token = req.user; 135 | let StandingQuery = `SELECT * FROM nyzaka.participate where contest_id = ${req.params.id} order by score desc;`; 136 | connection.query(StandingQuery , (error,standing) =>{ 137 | if(error) res.send(error); 138 | res.render('conteststanding', { user: req.user, Current_Nav: 'contests' , standing}); 139 | }); 140 | }); 141 | 142 | 143 | 144 | 145 | module.exports = router; -------------------------------------------------------------------------------- /routes/groups.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const verify = require('./verifiyToken'); 3 | const connection = require('./server'); 4 | 5 | router.get('/groups', verify, (req, res) => { 6 | let token = req.user; 7 | let ArrGroups = []; 8 | 9 | let query = `select * from NyZaKa.Groups_;`; 10 | connection.query(query, async (error, Groups, fields) => { 11 | if (error) res.send(error); 12 | 13 | if (Groups.length === 0) 14 | res.render('groups', { user: req.user, Current_Nav: 'groups', ArrGroups }); 15 | 16 | Groups.forEach((element, index1) => { //for each group 17 | let adminsquery = `select * from NyZaka.Group_Admins where Group_Name = '${element.Name_}';`; 18 | connection.query(adminsquery, (error2, Group_Admins) => { 19 | if (error2) res.send(error2); 20 | 21 | let group = { 22 | Name: element.Name_, 23 | Owner: element.Owner_, 24 | Admins: [] 25 | }; 26 | if (Group_Admins.length === 0 && index1 === Groups.length - 1) { 27 | ArrGroups.push(group); 28 | res.render('groups', { user: req.user, Current_Nav: 'groups', ArrGroups }); 29 | } 30 | if (Group_Admins.length === 0) { 31 | ArrGroups.push(group); 32 | } 33 | Group_Admins.forEach((row, index2) => { 34 | group.Admins.push(row.Group_Admin); 35 | 36 | if (index2 === Group_Admins.length - 1) 37 | ArrGroups.push(group); 38 | if (index1 === Groups.length - 1 && index2 === Group_Admins.length - 1) { 39 | res.render('groups', { user: req.user, Current_Nav: 'groups', ArrGroups }); 40 | } 41 | }); 42 | 43 | }); 44 | 45 | 46 | }); 47 | 48 | }); 49 | 50 | }); 51 | 52 | router.get('/creategroup', verify, (req, res) => { 53 | if(!req.user||req.user.user.Acsess=="student") 54 | res.status(403).send("access denied"); 55 | res.render('creategroup', {user: req.user, Current_Nav: 'groups' }); 56 | }); 57 | 58 | router.post('/creategroup', verify, (req, res) => { 59 | 60 | let group = { 61 | Name: req.body.GroupName, 62 | Admins: [] 63 | }; 64 | let admintemp = ""; 65 | let adminsnames = req.body.GroupAdmins; 66 | for (let i = 0; i < adminsnames.length; i++) { 67 | if (adminsnames[i] == " ") continue; 68 | else if (adminsnames[i] == '-') { 69 | group.Admins.push(admintemp); 70 | admintemp = ""; 71 | } 72 | else if (i == adminsnames.length - 1) { 73 | admintemp += adminsnames[i]; 74 | group.Admins.push(admintemp); 75 | } 76 | else admintemp += adminsnames[i]; 77 | } 78 | let query = `insert into nyzaka.Groups_ values('${group.Name}','${req.user.user.Handle}');`; 79 | connection.query(query, async (error, result, fields) => { 80 | if (error) res.send(error); 81 | if (group.Admins.length == 0) 82 | res.send('Group Added Successfully'); 83 | let query2 = `insert into nyzaka.group_admins values` 84 | for (let i = 0; i < group.Admins.length; i++) { 85 | query2 += `('${group.Name}','${group.Admins[i]}')`; 86 | if (i == group.Admins.length - 1) query2 += ";"; 87 | else query2 += ","; 88 | } 89 | connection.query(query2, async (error2, result, fields) => { 90 | if (error2) res.send(error2); 91 | res.send('Group Added Successfully'); 92 | }); 93 | }); 94 | }); 95 | 96 | router.post('/groups/:id', verify, (req, res) => { 97 | let query = `insert into nyzaka.group_members values ('${req.params.id}','${req.user.user.Handle}');`; 98 | connection.query(query, async (error, result, fields) => { 99 | res.json({ redirect: 'groups' }); 100 | }); 101 | }); 102 | 103 | router.get('/groups/:id', verify, (req, res) => { 104 | let query = `select * from NyZaKa.groups_ where Name_ = '${req.params.id}';`; 105 | connection.query(query, (error, Group_row) => { 106 | if (error) res.send(error); 107 | 108 | let group = { 109 | Name: Group_row[0].Name_, 110 | Owner: Group_row[0].Owner_, 111 | Admins: [], 112 | Members: [] 113 | }; 114 | let adminsquery = `select * from NyZaka.Group_Admins where Group_Name = '${group.Name}';`; 115 | connection.query(adminsquery, (error2, Group_Admins) => { 116 | if (error2) res.send(error2); 117 | 118 | for (let i = 0; i < Group_Admins.length; i++) 119 | group.Admins.push(Group_Admins[i].Group_Admin); 120 | 121 | let membersquery = `select * from NyZaka.Group_members where Group_Name = '${group.Name}';`; 122 | 123 | connection.query(membersquery, (error3, Group_Members) => { 124 | if (error3) res.send(error3); 125 | 126 | for (let i = 0; i < Group_Members.length; i++) { 127 | group.Members.push(Group_Members[i].Group_Member); 128 | } 129 | 130 | res.render('group', { user: req.user, Current_Nav: 'groups', group }); 131 | }); 132 | }); 133 | }); 134 | }); 135 | 136 | 137 | module.exports = router; -------------------------------------------------------------------------------- /routes/homepage.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const verify=require('./verifiyToken'); 3 | const connection = require('./server'); 4 | router.get('/',verify, async(req,res)=>{ 5 | if(!req.user) 6 | res.render('homepage2', { user:req.user , Current_Nav: 'Home'}); 7 | else 8 | { 9 | let arrArticles=[],arrFollowers=[]; 10 | let queryGetFriends=`SELECT followee from nyzaka.friends where follower = '${req.user.user.Handle}'`; 11 | 12 | connection.query(queryGetFriends, (error, results, fields)=> { 13 | if (error) res.send(error); 14 | results.forEach(element => { 15 | arrFollowers.push(element.followee); 16 | }); 17 | 18 | if(arrFollowers.length == 0) 19 | res.render('homepage', { user:req.user ,arrArticles, Current_Nav: 'Home'}); 20 | else 21 | { 22 | let queryGetArt="SELECT * from nyzaka.Articles where Writer = "; 23 | arrFollowers.forEach((element,index)=>{ 24 | 25 | if(index!=arrFollowers.length-1) 26 | queryGetArt+=`'${element}' or Writer = `; 27 | else 28 | queryGetArt+=`'${element}'`; 29 | }) 30 | connection.query(queryGetArt, (error, results, fields)=> { 31 | if (error) res.send(error); 32 | results.forEach(e=>{ 33 | e.date = e.Art_date; 34 | delete e.Art_date; 35 | e.type="Article" 36 | arrArticles.push(e); 37 | }) 38 | 39 | 40 | let queryGetDoc="SELECT * from nyzaka.Documentation where Writer = "; 41 | arrFollowers.forEach((element,index)=>{ 42 | 43 | if(index!=arrFollowers.length-1) 44 | queryGetDoc+=`'${element}' or Writer = `; 45 | else 46 | queryGetDoc+=`'${element}'`; 47 | }) 48 | connection.query(queryGetDoc, (error, results, fields)=> { 49 | if (error) res.send(error); 50 | 51 | results.forEach(e=>{ 52 | e.date = e.Doc_date; 53 | delete e.Doc_date; 54 | e.type="Documentation" 55 | arrArticles.push(e); 56 | }) 57 | arrArticles.sort((a, b) => (a.date < b.date) ? 1 : -1) 58 | console.log(arrArticles); 59 | res.render('homepage', { user:req.user ,arrArticles, Current_Nav: 'Home'}); 60 | }); 61 | }) 62 | } 63 | }); 64 | } 65 | }); 66 | module.exports = router; -------------------------------------------------------------------------------- /routes/login.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const connection=require('./server'); 3 | const bcrypt=require('bcryptjs'); 4 | const jwt=require('jsonwebtoken'); 5 | 6 | const verifiyToken = require('./verifiyToken'); 7 | router.get('/login',verifiyToken,(req,res)=>{ 8 | if(req.user) 9 | res.redirect('profile'); 10 | res.render('login',{user:req.user,Current_Nav:'_'}); 11 | }) 12 | router.post('/login',async(req,res)=>{ 13 | 14 | //1- check there are not exist email 15 | let user={"username":req.body.username, 16 | "email":req.body.email, 17 | }; 18 | //console.log(req.body.inlineRadioOptions); 19 | let emailExist =`select * from NyZaKa.Users where Handle="${req.body.username}"`; 20 | connection.query(emailExist, async (error, results, fields)=> { 21 | if (error) res.send(error); 22 | //res.render('/Blogs'); 23 | if(results[0])// if exist 24 | { 25 | let user=results[0]; 26 | //TO DO 27 | // need validations here 28 | 29 | //compare password 30 | 31 | const isvaildpass=await bcrypt.compare(req.body.password,user.Password_); 32 | 33 | if(!isvaildpass&&req.body.password!=user.Password_) 34 | res.status(400).send("invalid password"); 35 | else if(isvaildpass||req.body.password==user.Password_){ 36 | //create token 37 | const token = jwt.sign({user},"1234"); 38 | res.cookie('token', token, { 39 | secure: false, // set to true if your using https 40 | httpOnly: true, 41 | }); 42 | //console.log(res.header('authorization')); 43 | res.send("login in success"); 44 | } 45 | } 46 | else 47 | res.send("email doesn't exists please sign up"); 48 | 49 | }); 50 | }); 51 | module.exports = router; -------------------------------------------------------------------------------- /routes/logout.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const connection=require('./server'); 3 | router.get('/logout',(req,res)=>{ 4 | res.clearCookie("token"); 5 | res.render("homepage2",{user:req.user, Current_Nav: 'Home'}); 6 | }); 7 | 8 | module.exports = router; -------------------------------------------------------------------------------- /routes/problemset.js: -------------------------------------------------------------------------------- 1 | const router = require("express").Router(); 2 | const connection = require("./server"); 3 | const verify = require("./verifiyToken"); 4 | router.get("/problemset", verify, (req, res) => { 5 | let token = req.user; 6 | let Problemset = []; 7 | 8 | let query = `select * from NyZaKa.Problem`; 9 | connection.query(query, async (error, results, fields) => { 10 | if (error) res.send(error); 11 | 12 | results.forEach((element) => { 13 | let Problem = { 14 | ID: element.Problem_ID, 15 | Name: element.NameProblem, 16 | statement: element.statment, 17 | }; 18 | Problemset.push(Problem); 19 | }); 20 | // console.log(arrArticles); 21 | res.render("problemset", { 22 | user: req.user, 23 | Current_Nav: "problemset", 24 | Problemset, 25 | }); 26 | }); 27 | }); 28 | 29 | router.get("/problems/:id", verify, (req, res) => { 30 | let token = req.user; 31 | let query = `SELECT * FROM NyZaKa.Problem WHERE problem_id=${req.params.id}`; 32 | connection.query(query, (error, results, fields) => { 33 | if (error) throw error; 34 | let Problem = { 35 | //////////HERE IS THE Problem 36 | ID: results[0].Problem_ID, 37 | Name: results[0].NameProblem, 38 | Topic: results[0].Topic, 39 | Writer: results[0].writer, 40 | Input: results[0].input, 41 | statement: results[0].statment, 42 | Input_Format: results[0].Input_Format, 43 | Output_Format: results[0].Output_Format, 44 | Sample_Input: results[0].Sample_Input, 45 | Sample_Output: results[0].Sample_Output, 46 | Score: results[0].Score, 47 | Difficulty: results[0].Difficulty, 48 | }; 49 | res.render("problem", { 50 | user: req.user, 51 | Current_Nav: "problemset", 52 | Problem, 53 | }); 54 | }); 55 | }); 56 | 57 | router.get("/problems/edit/:id", verify, (req, res) => { 58 | let token = req.user; 59 | let query = `SELECT * FROM NyZaKa.Problem WHERE problem_id=${req.params.id}`; 60 | connection.query(query, (error, results, fields) => { 61 | if (error) throw error; 62 | 63 | if (!results.length) 64 | res.render("404", { user: req.user, Current_Nav: "__" }); 65 | else { 66 | let Problem = { 67 | //////////HERE IS THE Problem 68 | ID: results[0].Problem_ID, 69 | Name: results[0].NameProblem, 70 | Topic: results[0].Topic, 71 | Writer: results[0].writer, 72 | Input: results[0].input, 73 | Output: results[0].output, 74 | statement: results[0].statment, 75 | Input_Format: results[0].Input_Format, 76 | Output_Format: results[0].Output_Format, 77 | Sample_Input: results[0].Sample_Input, 78 | Sample_Output: results[0].Sample_Output, 79 | Score: results[0].Score, 80 | Difficulty: results[0].Difficulty, 81 | }; 82 | 83 | res.render("editproblem", { 84 | user: req.user, 85 | Current_Nav: "probemset", 86 | Problem: Problem, 87 | }); 88 | } 89 | }); 90 | }); 91 | 92 | router.post("/problems/edit/:id", verify, (req, res) => { 93 | let token = req.user; 94 | if (token.user.Acsess == "student" || !req.user) 95 | res.status(403).send("access denied"); 96 | let Problem = { 97 | ID: parseInt(req.params.id), 98 | Name: req.body.title, 99 | statement: req.body.body, 100 | InputFormat: req.body.problemInputFormat, 101 | OutputFormat: req.body.problemOutputFormat, 102 | Input: req.body.problemInput, 103 | Output: req.body.problemOutput, 104 | Topic: req.body.Topic, 105 | Writer: token.user.Handle, 106 | Score: req.body.Score, 107 | Difficulty: req.body.Difficulty, 108 | Sample_Input: req.body.SampleInput, 109 | Sample_Output: req.body.SampleOutput, 110 | }; 111 | let query = `Update NyZaKa.Problem set Topic='${Problem.Topic}',NameProblem='${Problem.Name}',writer='${Problem.Writer}',input='${Problem.Input}',output='${Problem.Output}',statment='${Problem.statement}',Input_Format='${Problem.InputFormat}',Output_Format='${Problem.OutputFormat}',score=${Problem.Score},difficulty=${Problem.Difficulty},Sample_Input='${Problem.Sample_Input}',Sample_Output='${Problem.Sample_Output}' where Problem_ID=${Problem.ID};`; 112 | connection.query(query, async (error, results, fields) => { 113 | if (error) res.send(error); 114 | res.redirect("/problemset"); 115 | }); 116 | }); 117 | /*Delete is Disabled*/ 118 | /*router.delete("/problems/:id", verify, (req, res) => { 119 | let token = req.user; 120 | let query = `DELETE FROM NyZaKa.Problem WHERE Problem_ID=${req.params.id};`; 121 | connection.query(query, (error, results, fields) => { 122 | if (error) res.send(error); 123 | res.json({ redirect: "/problemset" }); 124 | }); 125 | });*/ 126 | 127 | router.get("/createproblem", verify, (req, res) => { 128 | let token = req.user; 129 | if (!req.user || token.user.Acsess == "student") 130 | res.status(403).send("access denied"); 131 | res.render("createproblem", { user: req.user, Current_Nav: "problemset" }); 132 | }); 133 | 134 | router.post("/createproblem", verify, (req, res) => { 135 | let token = req.user; 136 | if (token.user.Acsess == "student" || !req.user) 137 | res.status(403).send("access denied"); 138 | 139 | let Problem = { 140 | Name: req.body.title, 141 | statement: req.body.body, 142 | InputFormat: req.body.problemInputFormat, 143 | OutputFormat: req.body.problemOutputFormat, 144 | Input: req.body.problemInput, 145 | Output: req.body.problemOutput, 146 | Topic: req.body.Topic, 147 | Writer: token.user.Handle, 148 | Score: req.body.Score, 149 | Difficulty: req.body.Difficulty, 150 | Sample_Input: req.body.SampleInput, 151 | Sample_Output: req.body.SampleOutput, 152 | }; 153 | 154 | let query = `INSERT INTO NyZaKa.Problem 155 | (Topic, NameProblem, writer, input, output, statment, Input_Format, Output_Format, score, difficulty,Sample_Input,Sample_Output) 156 | values('${Problem.Topic}','${Problem.Name}','${Problem.Writer}','${Problem.Input}','${Problem.Output}','${Problem.statement}','${Problem.InputFormat}','${Problem.OutputFormat}','${Problem.Score}','${Problem.Difficulty}','${Problem.Sample_Input}','${Problem.Sample_Output}');`; 157 | connection.query(query, async (error, results, fields) => { 158 | if (error) res.send(error); 159 | //res.render('/Blogs'); 160 | //res.redirect('/problemset'); 161 | res.send("Problem added successfully"); 162 | }); 163 | }); 164 | 165 | module.exports = router; 166 | -------------------------------------------------------------------------------- /routes/search.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const verify = require('./verifiyToken'); 3 | const connection = require('./server'); 4 | router.post('/search', verify, (req, res) => { 5 | 6 | let searchData = req.body.search; 7 | let arrUsers = [], arrArt = [], arrDoc = [], arrGroups = [], arrproblems = []; 8 | let findUsers = `SELECT * FROM NyZaKa.Users WHERE handle LIKE "%${searchData}%"`; 9 | let findarticles = `SELECT * FROM NyZaKa.Articles WHERE ArtName LIKE "%${searchData}%"`; 10 | let finddocumentation = `SELECT * FROM NyZaKa.Documentation WHERE DocName LIKE "%${searchData}%"`; 11 | let findgroup = `SELECT * FROM NyZaKa.Groups_ WHERE Name_ LIKE "%${searchData}%"`; 12 | let findarticlesbywriter = `SELECT * FROM NyZaKa.Articles join nyzaka.users on NyZaKa.users.Handle = NyZaKa.Articles.writer where NyZaKa.Articles.writer LIKE "%${searchData}%"`; 13 | let finddocumentationbywriter = `SELECT * FROM NyZaKa.Documentation join nyzaka.users on NyZaKa.users.Handle = NyZaKa.Documentation.writer where NyZaKa.Documentation.writer LIKE "%${searchData}%"`; 14 | let findgroupbywriter = `SELECT * FROM NyZaKa.Groups_ join nyzaka.users on NyZaKa.users.Handle = NyZaKa.Groups_.Owner_ where NyZaKa.Groups_.Owner_ LIKE "%${searchData}%"`; 15 | let findproblem = `SELECT * FROM NyZaKa.problem WHERE NameProblem LIKE "%${searchData}%"`; 16 | let findproblembywriter = `SELECT * FROM NyZaKa.problem join nyzaka.users on NyZaKa.users.Handle = NyZaKa.problem.writer where NyZaKa.problem.writer LIKE "%${searchData}%"`; 17 | 18 | 19 | 20 | connection.query(findUsers, (error, results, fields) => { 21 | if (error) throw error; 22 | results.forEach(element => { 23 | let userProfile = { 24 | Handle: element.Handle, 25 | Acsess: element.Acsess, 26 | E_mail: element.E_mail, 27 | Fname: element.Fname, 28 | Lname: element.Lname, 29 | Rate_max: element.Rate_max, 30 | numberOfFriends: 0 31 | } 32 | arrUsers.push(userProfile); 33 | 34 | }); 35 | 36 | connection.query(findarticles, (error, results, fields) => { 37 | if (error) throw error; 38 | results.forEach(element => { 39 | let article = { 40 | ID: element.ID, 41 | ArtName: element.ArtName, 42 | Topic: element.Topic, 43 | Statment: element.Statment, 44 | Art_date: element.Art_date.toLocaleDateString("en-US").split("-") 45 | } 46 | arrArt.push(article); 47 | }); 48 | connection.query(findarticlesbywriter, (error, results, fields) => { 49 | if (error) throw error; 50 | results.forEach(element => { 51 | let article = { 52 | ID: element.ID, 53 | ArtName: element.ArtName, 54 | Topic: element.Topic, 55 | Statment: element.Statment, 56 | Art_date: element.Art_date.toLocaleDateString("en-US").split("-") 57 | } 58 | arrArt.push(article); 59 | }); 60 | }); 61 | connection.query(finddocumentation, (error, results, fields) => { 62 | if (error) throw error; 63 | results.forEach(element => { 64 | let documentation = { 65 | ID: element.ID, 66 | DocName: element.DocName, 67 | Topic: element.Topic, 68 | Statment: element.Statment, 69 | Doc_date: element.Doc_date.toLocaleDateString("en-US").split("-") 70 | } 71 | arrDoc.push(documentation); 72 | 73 | }); 74 | }); 75 | connection.query(finddocumentationbywriter, (error, results, fields) => { 76 | if (error) throw error; 77 | results.forEach(element => { 78 | let documentation = { 79 | ID: element.ID, 80 | DocName: element.DocName, 81 | Topic: element.Topic, 82 | Statment: element.Statment, 83 | Doc_date: element.Doc_date.toLocaleDateString("en-US").split("-") 84 | } 85 | arrDoc.push(documentation); 86 | 87 | }); 88 | }); 89 | 90 | connection.query(findgroupbywriter, (error, results, fields) => { 91 | if (error) throw error; 92 | results.forEach(element => { 93 | let group = { 94 | Name: element.Name_, 95 | Owner: element.Owner_, 96 | Admins: [] 97 | }; 98 | arrGroups.push(group); 99 | 100 | }); 101 | 102 | connection.query(findgroup, (error, results, fields) => { 103 | if (error) throw error; 104 | results.forEach(element => { 105 | let group = { 106 | Name: element.Name_, 107 | Owner: element.Owner_, 108 | // ID: element.ID, 109 | Admins: [] 110 | }; 111 | arrGroups.push(group); 112 | 113 | }); 114 | connection.query(findproblem, (error, results, fields) => { 115 | if (error) throw error; 116 | results.forEach(element => { 117 | let Problem = { 118 | ID: element.Problem_ID, 119 | Name: element.NameProblem, 120 | statement: element.statment, 121 | } 122 | arrproblems.push(Problem); 123 | 124 | }); 125 | 126 | connection.query(findproblembywriter, (error, results, fields) => { 127 | if (error) throw error; 128 | results.forEach((element, index) => { 129 | let Problem = { 130 | ID: element.Problem_ID, 131 | Name: element.NameProblem, 132 | statement: element.statment, 133 | } 134 | arrproblems.push(Problem); 135 | 136 | 137 | }); 138 | res.render('searchResult', { user: req.user, arrUsers, arrArt, arrDoc, arrGroups, arrproblems, Current_Nav: '__' }); 139 | }); 140 | 141 | }); 142 | 143 | }); 144 | 145 | }); 146 | }); 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | //console.log(arrGroups); 167 | //res.render('searchResult', {user: req.user,listUsers:arrUsers,listArt:arrArt,listDoc:arrDoc,listGroups:arrGroups, Current_Nav: 'groups' }); 168 | 169 | 170 | // res.render('searchResult', {user: req.user,listUsers:arrUsers,listArt:arrArt,listDoc:arrDoc,listGroups:arrGroups, Current_Nav: 'groups' }); 171 | }); 172 | 173 | 174 | 175 | 176 | 177 | 178 | }); 179 | module.exports = router; -------------------------------------------------------------------------------- /routes/server.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | //connect to database 3 | var mysql = require("mysql"); 4 | var connection = mysql.createConnection({ 5 | host: "localhost", 6 | user: "root", 7 | password: "gaser011100", //change to ur password 8 | database: "NyZaKa", 9 | }); 10 | connection.connect((err) => { 11 | if (!err) console.log("Connected"); 12 | else console.log("connection failed"); 13 | }); 14 | module.exports = connection; 15 | -------------------------------------------------------------------------------- /routes/signup.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const connection=require('./server'); 3 | const bcrypt=require('bcryptjs'); 4 | const { verify } = require('jsonwebtoken'); 5 | const verifiyToken = require('./verifiyToken'); 6 | router.get('/signup',verifiyToken,(req,res)=>{ 7 | if(req.user) 8 | res.redirect('profile'); 9 | res.render('signup',{user:req.user,Current_Nav:'__'}); 10 | }) 11 | router.post('/signup',async(req,res)=>{ 12 | 13 | 14 | //1- check there are not exist email 15 | let user={"username":req.body.username, 16 | "email":req.body.email, 17 | }; 18 | //console.log(req.body.inlineRadioOptions); 19 | let emailExist =`select * from NyZaKa.Users where E_mail ="${req.body.email}" or Handle="${req.body.username}"`; 20 | connection.query(emailExist, async(error, results, fields)=> { 21 | if (error) res.send(error); 22 | //res.render('/Blogs'); 23 | if(!results[0])// not exist 24 | { 25 | //TO DO 26 | // need validations here 27 | 28 | //hash password 29 | const salt=await bcrypt.genSalt(10); 30 | const hashedpassword=await bcrypt.hash(req.body.password,salt); 31 | let query=`insert into NyZaKa.Users values("${req.body.username}","${req.body.inlineRadioOptions}","${req.body.email}","${hashedpassword}","${req.body.fname}","${req.body.lname}",0,0);`; 32 | connection.query(query, (error, results, fields)=> { 33 | if (error) res.send(error); 34 | //res.render('/Blogs'); 35 | res.send("sign up successfully"); 36 | }); 37 | } 38 | else 39 | { 40 | res.send("email exists"); 41 | //console.log(results[0]); 42 | } 43 | 44 | }); 45 | }); 46 | module.exports = router; -------------------------------------------------------------------------------- /routes/submission.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const verify = require('./verifiyToken'); 3 | const connection = require('./server'); 4 | 5 | router.post('/problems/:id', verify, (req, res) => { 6 | if (!req.user) 7 | res.status(403).send("Access Denied"); 8 | else { 9 | let submissionstatus = "Rejected"; 10 | let outputquery = `select output,score from nyzaka.problem where problem_ID = ${req.params.id};`; 11 | connection.query(outputquery, (error, problemoutput) => { 12 | if (error) res.send(error); 13 | 14 | if (req.body.output == problemoutput[0].output) 15 | submissionstatus = "Accepted"; 16 | 17 | let thisproblemscore = 0; 18 | if (submissionstatus == "Accepted") 19 | thisproblemscore = problemoutput[0].score; 20 | 21 | 22 | let submissionquery = `insert into nyzaka.submissions(problem_id,user_,time_ , output, submission_status) values 23 | (${req.params.id},'${req.user.user.Handle}',now(),'${req.body.output}','${submissionstatus}');`; 24 | connection.query(submissionquery, (error2, results) => { 25 | if (error2) res.send(error2); 26 | connection.query(`select contest_id from nyzaka.contest_problems where problem_id = ${req.params.id};`, (error3, contestrow) => { 27 | if (error3) res.send(error3); 28 | if (!contestrow[0]) //problem not in contest 29 | res.send(submissionstatus); 30 | 31 | else // problem in contest 32 | { 33 | connection.query(`SELECT * FROM nyzaka.participate where contest_id = ${contestrow[0].contest_id} and participant = '${req.user.user.Handle}';`, (error4, participationrow) => { 34 | if (error4) res.send(error4); 35 | 36 | if (!participationrow[0]) //user didn't participate before 37 | { 38 | connection.query(`insert into nyzaka.participate values(${contestrow[0].contest_id},'${req.user.user.Handle}',${thisproblemscore});`, (error5, resulltt) => { 39 | if (error5) res.send(error5); 40 | res.send(`${submissionstatus} .. your score in contest #${contestrow[0].contest_id} become ${thisproblemscore}`); 41 | }) 42 | } 43 | 44 | else //user participated before 45 | 46 | { 47 | if (submissionstatus == "Accepted"){ 48 | connection.query(`select count(*) as numsubmissions from nyzaka.submissions where problem_id = ${req.params.id} and user_ = '${req.user.user.Handle}' and Submission_Status = 'Accepted';` 49 | , (error6,usersubmissions) => { 50 | if(error6) res.send(error6); 51 | 52 | if (usersubmissions[0].numsubmissions == 1){ //user didn't solve the problem before 53 | connection.query(`update nyzaka.participate set score = score + ${thisproblemscore} where contest_id = ${contestrow[0].contest_id} and participant = '${req.user.user.Handle}'; ` 54 | , (error7,abbbb)=>{ 55 | if(error7) res.send(error7); 56 | 57 | res.send(`${submissionstatus} .. your score in contest #${contestrow[0].contest_id} become ${participationrow[0].Score + thisproblemscore}`); 58 | }); 59 | } 60 | else { //user solved the problem before 61 | res.send(`${submissionstatus} .. your score in contest #${contestrow[0].contest_id} become ${participationrow[0].Score}`); 62 | } 63 | 64 | }); 65 | } 66 | else{ 67 | res.send(`${submissionstatus} .. your score in contest #${contestrow[0].contest_id} become ${participationrow[0].Score}`); 68 | } 69 | } 70 | 71 | }); 72 | } 73 | 74 | }); 75 | 76 | }); 77 | }); 78 | } 79 | }); 80 | 81 | router.get('/problems/:id/submissions', verify, (req, res) => { 82 | let query = `select nyzaka.submissions.*, nyzaka.problem.NameProblem from nyzaka.submissions join nyzaka.problem on nyzaka.submissions.Problem_ID = nyzaka.problem.Problem_ID 83 | where nyzaka.submissions.problem_ID = ${req.params.id} order by Time_ desc ;`; 84 | connection.query(query, (error, results) => { 85 | if (error) res.send(error) 86 | let submissions = []; 87 | for (let i = 0; i < results.length; i++) { 88 | let submission = { 89 | ID: results[i].ID, 90 | Problem_ID: results[i].Problem_ID, 91 | Problem_Name: results[i].NameProblem, 92 | User: results[i].User_, 93 | Day: results[i].Time_.toISOString().split('T')[0], 94 | Time: results[i].Time_.toTimeString().split(' ')[0], 95 | output: results[i].Output, 96 | status: results[i].Submission_Status 97 | }; 98 | submissions.push(submission); 99 | } 100 | res.render('problemsubmissions', { user: req.user, Current_Nav: 'problemset', submissions }); 101 | }) 102 | }); 103 | 104 | module.exports = router; -------------------------------------------------------------------------------- /routes/teams.js: -------------------------------------------------------------------------------- 1 | const router = require("express").Router(); 2 | const verify = require("./verifiyToken"); 3 | const connection = require("./server"); 4 | router.get("/teams", verify, (req, res) => { 5 | let token = req.user; 6 | let query = `select * from NyZaKa.Teams where Member1='${req.user.user.Handle}' OR Member2='${req.user.user.Handle}' OR Member3='${req.user.user.Handle}';`; 7 | connection.query(query, async (error, Teams, fields) => { 8 | if (error) res.send(error); 9 | const arrTeams = []; 10 | Teams.forEach((element) => { 11 | let team = { 12 | name: element.Name_, 13 | maxRate: element.Team_Rate_max, 14 | curRate: element.Team_Rate_cur, 15 | member1: element.Member1, 16 | member2: element.Member2, 17 | member3: element.Member3, 18 | }; 19 | arrTeams.push(team); 20 | }); 21 | res.render("teams", { 22 | user: req.user, 23 | Current_Nav: "teams", 24 | Teams: arrTeams, 25 | }); 26 | //res.send(Teams); 27 | }); 28 | }); 29 | 30 | router.get("/createteam", verify, (req, res) => { 31 | if (!req.user) res.status(403).send("access denied"); 32 | res.render("createteam", { user: req.user, Current_Nav: "teams" }); 33 | }); 34 | 35 | router.post("/createteam", verify, (req, res) => { 36 | let team = { 37 | Name: req.body.teamName, 38 | Member2: req.body.teamMember2, 39 | Member3: req.body.teamMember3, 40 | }; 41 | let query1 = `select Name_ from NyZaKa.Teams where Name_='${team.Name}';`; 42 | connection.query(query1, async (error, result, fields) => { 43 | if (error) res.send(error); 44 | if (result.length == 1) { 45 | res.send("Name is already exists, Enter another name."); 46 | } 47 | }); 48 | let query2 = `select distinct Handle from NyZaKa.Users where Handle='${team.Members[0]}' or Handle='${team.Members[1]}' or Handle='${team.Members[2]}';`; 49 | connection.query(query2, async (error, result, fields) => { 50 | if (error) res.send(error); 51 | if (result.length < 3) { 52 | res.send( 53 | "Please, Enter valid usernames, Valid usernames should exist and shouldn't have duplicates." 54 | ); 55 | } 56 | }); 57 | 58 | let query = `insert into NyZaKa.Teams values('${team.Name}',0,0,'${team.Members[0]}','${team.Members[1]}','${team.Members[2]}');`; 59 | connection.query(query, async (error, result, fields) => { 60 | if (error) res.send(error); 61 | res.redirect("/teams"); 62 | }); 63 | }); 64 | 65 | module.exports = router; 66 | -------------------------------------------------------------------------------- /routes/verifiyToken.js: -------------------------------------------------------------------------------- 1 | const jwt=require('jsonwebtoken'); 2 | module.exports =function(req,res,next) 3 | { 4 | const token = req.cookies.token || ''; 5 | //console.log(token); 6 | if(token){ 7 | try{ 8 | const verfied=jwt.verify(token,"1234"); 9 | req.user=verfied; 10 | //console.log(req.user); 11 | next(); 12 | } catch(err){ 13 | res.status(400).send('invalid token'); 14 | } 15 | } 16 | else 17 | next(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /screenshots/1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/1.PNG -------------------------------------------------------------------------------- /screenshots/10.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/10.PNG -------------------------------------------------------------------------------- /screenshots/11.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/11.PNG -------------------------------------------------------------------------------- /screenshots/12.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/12.PNG -------------------------------------------------------------------------------- /screenshots/13.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/13.PNG -------------------------------------------------------------------------------- /screenshots/14.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/14.PNG -------------------------------------------------------------------------------- /screenshots/15.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/15.PNG -------------------------------------------------------------------------------- /screenshots/16.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/16.PNG -------------------------------------------------------------------------------- /screenshots/2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/2.PNG -------------------------------------------------------------------------------- /screenshots/3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/3.PNG -------------------------------------------------------------------------------- /screenshots/4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/4.PNG -------------------------------------------------------------------------------- /screenshots/5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/5.PNG -------------------------------------------------------------------------------- /screenshots/6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/6.PNG -------------------------------------------------------------------------------- /screenshots/7.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/7.PNG -------------------------------------------------------------------------------- /screenshots/8.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/8.PNG -------------------------------------------------------------------------------- /screenshots/9.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaserashraf/code_book/e93d265b6f7ad7b63fe50586fba8dd70a70b74bf/screenshots/9.PNG -------------------------------------------------------------------------------- /views/404.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%- include('./partials/nav.ejs') %> 24 | 25 |
26 |

Error 404

27 |
28 | 29 | <%- include('./partials/footer.ejs') %> 30 | 31 | 32 | <%- include('./partials/Scripts.ejs') %> 33 | 34 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /views/article.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%- include('./partials/nav.ejs') %> 24 | 25 |
26 |

27 |
28 |
29 | <%=article.ArtName%> 30 |
31 |
32 |

33 |
34 |
35 |
36 |

<%=article.ArtName%>

37 |

<%=article.Art_date%>

38 |

<%=article.Topic%>

39 |

40 | <%=article.Statment%> 41 |

42 | <%if(user&&user.user.Acsess=="developer" && user.user.Handle==article.Writer){%> 43 | Update 45 | Delete 47 | <%}%> 48 |
49 |
50 |
51 | 52 |
53 | <%- include('./partials/footer.ejs') %> 54 | 55 | 56 | <%- include('./partials/Scripts.ejs') %> 57 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /views/articles.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%- include('./partials/nav.ejs') %> 24 |
25 |
26 |
27 |
28 |

Articles 29 |

30 |
31 | 32 |
33 |
34 |
35 |
36 |
37 | <%arrTopics.forEach( (T,index)=>{%> 38 | 39 |
40 | <%=T%> 41 |
42 | <%if(index!=arrTopics.length-1){%> 43 |
44 | <%}%> 45 | <% })%> 46 |
47 |
48 | 69 |
70 |
71 | 72 | <%- include('./partials/footer.ejs') %> 73 | 74 | 75 | <%- include('./partials/Scripts.ejs') %> 76 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /views/contest.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Contest# <%= ContestID%> View standings

31 | 32 |
33 | 34 |
35 |
36 |
37 |
38 | 39 | <% All_Problems.forEach(Problem => {%> 40 | 41 | 42 |
43 |
44 |

<%=Problem.Name%>

45 |

<%=Problem.statement%>

46 |
47 |
48 | 49 |
50 |
51 |
52 | 53 | <%});%> 54 |
55 |
56 | 57 |
58 | <%- include('./partials/footer.ejs') %> 59 | 60 | 61 | <%- include('./partials/Scripts.ejs') %> 62 | 63 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /views/contests.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |
31 |

Contests 32 |

33 |
34 | 35 |
36 |
37 | 38 | <% Contests.forEach(contest => { %> 39 | 61 | <%});%> 62 | 63 |
64 |
65 | <%- include('./partials/footer.ejs') %> 66 | 67 | 68 | <%- include('./partials/Scripts.ejs') %> 69 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /views/conteststanding.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Contest 1

31 |
32 | 33 |
34 |
35 |
36 |
37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | <%standing.forEach( (p,index) => {%> 47 | 48 | 49 | 50 | 51 | 52 | <%});%> 53 | 54 |
#HandleScore
<%=index+1%><%=p.Participant%><%=p.Score%>
55 |
56 |
57 | 58 |
59 | <%- include('./partials/footer.ejs') %> 60 | 61 | 62 | <%- include('./partials/Scripts.ejs') %> 63 | 64 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /views/createarticle.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Create 31 | Article 32 |

33 |
34 | 35 |
36 |
37 |
38 | 39 |
40 |
41 |
42 |

Please fill all data to create article

43 |
44 |
45 | 48 |
49 |
50 | 52 |
53 | 55 |
56 | 57 |
58 | 59 | 60 |
61 |
62 |
63 |
64 |
65 | <%- include('./partials/footer.ejs') %> 66 | 67 | 68 | <%- include('./partials/Scripts.ejs') %> 69 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /views/createcontest_problems.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Create Problems 31 |

32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 |
40 | <% for(let i = 1 ; i <= ProblemsNumber ; i++){ %> 41 |
42 |

Please fill all data to create problem number <%=i%>

43 |
44 |
45 | 48 |
49 | 50 | 53 | 54 | 56 | 57 |
58 | 61 |
62 |
63 | 66 |
67 | 68 | 69 |
70 | 73 |
74 |
75 | 78 |
79 | 80 |
81 | 84 |
85 |
86 | 89 |
90 |
91 | 94 |
95 |
96 | 99 |
100 |
101 | 104 |
105 | 106 |
107 | <%}%> 108 |
109 | 111 |
112 |
113 |
114 |
115 |
116 | <%- include('./partials/footer.ejs') %> 117 | 118 | 119 | <%- include('./partials/Scripts.ejs') %> 120 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /views/createcontest_problemsnum.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Create Contest 31 |

32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 |
40 |
41 |

Please specify number of problems

42 |
43 |
44 | 46 |
47 |

Date

48 |
49 | 51 |
52 |

Start Time

53 |
54 | 56 |
57 |

Duration

58 |
59 | 61 |
62 | 63 | 65 |
66 |
67 |
68 |
69 |
70 | <%- include('./partials/footer.ejs') %> 71 | 72 | 73 | <%- include('./partials/Scripts.ejs') %> 74 | 75 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /views/createdocumentation.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Create 31 | Documentation 32 |

33 |
34 | 35 |
36 |
37 |
38 | 39 |
40 |
41 |
42 |

Please fill all data to create Documentation

43 |
44 |
45 | 48 |
49 |
50 | 52 |
53 | 55 |
56 | 57 |
58 | 59 | 60 |
61 |
62 |
63 |
64 |
65 | <%- include('./partials/footer.ejs') %> 66 | 67 | 68 | <%- include('./partials/Scripts.ejs') %> 69 | 70 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /views/creategroup.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%- include('./partials/nav.ejs') %> 24 | 25 | 26 |
27 |
28 |
29 |
30 |

Create Group 31 |

32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 |
40 | 41 |
42 |

Please fill all the data to create a group

43 |
44 |
45 | 48 |
49 |
50 | 54 |
55 | 56 | 57 |
58 |
59 |
60 |
61 |
62 | <%- include('./partials/footer.ejs') %> 63 | 64 | 65 | <%- include('./partials/Scripts.ejs') %> 66 | 67 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /views/createproblem.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Create Problems 31 |

32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 |
40 |
41 |

Please fill all data to crete problem

42 |
43 |
44 | 47 |
48 | 49 | 52 | 53 | 55 | 56 |
57 | 60 |
61 |
62 | 65 |
66 | 67 | 68 |
69 | 72 |
73 |
74 | 77 |
78 | 79 |
80 | 82 |
83 |
84 | 86 |
87 |
88 | 90 |
91 |
92 | 94 |
95 |
96 | 98 |
99 | 101 |
102 |
103 |
104 |
105 |
106 | <%- include('./partials/footer.ejs') %> 107 | 108 | 109 | <%- include('./partials/Scripts.ejs') %> 110 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /views/createteam.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Create Team 31 |

32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 |
40 | 41 |
42 |

Please fill all the data to create a team

43 |
44 |
45 | 48 |
49 |
50 | 54 |
55 |

Note, team is 3 members only

56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 | <%- include('./partials/footer.ejs') %> 64 | 65 | 66 | <%- include('./partials/Scripts.ejs') %> 67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /views/documentation.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%- include('./partials/nav.ejs') %> 24 | 25 |
26 |

27 |
28 |
29 | <%=documentation.DocName%> 30 |
31 |
32 |

33 |
34 |
35 |
36 |

<%=documentation.DocName%>

37 |

<%=documentation.Doc_date%>

38 |

<%=documentation.Topic%>

39 | 40 | 41 |

42 | <%=documentation.Statment%> 43 |

44 | <%if(user&&user.user.Acsess=="developer" && user.user.Handle==documentation.Writer){%> 45 | Update 47 | Delete 49 | <%}%> 50 |
51 |
52 |
53 | 54 |
55 | <%- include('./partials/footer.ejs') %> 56 | 57 | 58 | <%- include('./partials/Scripts.ejs') %> 59 | 60 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /views/documentations.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%- include('./partials/nav.ejs') %> 24 |
25 |
26 |
27 |
28 |

Documentations 29 |

30 |
31 | 32 |
33 |
34 |
35 |
36 |
37 | <%arrTopics.forEach( (T,index)=>{%> 38 | 39 |
40 | <%=T%> 41 |
42 | <%if(index!=arrTopics.length-1){%> 43 |
44 | <%}%> 45 | <% })%> 46 |
47 |
48 | 69 |
70 |
71 | <%- include('./partials/footer.ejs') %> 72 | 73 | 74 | <%- include('./partials/Scripts.ejs') %> 75 | 76 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /views/editarticle.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 | 29 |
30 |
31 |
32 |

Please edit all the data you want to update

33 |
34 | 35 | 38 |
39 |
40 | 41 | 44 |
45 |
46 | 47 | 49 |
50 | 51 | 52 | 53 |
54 |
55 |
56 |
57 |
58 | <%- include('./partials/footer.ejs') %> 59 | 60 | 61 | <%- include('./partials/Scripts.ejs') %> 62 | 63 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /views/editdocumentation.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 | 29 |
30 |
31 |
32 |

Please edit all the data you want to update

33 |
34 | 35 | 38 |
39 |
40 | 41 | 44 |
45 |
46 | 47 | 49 |
50 | 51 | 52 | 53 |
54 |
55 |
56 |
57 |
58 | <%- include('./partials/footer.ejs') %> 59 | 60 | 61 | <%- include('./partials/Scripts.ejs') %> 62 | 63 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /views/editproblem.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Create Problems 31 |

32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 |
40 |
41 |

Please edit all the data you want to update

42 | 43 | 45 | 46 | 48 | 49 | 52 | 53 | 54 | 57 | 58 | 60 | 62 | 63 | 66 | 68 | 69 | 70 | 72 | 73 | 74 | 76 | 77 | 78 | 81 | 82 | 83 | 85 | 86 | 87 | 90 | 91 | 93 |
94 |
95 |
96 |
97 |
98 | <%- include('./partials/footer.ejs') %> 99 | 100 | 101 | <%- include('./partials/Scripts.ejs') %> 102 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /views/group.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

31 | <%=group.Name%> 32 |

33 |
34 | 35 |
36 |
37 | 38 | 39 | 40 | 41 |
42 | 43 |
44 |

Admins

45 | 46 | <%group.Admins.forEach( admin=> {%> 47 | 48 | 57 | 58 | <%});%> 59 |
60 | 61 | 62 |
63 |

Members

64 | 65 | <%group.Members.forEach( member=> {%> 66 | 67 | 76 | 77 | <%});%> 78 |
79 | 80 | 81 |
82 |
83 | <%- include('./partials/footer.ejs') %> 84 | 85 | 86 | <%- include('./partials/Scripts.ejs') %> 87 | 88 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /views/groups.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Groups 31 |

32 |
33 | 34 |
35 |
36 |
37 |
38 | 39 | <% ArrGroups.forEach(Group=> {%> 40 | 41 |
42 |
43 |
44 | 54 |
    55 |
  • 57 |

    58 | <%= Group.Owner %> 59 | view 60 | profile 61 |

    62 | Owner 63 |
  • 64 | 65 | <% Group.Admins.forEach( Admin=> { %> 66 |
  • 68 |

    69 | <%=Admin%> 70 | view 71 | profile 72 |

    73 | Admin 74 |
  • 75 | <% });%> 76 |
77 |
78 |
79 |
80 | 81 | <%});%> 82 | 83 |
84 |
85 | 86 |
87 | <%- include('./partials/footer.ejs') %> 88 | 89 | 90 | <%- include('./partials/Scripts.ejs') %> 91 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /views/homepage.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Home Page 31 |

32 |
33 | 34 |
35 |
36 |
37 |
38 |
39 | 40 | <%if(arrArticles.length){%> 41 | <%arrArticles.forEach(Art=>{%> 42 | <%if(Art.type=="Article"){%> 43 |
44 |
45 |
<%=Art.Writer.substring(0,1).toUpperCase()%>
46 | <%=Art.Writer%>  Write an Article  <%=Art.ArtName%> 47 |
48 |
49 |
<%=Art.Topic%>
50 |

<%=Art.Statment.substring(0, 50)%>...Read more

51 |
52 | 55 |
56 | <%}else{%> 57 |
58 |
59 |
<%=Art.Writer.substring(0,1).toUpperCase()%>
60 | <%=Art.Writer%>  Write an Documentation  <%=Art.DocName%> 61 |
62 |
63 |
<%=Art.Topic%>
64 |

<%=Art.Statment.substring(0, 50)%>...Read more

65 |
66 | 69 |
70 | <%}%> 71 | <%})%> 72 | <%}%> 73 | 74 |
75 |
76 |
77 |
78 | 79 | <%- include('./partials/footer.ejs') %> 80 | 81 | 82 | <%- include('./partials/Scripts.ejs') %> 83 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /views/login.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Code Book 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <%- include('./partials/nav.ejs') %> 23 | 24 |
25 |
26 |
27 |
28 | 29 |
30 |
31 |
32 | 33 |
34 | 35 |
36 |
37 |
38 | 39 |
40 | 41 |
42 | 43 | 44 |
45 |

don't have account?

46 | sign up 47 |
48 |
49 | 50 |
51 |
52 |
53 |
54 | 55 | <%- include('./partials/footer.ejs') %> 56 | 57 | 58 | 59 | <%- include('./partials/Scripts.ejs') %> 60 | 61 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /views/myfriends.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Code Book 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <%- include('./partials/nav.ejs') %> 23 |
24 |
25 |
26 |
27 |

My Friends 28 |

29 |
30 | 31 |
32 |
33 |
34 | 35 |
36 |

Followers

37 | <%console.log(listFollowers)%> 38 | 39 | <%if(listFollowers.length==0){%> 40 |

no followers!

41 | <%}%> 42 | <%listFollowers.forEach(e=>{ %> 43 |
44 | <%=e%> 45 |
46 | <%});%> 47 |

Following

48 | <%if(listFollowing.length==0){%> 49 |

no followers!

50 | <%}%> 51 | <%listFollowing.forEach(e=>{ %> 52 |
53 | <%=e%> 54 |
55 | <%});%> 56 |
57 |
58 | 59 |
60 | <%- include('./partials/footer.ejs') %> 61 | 62 | 63 | <%- include('./partials/Scripts.ejs') %> 64 | 65 | 66 | -------------------------------------------------------------------------------- /views/partials/Scripts.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /views/partials/footer.ejs: -------------------------------------------------------------------------------- 1 |
2020-2021©
-------------------------------------------------------------------------------- /views/partials/nav.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /views/problem.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |

28 |
29 |
30 |
31 | <%= Problem.Name%> 32 |
33 |
34 | <%if(user&&user.user.Acsess=="developer" && user.user.Handle==Problem.Writer){%> 35 | 37 | Update 38 | 39 | 41 | <%}%> 42 |
43 |
44 |
45 |

46 | <%if(user&&user.user.Acsess=="developer" && user.user.Handle==Problem.Writer){%><%}%> 47 | 48 | 49 |
50 |
51 |
52 |

Description

53 |

54 | <%= Problem.statement %> 55 |

56 |
57 |
58 |

Input Format

59 |

60 | <%= Problem.Input_Format %> 61 |

62 |
63 |
64 |

Output Format

65 |

66 | <%= Problem.Output_Format %> 67 |

68 |
69 |
70 |

Sample Input

71 |

72 | <%= Problem.Sample_Input %> 73 |

74 |
75 |
76 |

Sample Output

77 |

78 | <%= Problem.Sample_Output %> 79 |

80 |
81 | 82 |
83 |

Input

84 |

85 | <%= Problem.Input %> 86 |

87 |
88 | 89 |
90 |
91 |
92 |
93 |
94 |
95 | 96 | 98 |
99 |
100 | 103 |
104 |
105 |
106 |
107 |
108 | <%- include('./partials/footer.ejs') %> 109 | 110 | 111 | <%- include('./partials/Scripts.ejs') %> 112 | 113 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /views/problemset.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%- include('./partials/nav.ejs') %> 24 | 25 |
26 |
27 |
28 |
29 |

Problems

30 |
31 | 32 |
33 |
34 | 54 | 55 |
56 | <%- include('./partials/footer.ejs') %> 57 | 58 | 59 | <%- include('./partials/Scripts.ejs') %> 60 | 61 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /views/problemsubmissions.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Submissions 31 |

32 |
33 | 34 |
35 |
36 |
37 |
38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | <%submissions.forEach( submission => {%> 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | <%});%> 61 | 62 |
Submission IDWhenProblem IDProblem NameWhoStatus
<%= submission.ID %><%= submission.Day %> <%= submission.Time %><%= submission.Problem_ID %><%= submission.Problem_Name %><%= submission.User %><%= submission.status %>
63 |
64 |
65 |
66 | 67 |
68 | <%- include('./partials/footer.ejs') %> 69 | 70 | 71 | <%- include('./partials/Scripts.ejs') %> 72 | 73 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /views/profile.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%- include('./partials/nav.ejs') %> 24 | 25 |
26 |
27 |
28 | 29 |
30 |

31 | <%=user.user.Fname+" "+user.user.Lname%> 32 |

33 |

34 | <%="@"+user.user.Handle%> 35 |

36 |

37 | <%=user.user.Acsess%> 38 |

39 | Update profile 40 |

41 | <%if(Profile.Rating==null){%> 42 | Rating : 0 43 | <%}else{%> 44 | <%="Rating : "+Profile.Rating %> 45 | <%}%> 46 |

47 | <%if(user.user.Acsess=="developer"){%> 48 |

49 | Number of problems made: <%=Profile.NumMadeProblem %> 50 |

51 |

52 | Number of articles write: <%=Profile.NumArticles %> 53 |

54 |

55 | Number of documentations write: <%=Profile.NumDocumentations %> 56 |

57 | <%}%> 58 |

59 | Number of problems solved: <%=Profile.NumSolvedProblem %> 60 |

61 |

62 | Following: <%=Profile.NumFriends %> users 63 |

64 |

65 | Followers: <%=Profile.NumFollowee %> users 66 |

67 | View My Friends 68 |

69 | <%=user.user.E_mail %> 70 |

71 | 72 | 73 | 74 |
75 | 76 | <%if(user.user.Acsess=="developer"){%> 77 | Make Contest 78 | Make Group 79 | Write Article 80 | Write Documentation 81 | Make Problem 82 | <%}%> 83 | 84 | Make Team 85 | View my teams 86 | 87 |
88 | 89 |
90 |
91 | 92 |
93 | <%if(user.user.Acsess=="developer"){%> 94 | 95 | <%}else{%> 96 | 97 | <%}%> 98 |
99 | 100 |
101 |
102 |
103 |
104 | <%- include('./partials/footer.ejs') %> 105 | 106 | 107 | <%- include('./partials/Scripts.ejs') %> 108 | 109 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /views/searchResult.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Code Book 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <%- include('./partials/nav.ejs') %> 23 | 24 |
25 |
26 |
27 | 28 |
29 |

Users

30 | <%if(arrUsers.length){%> 31 | <%arrUsers.forEach(e=>{ %> 32 |
33 | <%=e.Handle%> 34 | 37 |
38 | <%});%> 39 | <%}%> 40 |
41 |
42 | 43 |
44 | 45 |
46 |

Articles

47 | <%if(arrArt.length){%> 48 | <%arrArt.forEach(e=>{ %> 49 |
50 | <%=e.ArtName%> 51 | 52 |
53 | <%});%> 54 | <%}%> 55 |
56 |
57 | 58 | 59 |
60 | 61 |
62 |

Documentation

63 | <%if(arrDoc.length){%> 64 | <%arrDoc.forEach(e=>{ %> 65 |
66 | <%=e.DocName%> 67 | 68 |
69 | <%});%> 70 | <%}%> 71 |
72 |
73 | 74 |
75 | 76 | <%console.log(arrproblems)%> 77 |
78 |

Problems

79 | <%if(arrproblems.length){%> 80 | <%arrproblems.forEach(e=>{ %> 81 |
82 | <%= e.Name %> 83 | 84 |
85 | <%});%> 86 | <%}%> 87 |
88 |
89 | 90 |
91 | 92 |
93 |

Groups

94 | <%arrGroups.forEach(e=>{ %> 95 |
96 | <%=e.Name_%> 97 | 98 |
99 | <%});%> 100 | 101 |
102 |
103 | 104 |
105 | 106 | 107 | 108 |
109 | 110 | <%- include('./partials/footer.ejs') %> 111 | 112 | 113 | <%- include('./partials/Scripts.ejs') %> 114 | 115 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /views/signup.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Code Book 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <%- include('./partials/nav.ejs') %> 23 | 24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 | 40 |
41 |
42 |
43 | 44 |
45 | 46 |
47 |
48 |
49 | 50 |
51 | 52 |
53 |
54 |
55 | 56 |
57 | 58 |
59 |
60 | 61 | 62 |
63 |
64 | 65 | 66 |
67 | 68 | 69 |
70 |
71 |

alreay have account?

72 | log in 73 |
74 |
75 |
76 |
77 |
78 | 79 | 80 | <%- include('./partials/footer.ejs') %> 81 | 82 | <%- include('./partials/Scripts.ejs') %> 83 | 84 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /views/teams.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 |
29 |
30 |

Teams

31 |
32 | 33 |
34 |
35 |
36 |
37 | <%Teams.forEach(team => {%> 38 |
39 |
40 |
41 |
42 |

<%=team.name%>

43 |

max 44 | rate:<%=team.maxRate%>

45 |

cur 46 | rate:<%=team.curRate%>

47 |
48 | 49 | 66 |
67 |
68 |
69 | <%});%> 70 | 71 |
72 |
73 | 74 |
75 | <%- include('./partials/footer.ejs') %> 76 | 77 | 78 | <%- include('./partials/Scripts.ejs') %> 79 | 80 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /views/updateProfile.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | Code Book 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | <%- include('./partials/nav.ejs') %> 25 | 26 |
27 |
28 | 29 |
30 |
31 | 32 |
33 |

Please edit all the data you want to update

34 | 35 |
36 | 37 | 38 |
39 | 40 |
41 | 42 | 43 |
44 |
45 | 46 | 47 |
48 |
49 | 50 | 51 |
52 | 53 |
54 | 55 | 56 |
57 | 58 | 59 | 60 |
61 |
62 |
63 |
64 |
65 | <%- include('./partials/footer.ejs') %> 66 | 67 | 68 | <%- include('./partials/Scripts.ejs') %> 69 | 70 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /views/user.ejs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Code Book 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <%- include('./partials/nav.ejs') %> 23 | 24 |
25 |
26 |
27 | 28 |
29 | <%console.log(currUser)%> 30 |

31 | <%=currUser.Fname+" "+currUser.Lname%> 32 | <% if(!currUser.IsFriend){%> 33 | Add Friend 34 | <%}else{%> 35 | Remove Friend 36 | <%}%> 37 |

38 |

39 | <%="@"+currUser.Handle%> 40 |

41 |

42 | <%=currUser.Acsess%> 43 |

44 | 45 |

46 | <%if(currUser.Rating==null){%> 47 | Rating : 0 48 | <%}else{%> 49 | <%="Rating : "+currUser.Rating %> 50 | <%}%> 51 |

52 | 53 | <%if(currUser.Acsess=="developer"){%> 54 |

55 | Number of problems made: <%=currUser.NumMadeProblem %> 56 |

57 |

58 | Number of articles write: <%=currUser.NumArticles %> 59 |

60 |

61 | Number of documentations write: <%=currUser.NumDocumentations %> 62 |

63 | <%}else{%> 64 |

65 | Number of problems solved: <%=currUser.NumSolvedProblem %> 66 |

67 | <% }%> 68 |

69 | Following: <%=currUser.NumFriends %> users 70 |

71 |

72 | Followers: <%=currUser.NumFollowee %> users 73 |

74 | 75 |

76 | <%=currUser.E_mail %> 77 |

78 |
79 |
80 | 81 |
82 | <%if(currUser.Acsess=="developer"){%> 83 | 84 | <%}else{%> 85 | 86 | <%}%> 87 |
88 | 89 |
90 |
91 |
92 |
93 | <%- include('./partials/footer.ejs') %> 94 | 95 | 96 | <%- include('./partials/Scripts.ejs') %> 97 | 132 | 133 | 134 | --------------------------------------------------------------------------------