Permalink
Browse files

some cleanup in web frontend, precompilation of dtls

  • Loading branch information...
1 parent 78e8340 commit dc3c4b7de325357f0f29268dbe52cbf5f6ab8182 @dmitriid committed Jul 11, 2012
View
@@ -8,4 +8,3 @@ rel/*
*.log
*.app
tiny_plt
-
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
-{% extends "base.dtl" %}
+{% extends "base_view.dtl" %}
{# {% block header %}
{% endblock %}
View
@@ -0,0 +1,22 @@
+-module(saloon).
+
+-export([start/0]).
+
+start() ->
+ compile_views(code:priv_dir(site)),
+ saloon_app:start().
+
+compile_views(Path) ->
+ AbsPath = filename:absname_join(filename:absname(Path), "templates"),
+ EbinDir = filename:absname_join(filename:absname(Path), "../ebin"),
+ Templates = filelib:wildcard(AbsPath ++ "/*.dtl"),
+ lists:foldl(fun(File, _) ->
+ FileName = filename:basename(File, ".dtl"),
+ ViewName = list_to_atom(FileName),
+ erlydtl:compile(
+ File,
+ ViewName,
+ [ {out_dir, EbinDir}
+ , {custom_tags_modules, [saloon_lang]}]
+ )
+ end, ok, Templates).
@@ -0,0 +1,14 @@
+-module(saloon_app).
+-behaviour(application).
+
+-export([start/2, stop/1]).
+
+%% ===================================================================
+%% Application callbacks
+%% ===================================================================
+
+start(_StartType, _StartArgs) ->
+ hint_search_sup:start_link().
+
+stop(_State) ->
+ ok.
Oops, something went wrong.

0 comments on commit dc3c4b7

Please sign in to comment.