Skip to content

Commit c9b68a0

Browse files
authored
Merge pull request #10 from delphi-hub/feat/5
Added a blank Scala Play Application
2 parents 3585ef4 + 47c451b commit c9b68a0

35 files changed

+22372
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
*.class
22
*.log
3+
4+
/.idea/
5+
/target/
6+
/project/project/
7+
/project/target/

app/controllers/HomeController.scala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package controllers
2+
3+
import javax.inject._
4+
import play.api.mvc._
5+
6+
/**
7+
* Created by benhermann on 02.01.18.
8+
*/
9+
@Singleton
10+
class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
11+
12+
/**
13+
* Create an Action to render an HTML page with a welcome message.
14+
* The configuration in the `routes` file means that this method
15+
* will be called when the application receives a `GET` request with
16+
* a path of `/`.
17+
*/
18+
def index = Action {
19+
Ok(views.html.index("Delphi - Management Interface"))
20+
}
21+
22+
}

app/views/index.scala.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@*
2+
* This template takes a single argument, a String containing a
3+
* message to display.
4+
*@
5+
@(message: String)
6+
7+
@*
8+
* Call the `main` template with two arguments. The first
9+
* argument is a `String` with the title of the page, the second
10+
* argument is an `Html` object containing the body of the page.
11+
*@
12+
@main("Delphi - Management Interface") {
13+
14+
@*
15+
* Get an `Html` object by calling the built-in Play welcome
16+
* template and passing a `String` message.
17+
*@
18+
@welcome(message, style = "scala")
19+
20+
}

app/views/main.scala.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@*
2+
* This template is called from the `index` template. This template
3+
* handles the rendering of the page header and body tags. It takes
4+
* two arguments, a `String` for the title of the page and an `Html`
5+
* object to insert into the body of the page.
6+
*@
7+
@(title: String)(content: Html)
8+
9+
<!DOCTYPE html>
10+
<html lang="en-US">
11+
<head>
12+
<meta charset="utf-8">
13+
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
14+
<link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/bootstrap.min.css")" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
15+
<link rel="stylesheet" href="@routes.Assets.versioned("stylesheets/default.css")">
16+
<link rel="icon" type="image/png" href="@routes.Assets.versioned("images/favicon.png")">
17+
<link href="https://fonts.googleapis.com/css?family=Source+Serif+Pro" rel="stylesheet">
18+
<title>@title</title>
19+
</head>
20+
<body>
21+
<nav class="navbar fixed-top navbar-collapse navbar-toggleable-md navbar-expand-lg navbar-light">
22+
<a class="navbar-brand py-0" href="#">
23+
<img src="assets/images/logo.svg" height=30 class="d-inline-block align-top" alt="">
24+
</a>
25+
<!--<a href="/" class="nav-link active py-0">Home</a>
26+
<a href="team.html" class="nav-link py-0">Team</a>
27+
<!--| <a href="documentation.html">Documentation</a>
28+
| <a href="delphi/">Try it!</a>-->
29+
<!--<a href="https://github.com/delphi-hub" class="nav-link py-0">Participate!</a>-->
30+
</nav>
31+
32+
<header>
33+
</header>
34+
<main>
35+
@* And here's where we render the `Html` object containing
36+
* the page content. *@
37+
@content
38+
</main>
39+
<footer class="fixed-bottom">
40+
<p class="text-center">Delphi ([email protected]) is maintained by the <a href="https://www.hni.uni-paderborn.de/en/software-engineering/">Secure Software Engineering group</a> at <a href="https://www.uni-paderborn.de/">Paderborn University</a></p>
41+
</footer>
42+
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
43+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
44+
<script src="@routes.Assets.versioned("scripts/bootstrap.min.js")" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
45+
</body>
46+
</html>

app/views/welcome.scala.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@(message: String, style: String = "scala")
2+
3+
<section id="top">
4+
<div class="jumbotron">
5+
<h1>Welcome to the Delphi-Management-Interface!</h1>
6+
</div>
7+
</section>
8+
9+
<div id="content" class="container">
10+
<article>
11+
12+
<h1>What is Delphi?</h1>
13+
14+
<p>
15+
Delphi is a platform to retrieve meta-information on JVM-bytecode based projects.
16+
</p>
17+
18+
19+
<h2>What can Delphi do for you?</h2>
20+
21+
<p>
22+
You can either query a complete set of information for a specific project or you can retrieve a list of
23+
matching projects based on specific metrics.
24+
</p>
25+
26+
<h2>What is this page used for?</h2>
27+
28+
<p>
29+
Once implemented, this page will give you access to the management interface of Delphi. You will be able
30+
to control the Delphi-Crawlers, configure the Elasticsearch database and administrate your instances of
31+
Delphi. For now, this page is a placeholder for the future implementation.
32+
</p>
33+
34+
35+
36+
37+
</article>
38+
39+
40+
41+
</div>
42+

build.sbt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name := """delphi-management"""
2+
3+
organization := "de.upb"
4+
5+
version := "1.0.0-SNAPSHOT"
6+
7+
scalaVersion := "2.12.4"
8+
9+
lazy val root = (project in file(".")).enablePlugins(PlayScala)
10+
.enablePlugins(BuildInfoPlugin).
11+
settings(
12+
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
13+
buildInfoPackage := "de.upb.cs.swt.delphi.management"
14+
)
15+
16+
resolvers += Resolver.sonatypeRepo("snapshots")
17+
18+
libraryDependencies += guice
19+
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "3.1.2" % Test
20+
libraryDependencies += "com.h2database" % "h2" % "1.4.196"

0 commit comments

Comments
 (0)