From e51056ad88c75b9751ef0470a8b225f82937a3c7 Mon Sep 17 00:00:00 2001 From: Jessica Garcia-Tejeda Date: Mon, 11 Apr 2022 13:07:15 -0500 Subject: [PATCH 1/2] basic pages --- .vscode/settings.json | 5 +++++ project/metals.sbt | 4 +++- server/app/controllers/Application.scala | 16 ++++++++++++++++ server/app/views/index.scala.html | 22 +++++++++++----------- server/conf/routes | 6 ++++++ 5 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..32cfc61 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.watcherExclude": { + "**/target": true + } +} \ No newline at end of file diff --git a/project/metals.sbt b/project/metals.sbt index a64ca30..183a0eb 100644 --- a/project/metals.sbt +++ b/project/metals.sbt @@ -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") + diff --git a/server/app/controllers/Application.scala b/server/app/controllers/Application.scala index 85a6082..1610f96 100644 --- a/server/app/controllers/Application.scala +++ b/server/app/controllers/Application.scala @@ -24,4 +24,20 @@ 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 { + Ok("Faculty page here.") + } + + def ratings() = Action { + Ok("Ratings page here.") + } } diff --git a/server/app/views/index.scala.html b/server/app/views/index.scala.html index 8f6d9f3..cbeab11 100644 --- a/server/app/views/index.scala.html +++ b/server/app/views/index.scala.html @@ -1,16 +1,16 @@ @(message: String)(implicit flash: Flash) -@main("Play with Scala.js") { -

Play and Scala.js share a same message

- - -

Click for a new random number: 4

- - -

Click for a new random string: word

+@main("CS Hub.js") { + +

+

CS Hub

+

Username:

+

Password:

} diff --git a/server/conf/routes b/server/conf/routes index ec1dee8..2f20940 100644 --- a/server/conf/routes +++ b/server/conf/routes @@ -67,3 +67,9 @@ 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() +GET /Ratings/ controllers.Application.ratings() \ No newline at end of file From 264bf564d865bee09d523821327de0056587aed6 Mon Sep 17 00:00:00 2001 From: Larry Green Date: Wed, 13 Apr 2022 17:10:27 -0500 Subject: [PATCH 2/2] Login -> Faculty Login -> Faculty Profile --- server/app/controllers/Application.scala | 8 ++++++-- server/app/views/index.scala.html | 25 ++++++++++++++++-------- server/conf/routes | 17 ++++++++++++---- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/server/app/controllers/Application.scala b/server/app/controllers/Application.scala index 1610f96..d272cb7 100644 --- a/server/app/controllers/Application.scala +++ b/server/app/controllers/Application.scala @@ -2,6 +2,7 @@ package controllers import javax.inject._ + import shared.SharedMessages import play.api.mvc._ import play.api.i18n._ @@ -33,10 +34,13 @@ class Application @Inject()(cc: ControllerComponents) extends AbstractController Ok("Student page here.") } - def faculty() = Action { - Ok("Faculty 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.") } diff --git a/server/app/views/index.scala.html b/server/app/views/index.scala.html index cbeab11..71eada8 100644 --- a/server/app/views/index.scala.html +++ b/server/app/views/index.scala.html @@ -1,16 +1,25 @@ @(message: String)(implicit flash: Flash) @main("CS Hub.js") { - + + + +

CS Hub

-

Username:

-

Password:

- + } diff --git a/server/conf/routes b/server/conf/routes index 2f20940..8cea315 100644 --- a/server/conf/routes +++ b/server/conf/routes @@ -69,7 +69,16 @@ 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() -GET /Ratings/ controllers.Application.ratings() \ No newline at end of file +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