Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3645f9a
Showing
23 changed files
with
2,520 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
target/ | |||
modules/ | |||
|
|||
#Eclipse | |||
.project | |||
.metadata | |||
eclipse/ | |||
test-result/ | |||
bin/** | |||
tmp/** | |||
tmp/**/* | |||
*.tmp | |||
*.bak | |||
*.swp | |||
*~.nib | |||
.classpath | |||
.settings/ | |||
.loadpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
# Play Bootstrap Skeleton | |||
A Play project skeleton using Twitter bootstrap and preconfigured with Play CRUD and Secure modules, some classes and required routes. Just fork it and start creating your app. | |||
|
|||
Cheers! | |||
|
|||
Christophe H. | |||
@chamerling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,36 @@ | |||
/* | |||
* Copyright 2011 Christophe Hamerling | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
import play.jobs.Job; | |||
import play.jobs.OnApplicationStart; | |||
import play.test.Fixtures; | |||
|
|||
/** | |||
* Bootstrap some init data to avoid some useless test for the application long | |||
* life time | |||
* | |||
* | |||
*/ | |||
@OnApplicationStart | |||
public class Bootstrap extends Job { | |||
|
|||
@Override | |||
public void doJob() throws Exception { | |||
int count = 1; // load things from database... | |||
if (count == 0) { | |||
Fixtures.load("initial-data.yml"); | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
package controllers; | |||
|
|||
import play.*; | |||
import play.mvc.*; | |||
|
|||
import java.util.*; | |||
|
|||
import models.*; | |||
|
|||
public class Application extends Controller { | |||
|
|||
public static void index() { | |||
render(); | |||
} | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
package controllers; | |||
|
|||
import play.Play; | |||
|
|||
public class Security extends Secure.Security { | |||
|
|||
static boolean authenticate(String username, String password) { | |||
return username.equals(Play.configuration | |||
.getProperty("secure.admin.username")) | |||
&& password.equals(Play.configuration | |||
.getProperty("secure.admin.password")); | |||
} | |||
|
|||
static boolean check(String profile) { | |||
if (profile.equals("Admin")) { | |||
return session.get("username").equals( | |||
Play.configuration.getProperty("secure.admin.username")); | |||
} | |||
return false; | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
#{extends 'main.html' /} | |||
#{set title:'Home' /} | |||
|
|||
<div class="well"> | |||
So what? | |||
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
<!DOCTYPE html> | |||
|
|||
<html> | |||
<head> | |||
<title>Not found</title> | |||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |||
</head> | |||
<body> | |||
#{if play.mode.name() == 'DEV'} | |||
#{404 result /} | |||
#{/if} | |||
#{else} | |||
<h1>Not found</h1> | |||
<p> | |||
${result.message} | |||
</p> | |||
#{/else} | |||
</body> | |||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
<!DOCTYPE html> | |||
|
|||
<html> | |||
<head> | |||
<title>Application error</title> | |||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |||
</head> | |||
<body> | |||
#{if play.mode.name() == 'DEV'} | |||
#{500 exception /} | |||
#{/if} | |||
#{else} | |||
<h1>Oops, an error occured</h1> | |||
#{if exception instanceof play.exceptions.PlayException} | |||
<p> | |||
This exception has been logged with id <strong>${exception.id}</strong>. | |||
</p> | |||
#{/if} | |||
#{/else} | |||
</body> | |||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,69 @@ | |||
<!DOCTYPE html> | |||
|
|||
<html> | |||
<head> | |||
<title>#{get 'title' /}</title> | |||
<meta charset="utf-8"> | |||
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/bootstrap-1.2.0.css'}"> | |||
#{get 'moreStyles' /} | |||
<link rel="shortcut icon" type="image/png" href="@{'/public/images/favicon.png'}"> | |||
<script src="@{'/public/javascripts/jquery-1.5.2.min.js'}" type="text/javascript" charset="utf-8"></script> | |||
<script src="@{'/public/javascripts/application.js'}" type="text/javascript" charset="utf-8"></script> | |||
#{get 'moreScripts' /} | |||
</head> | |||
<body> | |||
|
|||
<div class="topbar"> | |||
<div class="fill"> | |||
<div class="container"> | |||
<h3><a href="@{Application.index()}">App Name</a></h3> | |||
<ul> | |||
<!--- browse --> | |||
<ul class="nav secondary-nav"> | |||
<li class="menu"> | |||
<a href="#" class="menu">Menu A</a> | |||
<ul class="menu-dropdown"> | |||
<li><a href="@{Application.index()}">One</a></li> | |||
<li><a href="@{Application.index()}">Two</a></li> | |||
</ul> | |||
</li> | |||
<li class="menu"> | |||
<a href="#" class="menu">Menu B</a> | |||
<ul class="menu-dropdown"> | |||
<li><a href="@{Application.index()}">Three</a></li> | |||
</ul> | |||
</li> | |||
<li class="menu"> | |||
<a href="#" class="menu">Menu C</a> | |||
<ul class="menu-dropdown"> | |||
<li><a href="@{Application.index()}">Four</a></li> | |||
</ul> | |||
</li> | |||
</ul> | |||
</ul> | |||
<ul class="nav secondary-nav"> | |||
<li><a href="">Connected to xxx</a></li> | |||
</ul> | |||
</div> | |||
</div> <!-- /fill --> | |||
</div> | |||
|
|||
<div class="container"> | |||
|
|||
#{if flash.success} | |||
<div class="alert-message success"> | |||
<a class="close" href="#">×</a> | |||
<p><strong>${flash.success}</strong></p> | |||
</div> | |||
#{/if} | |||
#{if flash.error} | |||
<div class="alert-message error"> | |||
<a class="close" href="#">×</a> | |||
<p><strong>${flash.error}</strong></p> | |||
</div> | |||
#{/if} | |||
|
|||
#{doLayout /} | |||
</div> | |||
</body> | |||
</html> |
Oops, something went wrong.