24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/js/login.js:
--------------------------------------------------------------------------------
1 | // Function to post data
2 |
3 | async function postData(url , data) {
4 | const response = await fetch(url, {
5 | method: "POST", // *GET, POST, PUT, DELETE, etc.
6 | mode: "cors", // no-cors, *cors, same-origin
7 | cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
8 | //credentials: 'same-origin', // include, *same-origin, omit
9 | headers: {
10 | "Content-Type": "application/json",
11 | },
12 | referrerPolicy: "no-referrer", // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
13 | //body: body // body data type must match "Content-Type" header
14 | body: JSON.stringify(data),
15 | });
16 | if(response.status == "200"){
17 | swal("Good job!", "Login Succesful!!", "success").then(function(){window.location.href = "index.html";});
18 |
19 | } else{
20 | alert("Something went wrong. Try Again!")
21 | }
22 | return response.json(); // parses JSON response into native JavaScript objects
23 | }
24 |
25 | const registrationform = document.getElementById("loginform")
26 |
27 |
28 | // Handle form events such as onsubmit
29 | // Event listner
30 | registrationform.addEventListener('submit', async function(e) {
31 | e.preventDefault();
32 | const use1r = new FormData(this);
33 | // Object To be posted
34 | var user = {
35 | "email" : this.email.value,
36 | "password" : this.pass.value,
37 | };
38 | let url = "https://skboard.herokuapp.com/api/login/"; // URL for skboard api
39 | const res = await postData(url, user); // Post function
40 | console.log("Response =>" + JSON.stringify(res)); // Log the response
41 | var token = JSON.stringify(res.token)
42 | var role = JSON.stringify(res.role)
43 | document.cookie = "access_token=" + token
44 | document.cookie="role=" + role
45 | document.cookie = "currentUser=" + `"` + this.email.value + `"`
46 | })
47 |
--------------------------------------------------------------------------------
/js/regformdesign.js:
--------------------------------------------------------------------------------
1 | const previousBtn = document.getElementById('previousBtn');
2 | const nextBtn = document.getElementById('nextBtn');
3 | const content = document.getElementById('content');
4 | const bullets = [...document.querySelectorAll('.bullet')];
5 | const formfields = [...document.querySelectorAll('.part')];
6 |
7 | const MAX_STEPS = 4;
8 | let currentStep = 1;
9 |
10 |
11 |
12 | nextBtn.addEventListener('click', () => {
13 | var currentFields = formfields[currentStep - 1].getElementsByTagName('input')
14 | var linkFields = formfields[currentStep - 1].getElementsByClassName('link');
15 |
16 | console.log(linkFields);
17 |
18 | if (checkCurrentFields(currentFields)) {
19 |
20 | alert('Please enter all the required details below')
21 | }
22 | else if (checkLinkFields(linkFields)) {
23 |
24 | }
25 | else {
26 | bullets[currentStep - 1].classList.add('completed');
27 | currentStep += 1;
28 |
29 | previousBtn.disabled = false;
30 | if (currentStep !== 1) {
31 | formfields[currentStep - 2].classList.add('hide');
32 | }
33 | if (currentStep === MAX_STEPS) {
34 | nextBtn.disabled = true;
35 | }
36 |
37 |
38 | formfields[currentStep - 1].classList.remove('hide');
39 | }
40 | });
41 |
42 |
43 | previousBtn.addEventListener('click', () => {
44 | bullets[currentStep - 2].classList.remove('completed');
45 | formfields[currentStep - 1].classList.add('hide');
46 | currentStep -= 1;
47 | nextBtn.disabled = false;
48 | if (currentStep !== MAX_STEPS) {
49 | formfields[currentStep - 1].classList.remove('hide');
50 | }
51 | if (currentStep === 1) {
52 | previousBtn.disabled = true;
53 | }
54 | });
55 |
56 | previousBtn.disabled = true;
57 | checkCurrentFields = (currentFields) => {
58 | for (var i = 0; i < currentFields.length; i++) {
59 | if (currentFields[i].value == '' && currentFields[i].required) {
60 | return true;
61 | }
62 | }
63 | return false;
64 | }
65 |
66 | checkLinkFields = (linkFields) => {
67 | if (linkFields.length == 0) {
68 | return false;
69 | }
70 | for (var i = 0; i < linkFields.length; i++) {
71 | if (!(linkFields[i].value.startsWith('https://'))) {
72 | alert('Please Enter a Valid Link starting with https://')
73 | return true;
74 | }
75 | }
76 | return false;
77 |
78 | }
79 |
80 |
--------------------------------------------------------------------------------
/js/profileActions.js:
--------------------------------------------------------------------------------
1 | function getCookie(name) {
2 | const value = `; ${document.cookie}`;
3 | const parts = value.split(`; ${name}=`);
4 | if (parts.length === 2){
5 | var cookie = parts.pop().split(';').shift();
6 | return cookie.substring(1, cookie.length-1)
7 | }
8 | }
9 |
10 | var accessToken = getCookie("access_token")
11 |
12 | function verifyProfile(user) {
13 | if(confirm("Are you sure you want to verify this user? They will be added to the listing page.")){
14 | const url = "https://skboard.herokuapp.com/api/unverified/approve/"+user
15 | console.log(url)
16 | fetch(url, {
17 | method: "POST",
18 | body: null,
19 | headers: {
20 | "Authorization":"Bearer "+accessToken
21 | }
22 | })
23 | .then(response => response.json())
24 | .then(json => console.log(json));
25 | alert("verified " +user);
26 | location.reload()
27 | }
28 |
29 | }
30 |
31 | function deleteProfile(user){
32 | if(confirm("Are you sure you want to delete this account from SkillBoard? This action cannot be undone.")){
33 | const url = "https://skboard.herokuapp.com/api/student/delete/" +user
34 | console.log(url)
35 | fetch(url, {
36 | method: "DELETE",
37 | body: null,
38 | headers: {
39 | "Authorization":"Bearer "+accessToken
40 | }
41 | })
42 | .then(response => response.json())
43 | .then(json => console.log(json));
44 | alert("deleted " +user);
45 | window.location.href = "index.html"
46 | }
47 | }
48 |
49 | function deleteUnverified(user){
50 | if(confirm("Are you sure you want to verify this user? They will be added to the listing page.")){
51 | const url = "https://skboard.herokuapp.com/api/unverified/delete/" +user
52 | console.log(url)
53 | fetch(url, {
54 | method: "DELETE",
55 | body: null,
56 | headers: {
57 | "Authorization":"Bearer "+accessToken
58 | }
59 | })
60 | .then(response => response.json())
61 | .then(json => console.log(json));
62 | alert("deleted " +user);
63 | location.reload()
64 | }
65 | }
66 |
67 | function promoteUser(user){
68 | if(confirm("Are you sure you want to promote this user to SuperUser? Doing so will give the admin access to SkillBoard.")){
69 | const url = "https://skboard.herokuapp.com/api/superuser/promote/" + user
70 | console.log(url)
71 | fetch(url, {
72 | method: "POST",
73 | body: null,
74 | headers : {
75 | "Authorization":"Bearer "+accessToken
76 | }
77 | })
78 | .then(response => response.json())
79 | .then(json => console.log(json))
80 | alert("This user has been promoted to Super User")
81 | window.location.href = "index.html"
82 | }
83 | }
84 |
85 |
86 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Skill Board
2 |
3 |    
4 |
5 | 
6 |
7 | Skill Board is a web application where the students can showcase their skills & experience and show the availability & interest in receiving new opportunities to work on new projects and internships. Faculties and recruiters can go through this skill board to view the projects of students with the required skills and can contact the students directly for discussing any particular opportunity.
8 |
9 | It is like a job listing page but for students from a particular college.
10 |
11 | This is an open source project and everyone is free to contribute. Right now we are building the frontend on this repo. You can find the API for this at https://github.com/devscollab/skill-board-api
12 |
13 | ## Table of Content
14 |
15 | [How to contribute](#how-to-contribute)
16 |
17 | [Connect with us](#connect-with-us)
18 |
19 | ## How to contribute
20 |
21 | There are some guildelines which everyone should follow while contributing to this opensource project. While working in large teams, it is necessary to follow these steps to avoid any conflicts in the code and continue a smooth flow of collaboration amongst the developers.
22 |
23 | [Check the Contribution Guidelines](./CONTRIBUTING.md)
24 |
25 | ### Best Practices to follow
26 |
27 | 1. Code organisation becomes easier if everyone in the team follows a certain naming pattern.
28 | For example, to make organisation easier, we should follow a simple and logical naming pattern for CSS Classes
29 | in the format : pagenameElementName
30 | Example :
31 | - The Top bar for this page (listings page) can be named .lisitingTopBar
32 | - The profile cards for this page (listings page) can be named .lisitingProfileCards
33 | This helps when the css files become 1000s of lines long by the end of the project.
34 |
35 | 2. While adding any element, make sure it is responsive and its contents fit on all screen sizes.
36 | Users of SkillBoard will use it from all kinds of deivces like Small Mobiles, Large Mobiles, Tablets, Desktops,
37 | and in different orientations like portrait and landscape. Always consider this.
38 | You can test your page on other screen sizes by pressing F12 in chrome browser, and
39 | selecting a mobile view from the list of available devices.
40 |
41 | 3. Read the comments in the code for more hints.
42 |
43 | ## Connect with us
44 |
45 | If you are facing any difficulties in managing or contributing to this project, please discuss it on the Discord Server in the #skill-board channel.
46 |
47 | If there is any issues in using the skill board, contact us via email at [devscollab@gmail.com](mailto:devscollab@gmail.com).
48 |
49 | For reporting bugs or requesting features, create a [new issue](https://github.com/devscollab/skill-board/issues/new/choose) in this repository with the proper template.
50 |
51 | Maintained by - [@tejasmorkar](https://github.com/tejasmorkar) and [@suyashsonawane](https://github.com/suyashsonawane)
52 |
53 | ## This project is under a development halt as of now due to lack of contributors. If you wish to contribute here, please contact before doing so. Thank you!
54 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at devscollab@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/js/superuserslist.js:
--------------------------------------------------------------------------------
1 | function getCookie(name) {
2 | const value = `; ${document.cookie}`;
3 | const parts = value.split(`; ${name}=`);
4 | if (parts.length === 2){
5 | var cookie = parts.pop().split(';').shift();
6 | return cookie.substring(1, cookie.length-1)
7 | }
8 | }
9 |
10 | console.log(document.cookie)
11 | async function getData() {
12 | var accessToken = getCookie("access_token")
13 | let request = await fetch("https://skboard.herokuapp.com/api/superuser/all", {
14 | method: "GET", // *GET, POST, PUT, DELETE, etc.
15 | mode: "cors", // no-cors, *cors, same-origin
16 | cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
17 | headers: {
18 | "Authorization":"Bearer "+accessToken
19 | },
20 | referrerPolicy: "no-referrer", // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
21 | //body: body // body data type must match "Content-Type" header
22 | })
23 | if(request.status == "200"){
24 | console.log("Logged In")
25 | } else{
26 | window.location.href = "login.html"
27 | }
28 | let data = request.json();
29 | return data
30 |
31 | }
32 |
33 | $(document).ready(() => {
34 | var currentUser = getCookie("currentUser")
35 | var role = getCookie("role")
36 | if(role=="superuser"){
37 | $('#dropDown').append(`
38 |
39 |
42 |
43 |
44 |
47 |
48 | `)
49 | }
50 |
51 | getData()
52 | .then(data => {
53 | data.docs.forEach(superuser => {
54 | // console.log(superuser.skills)
55 | $('#cards-container').append(`
56 |
51 | Note for contributors!
52 | You can use these credentials to login :
53 | Email: testuser001@gmail.com
54 | Password: qwerty
55 |
56 |
57 | If you want access to a superuser account (admin account) to work on superuser features, contact adityamahajan#7832 or tejasmorkar#8302 on Discord for the credentials.
58 |
75 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis laboriosam corrupti, aperiam sed nisi accusamus vel nobis illo harum ut nihil, voluptatum totam eaque modi accusantium dicta quia quisquam reprehenderit.
76 |