Skip to content

Commit

Permalink
fix render <script src=.../>
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Oct 18, 2018
1 parent 21bdd73 commit d573088
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion samples/apps/review/src/index.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
main() ->
case wf:user() of
undefined -> wf:redirect("login.htm"), redirect_wait();
_ -> #dtl{file = "index", app=review,bindings=[{body,body()},{list,list()},{javascript,(?MODULE:(wf:config(n2o,mode,dev)))()}]} end.
_ -> #dtl{file = "index", app=review,
bindings=[{body,body()},
{list,list()},
{javascript,wf:render(
lists:flatten(
(?MODULE:(wf:config(n2o,mode,dev)))()))}]} end.

prod() -> [ #script{src="/static/review.min.js"} ].
dev() -> [ [ #script{src=lists:concat(["/n2o/protocols/",X,".js"])} || X <- [bert,nitrogen] ],
Expand Down

0 comments on commit d573088

Please sign in to comment.