Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Larry_Faculty #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.watcherExclude": {
"**/target": true
}
}
4 changes: 3 additions & 1 deletion project/metals.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// DO NOT EDIT! This file is auto-generated.

// This file enables sbt-bloop to create bloop config files.

addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.0-RC1-190-ef7d8dba")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.13")

20 changes: 20 additions & 0 deletions server/app/controllers/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controllers

import javax.inject._


import shared.SharedMessages
import play.api.mvc._
import play.api.i18n._
Expand All @@ -24,4 +25,23 @@ class Application @Inject()(cc: ControllerComponents) extends AbstractController
def randomString(length: Int) = Action {
Ok(util.Random.nextString(length))
}

def login() = Action {
Ok("Login page here.")
}

def student() = Action {
Ok("Student page here.")
}

def faculty() = Action { implicit request =>
// Below, this will present the Faculty page from views (HTML)
Ok(views.html.facultyLogin1())

}


def ratings() = Action {
Ok("Ratings page here.")
}
}
31 changes: 20 additions & 11 deletions server/app/views/index.scala.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
@(message: String)(implicit flash: Flash)

@main("Play with Scala.js") {
<h2>Play and Scala.js share a same message</h2>
<ul>
<li>Play shouts out: <em>@message</em></li>
<li>Scala.js shouts out: <em id="scalajsShoutOut"></em></li>
</ul>

<p id="randomText">Click for a new random number: <span id="random">4</span></p>
@main("CS Hub.js") {

<input id="lengthValue" type="text" value="5">
<p id="randomStringText">Click for a new random string: <span id="randomString">word</span></p>
<!-- The links of each category -->
<nav>
<a href="/login">Login</a> |
<a href="/student/">Student</a> |
<a href="/Faculty/">Faculty</a> |
<a href="/ratings/">Ratings</a>
</nav>

<!-- I made this script to make the transiton to each page
Function calls to the name given to the link and loc.replace
is to the website of the given page. -->
<script> function Faculty() {
location.replace("http://localhost:9000/Faculty/")
}
</script>

<br></br>
<h2>CS Hub</h2>

<script src="@routes.Assets.versioned("javascript/basicStuff.js")"></script>

}
15 changes: 15 additions & 0 deletions server/conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,18 @@ GET /load7 controllers.TaskList7.load
# Prefix must match `play.assets.urlPrefix`
GET /assets/*file controllers.Assets.at(file)
GET /versionedAssets/*file controllers.Assets.versioned(path="/public", file: Asset)

#Pages
GET /Login/ controllers.Application.login()
GET /Student/ controllers.Application.student()
GET /Faculty/ controllers.Application.faculty()
# Now, this will return a blank page with the username and password in my class.
# And later, if the user and password are correct to the given category.
# then it will reach to the profile of said user.
GET /ValidateFaculty controllers.Faculty.validateFaculty(username, password)
GET /ValidateFacultyPost controllers.Faculty.validateFacultyPost()
# To Faculty user's profile.
GET /FacultyProfile controllers.Faculty.profile()
GET /Ratings/ controllers.Application.ratings()

#FacultyPage