Skip to content

Commit

Permalink
Add tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
outkine committed Jan 8, 2024
1 parent 870dc95 commit ef1ca82
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
10 changes: 8 additions & 2 deletions app/controllers/HomeController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ class HomeController @Inject()(
Ok(views.html.robot.demo(assetsFinder))
}

def tutorial = Action { implicit request =>
Ok(views.html.robot.tutorial(assetsFinder))
def tutorialHome = Action { implicit request =>
Ok(views.html.tutorialHome(assetsFinder))
}

def tutorial(part: Int) = Action { implicit request =>
if (part == 1) {
Ok(views.html.robot.tutorial(assetsFinder))
} else NotFound
}
}
2 changes: 1 addition & 1 deletion app/views/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ <h2 class="mt-5">Changelog</h2>
<div>
<p>* Rewrote Garage frontend</p>
<p>* Fixed bug with robot saving not working</p>
<p>* RR Tutorial</p>
</div>

<h2 class="mt-4">Roadmap</h2>
<div>
<p>* RR Tutorial</p>
<p>* Improvements to the CLI</p>
<p>* New action type (healing)</p>
<p>* A competition!</p>
Expand Down
4 changes: 4 additions & 0 deletions app/views/main.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<img src="@assetsFinder.path("images/board.svg")">
boards
</a>
<a href="@routes.HomeController.tutorialHome()" target="_blank">
<img src="@assetsFinder.path("images/school.svg")">
tutorial
</a>
<a href="@routes.HomeController.rules()" target="_blank">
<img src="@assetsFinder.path("images/rules.svg")">
docs
Expand Down
3 changes: 2 additions & 1 deletion conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
GET / controllers.HomeController.index
GET /rules controllers.HomeController.rules
GET /demo controllers.HomeController.demo
GET /tutorial controllers.HomeController.tutorial
GET /tutorial controllers.HomeController.tutorialHome
GET /tutorial/:part controllers.HomeController.tutorial(part: Int)

GET /signup controllers.UserController.create
POST /signup controllers.UserController.postCreate
Expand Down

0 comments on commit ef1ca82

Please sign in to comment.