Browse files

Better org.

  • Loading branch information...
1 parent 4c34ef6 commit ba719d07a4c625d168f116250da7c387658def2b @guillaumebort guillaumebort committed Nov 11, 2013
Showing with 32 additions and 26 deletions.
  1. +32 −26 app/controllers/Application.java
View
58 app/controllers/Application.java
@@ -11,32 +11,6 @@
import static controllers.Prismic.*;
public class Application extends Controller {
-
- // -- Resolve links to documents
- final public static LinkResolver linkResolver(Api api, String ref, Http.Request request) {
- return new LinkResolver(api, ref, request);
- }
-
- public static class LinkResolver extends DocumentLinkResolver {
- final Api api;
- final String ref;
- final Http.Request request;
-
- public LinkResolver(Api api, String ref, Http.Request request) {
- this.api = api;
- this.ref = ref;
- this.request = request;
- }
-
- public String resolve(Fragment.DocumentLink link) {
- return routes.Application.detail(link.getId(), link.getSlug(), ref).absoluteURL(request);
- }
- }
-
- // -- Page not found
- static Result pageNotFound() {
- return notFound("Page not found");
- }
// -- Home page
@Prismic.Action
@@ -70,5 +44,37 @@ public static Result search(String q, String ref) {
}
return ok(views.html.search.render(q, results));
}
+
+
+ // ---- Links
+
+
+
+ // -- Resolve links to documents
+ final public static LinkResolver linkResolver(Api api, String ref, Http.Request request) {
+ return new LinkResolver(api, ref, request);
+ }
+
+ public static class LinkResolver extends DocumentLinkResolver {
+ final Api api;
+ final String ref;
+ final Http.Request request;
+
+ public LinkResolver(Api api, String ref, Http.Request request) {
+ this.api = api;
+ this.ref = ref;
+ this.request = request;
+ }
+
+ public String resolve(Fragment.DocumentLink link) {
+ return routes.Application.detail(link.getId(), link.getSlug(), ref).absoluteURL(request);
+ }
+ }
+
+ // -- Page not found
+ static Result pageNotFound() {
+ return notFound("Page not found");
+ }
+
}

0 comments on commit ba719d0

Please sign in to comment.