Cope with the fact that servlet-context
is no longer working...
At least as I think it did. Also moved some assets to fixed URLs so that they can be served by Apache, reducing load on Tomcat.
This commit is contained in:
parent
644dfcb517
commit
1d97622a48
|
@ -2,9 +2,9 @@
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||||
<link rel="stylesheet" type="text/css" href="css/yyy-common.css" />
|
<link rel="stylesheet" type="text/css" href="/css/yyy-common.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="css/yyy-app.css" />
|
<link rel="stylesheet" type="text/css" href="/css/yyy-app.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="css/spinner.css" />
|
<link rel="stylesheet" type="text/css" href="/css/spinner.css" />
|
||||||
<link href="https://fonts.googleapis.com/css?family=Archivo+Black|Archivo+Narrow" rel="stylesheet"/>
|
<link href="https://fonts.googleapis.com/css?family=Archivo+Black|Archivo+Narrow" rel="stylesheet"/>
|
||||||
<title>{{site-title}}: {{title}}</title>
|
<title>{{site-title}}: {{title}}</title>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -43,12 +43,12 @@
|
||||||
{% block extra-tail %}
|
{% block extra-tail %}
|
||||||
<!-- scripts and styles -->
|
<!-- scripts and styles -->
|
||||||
<!-- Leaflet -->
|
<!-- Leaflet -->
|
||||||
<link rel="stylesheet" href="{{servlet-context}}/js/lib/node_modules/leaflet/dist/leaflet.css" />
|
<link rel="stylesheet" href="js/lib/node_modules/leaflet/dist/leaflet.css" />
|
||||||
<script src="{{servlet-context}}/js/lib/node_modules/leaflet/dist/leaflet.js"></script>
|
<script src="js/lib/node_modules/leaflet/dist/leaflet.js"></script>
|
||||||
<!-- Signature pad -->
|
<!-- Signature pad -->
|
||||||
<script src="{{servlet-context}}/js/lib/node_modules/signature_pad/dist/signature_pad.min.js"></script>
|
<script src="js/lib/node_modules/signature_pad/dist/signature_pad.min.js"></script>
|
||||||
<!-- our actual app -->
|
<!-- our actual app -->
|
||||||
<script src="{{servlet-context}}/js/app.js"></script>
|
<script src="js/app.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,20 +27,20 @@
|
||||||
{% block top %}
|
{% block top %}
|
||||||
<header>
|
<header>
|
||||||
<div id="nav">
|
<div id="nav">
|
||||||
<img id="nav-icon" src="{{servlet-context}}/img/threelines.png" alt="Menu"/>
|
<img id="nav-icon" src="/img/threelines.png" alt="Menu"/>
|
||||||
<menu id="nav-menu" class="nav">
|
<menu id="nav-menu" class="nav">
|
||||||
<li class=""><a href="{{servlet-context}}/">Home</a></li>
|
<li class=""><a href="/">Home</a></li>
|
||||||
<li class=""><a href="https://library.projecthope.scot/">Library</a></li>
|
<li class=""><a href="https://library.projecthope.scot/">Library</a></li>
|
||||||
{% if user %}
|
{% if user %}
|
||||||
<li class=""><a href="{{servlet-context}}/roles">Roles</a></li>
|
<li class=""><a href="roles">Roles</a></li>
|
||||||
<li class=""><a href="{{servlet-context}}/logout">Logout</a></li>
|
<li class=""><a href="logout">Logout</a></li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class=""><a href="{{servlet-context}}/register">Register</a></li>
|
<li class=""><a href="register">Register</a></li>
|
||||||
<li class=""><a href="{{servlet-context}}/login">Login</a></li>
|
<li class=""><a href="login">Login</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li class=""><a href="{{servlet-context}}/about">About</a></li>
|
<li class=""><a href="about">About</a></li>
|
||||||
{% if user %}
|
{% if user %}
|
||||||
<li id="user"><a href="{{servlet-context}}/profile">Logged in as {{user.username}}</a></li>
|
<li id="user"><a href="profile">Logged in as {{user.username}}</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</menu>
|
</menu>
|
||||||
</div>
|
</div>
|
||||||
|
@ -91,16 +91,16 @@
|
||||||
<footer>
|
<footer>
|
||||||
<div id="credits">
|
<div id="credits">
|
||||||
<div>
|
<div>
|
||||||
<img src="{{servlet-context}}/img/credits/ric-logo.png" width="24" height="24"/>
|
<img src="/img/credits/ric-logo.png" width="24" height="24"/>
|
||||||
A project of the
|
A project of the
|
||||||
<a href="https://radical.scot/">Radical Independence Campaign</a> ||
|
<a href="https://radical.scot/">Radical Independence Campaign</a> ||
|
||||||
Version {{version}}
|
Version {{version}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<img height="16" width="16" alt="Clojure" src="{{servlet-context}}/img/credits/luminus-logo.png"/>Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> ||
|
<img height="16" width="16" alt="Clojure" src="/img/credits/luminus-logo.png"/>Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> ||
|
||||||
<img height="16" width="16" alt="Clojure" src="{{servlet-context}}/img/credits/clojure-icon.gif"/> Powered by <a href="http://clojure.org">Clojure</a> ||
|
<img height="16" width="16" alt="Clojure" src="/img/credits/clojure-icon.gif"/> Powered by <a href="http://clojure.org">Clojure</a> ||
|
||||||
<img height="16" width="16" alt="GitHub" src="{{servlet-context}}/img/credits/github-logo-transparent.png"/>Find me/fork me on <a href="https://github.com/simon-brooke/youyesyet">Github</a> ||
|
<img height="16" width="16" alt="GitHub" src="/img/credits/github-logo-transparent.png"/>Find me/fork me on <a href="https://github.com/simon-brooke/youyesyet">Github</a> ||
|
||||||
<img height="16" width="16" alt="Free Software Foundation" src="{{servlet-context}}/img/credits/gnu.small.png"/>Licensed under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License version 2.0</a>
|
<img height="16" width="16" alt="Free Software Foundation" src="/img/credits/gnu.small.png"/>Licensed under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License version 2.0</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form action="{{servlet-context}}/login" method="post">
|
<form action="login" method="post">
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input type="hidden" name="redirect-to" value="{{servlet-context}}/roles"/>
|
<input type="hidden" name="redirect-to" value="{{servlet-context}}/roles"/>
|
||||||
<h2>
|
<h2>
|
||||||
|
|
|
@ -64,8 +64,8 @@
|
||||||
(apply 'do forms)))
|
(apply 'do forms)))
|
||||||
|
|
||||||
(defn compose-packet
|
(defn compose-packet
|
||||||
[item]
|
|
||||||
"Convert this `item` into a URI which can be sent as a GET call"
|
"Convert this `item` into a URI which can be sent as a GET call"
|
||||||
|
[item]
|
||||||
(assoc
|
(assoc
|
||||||
(url js/window.location)
|
(url js/window.location)
|
||||||
:path (str "/rest/" (name (:action item)))
|
:path (str "/rest/" (name (:action item)))
|
||||||
|
@ -74,6 +74,7 @@
|
||||||
|
|
||||||
|
|
||||||
(def feedback-messages
|
(def feedback-messages
|
||||||
|
"Messages used as feedback to the user"
|
||||||
{:fetch-locality "Fetching local data."
|
{:fetch-locality "Fetching local data."
|
||||||
:send-request "Request has been queued."
|
:send-request "Request has been queued."
|
||||||
:send-intention-and-visit "Voting intention has been sent"
|
:send-intention-and-visit "Voting intention has been sent"
|
||||||
|
@ -119,9 +120,10 @@
|
||||||
(remove-from-key db :outqueue x))
|
(remove-from-key db :outqueue x))
|
||||||
|
|
||||||
|
|
||||||
(defn coerce-to-number [v]
|
(defn coerce-to-number
|
||||||
"If it is possible to do so, coerce `v` to a number.
|
"If it is possible to do so, coerce `v` to a number.
|
||||||
NOTE: I tried to do this in *cljc*, but it did not work. Leave it alone."
|
NOTE: I tried to do this in *cljc*, but it did not work. Leave it alone."
|
||||||
|
[v]
|
||||||
(if (number? v) v
|
(if (number? v) v
|
||||||
(try
|
(try
|
||||||
(read-string (str v))
|
(read-string (str v))
|
||||||
|
|
14
workspace.code-workspace
Normal file
14
workspace.code-workspace
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../adl-support"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../Selmer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
Loading…
Reference in a new issue