have all webapp html templates extend from base.html

This commit is contained in:
Gered 2014-09-28 15:21:37 -04:00
parent 1d8f5fa877
commit 3387a42dd2
6 changed files with 51 additions and 87 deletions

View file

@ -46,6 +46,7 @@
["resources/public/vendor/js/react.js" (render "resources/public/vendor/js/react.js" data)]
["resources/public/vendor/js/react.min.js" (render "resources/public/vendor/js/react.min.js" data)]
["resources/views/base.html" (render "resources/views/base.html" data)]
["resources/views/index.html" (render "resources/views/index.html" data)]
["resources/views/error.html" (render "resources/views/error.html" data)]
["resources/views/notfound.html" (render "resources/views/notfound.html" data)]
["src-cljs/{{path}}/client/main.cljs" (render "src-cljs/root_ns/client/main.cljs" data)]

View file

@ -8,7 +8,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%name%></title>
<title>{% block title %}{% endblock %}<%name%></title>
{{ stylesheet('/vendor/css/bootstrap.min.css') }}
{{ stylesheet('/css/screen.css') }}
@ -20,15 +20,8 @@
{{ javascript('/vendor/js/es5-sham.min.js') }}
<!--[if lt IE 9]>{{ javascript('/vendor/js/html5shiv.min.js') }}<![endif]-->
{{ javascript('/vendor/js/bootstrap.min.js') }}
{% if isDev %}
{{ javascript('/vendor/js/react.js') }}
{% else %}
{{ javascript('/vendor/js/react.min.js') }}
{% endif %}
{% if isDev %}
<script type="text/javascript" src="{{ path('/cljs/target/goog/base.js') }}"></script>
{% endif %}
{% block head_scripts %}{% endblock %}
<script type="text/javascript">
var context = '{{ path('/') }}';
@ -37,14 +30,9 @@
</head>
<body>
<div id="app" class="container">
{% block content %}{% endblock %}
</div>
{{ javascript('/cljs/main.js') }}
{% if isDev %}
<script type="text/javascript">goog.require('<%sanitized%>.client.main');</script>
{% endif %}
{% block body_scripts %}{% endblock %}
</body>
</html>

View file

@ -1,45 +1,20 @@
{{=<% %>=}}
<!DOCTYPE html>
<!--[if lt IE 9]> <html class="old-ie no-ws" lang="en"> <![endif]-->
<!--[if lt IE 10]> <html class="no-ws" lang="en"> <![endif]-->
<!--[if gte IE 10]> <html lang="en"> <![endif]-->
<!--[if !IE]> --> <html lang="en"> <!-- <![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Error :: <%name%></title>
{% extends "base.html" %}
{{ stylesheet('/vendor/css/bootstrap.min.css') }}
{{ stylesheet('/css/screen.css') }}
{% block title %}Error :: {% endblock %}
<!--[if lt IE 9]> {{ javascript('/vendor/js/jquery-1.11.1.min.js') }} <![endif]-->
<!--[if gte IE 9]> {{ javascript('/vendor/js/jquery-2.1.1.min.js') }} <![endif]-->
<!--[if !IE]> --> {{ javascript('/vendor/js/jquery-2.1.1.min.js') }} <!-- <![endif]-->
{{ javascript('/vendor/js/es5-shim.min.js') }}
{{ javascript('/vendor/js/es5-sham.min.js') }}
<!--[if lt IE 9]>{{ javascript('/vendor/js/html5shiv.min.js') }}<![endif]-->
{{ javascript('/vendor/js/bootstrap.min.js') }}
{% block content %}
<div id="error-message" class="container">
<div class="page-header">
<h2>Server Error</h2>
</div>
<script type="text/javascript">
var context = '{{ path('/') }}';
</script>
</head>
<body>
<p class="lead">Your request could not be processed due to a server error.</p>
<div id="error-message" class="container">
<div class="page-header">
<h2>Server Error</h2>
</div>
<p class="lead">Your request could not be processed due to a server error.</p>
{% if stacktrace %}
{% if stacktrace %}
<div>
<pre>{{ stacktrace }}</pre>
</div>
{% endif %}
</div>
</body>
</html>
{% endif %}
</div>
{% endblock %}

View file

@ -0,0 +1,25 @@
{{=<% %>=}}
{% extends "base.html" %}
{% block head_scripts %}
{% if isDev %}
{{ javascript('/vendor/js/react.js') }}
{% else %}
{{ javascript('/vendor/js/react.min.js') }}
{% endif %}
{% if isDev %}
<script type="text/javascript" src="{{ path('/cljs/target/goog/base.js') }}"></script>
{% endif %}
{% endblock %}
{% block body_scripts %}
{{ javascript('/cljs/main.js') }}
{% if isDev %}
<script type="text/javascript">goog.require('<%sanitized%>.client.main');</script>
{% endif %}
{% endblock %}
{% block content %}
<div id="app" class="container"></div>
{% endblock %}

View file

@ -1,39 +1,14 @@
{{=<% %>=}}
<!DOCTYPE html>
<!--[if lt IE 9]> <html class="old-ie no-ws" lang="en"> <![endif]-->
<!--[if lt IE 10]> <html class="no-ws" lang="en"> <![endif]-->
<!--[if gte IE 10]> <html lang="en"> <![endif]-->
<!--[if !IE]> --> <html lang="en"> <!-- <![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Not Found :: <%name%></title>
{% extends "base.html" %}
{{ stylesheet('/vendor/css/bootstrap.min.css') }}
{{ stylesheet('/css/screen.css') }}
{% block title %}Not Found :: {% endblock %}
<!--[if lt IE 9]> {{ javascript('/vendor/js/jquery-1.11.1.min.js') }} <![endif]-->
<!--[if gte IE 9]> {{ javascript('/vendor/js/jquery-2.1.1.min.js') }} <![endif]-->
<!--[if !IE]> --> {{ javascript('/vendor/js/jquery-2.1.1.min.js') }} <!-- <![endif]-->
{{ javascript('/vendor/js/es5-shim.min.js') }}
{{ javascript('/vendor/js/es5-sham.min.js') }}
<!--[if lt IE 9]>{{ javascript('/vendor/js/html5shiv.min.js') }}<![endif]-->
{{ javascript('/vendor/js/bootstrap.min.js') }}
{% block content %}
<div id="error-message" class="container">
<div class="page-header">
<h2>Not Found</h2>
</div>
<script type="text/javascript">
var context = '{{ path('/') }}';
</script>
</head>
<body>
<div id="error-message" class="container">
<div class="page-header">
<h2>Not Found</h2>
<p class="lead">The page or resource you requested could not be found.</p>
</div>
<p class="lead">The page or resource you requested could not be found.</p>
</div>
</body>
</html>
{% endblock %}

View file

@ -5,7 +5,7 @@
(defroutes
main-public-routes
(GET "/" [] (views/render "base.html")))
(GET "/" [] (views/render "index.html")))
(defroutes api-routes
(context "/api" []