Progress...

This commit is contained in:
simon 2017-07-15 19:36:37 +01:00
parent be324e9d06
commit 2ce44cc0b8
6 changed files with 61 additions and 40 deletions

View file

@ -46,6 +46,7 @@
#nav-menu { #nav-menu {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 100%;
} }
#nav menu li { #nav menu li {

View file

@ -1,16 +1,5 @@
<!DOCTYPE html> {% extends "base-authenticated.html" %}
<html> {% block whole-page %}
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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-app.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"/>
<title>You Yes Yet?</title>
</head>
<body>
<div id="app"> <div id="app">
<div class="splash-screen"> <div class="splash-screen">
<div class="sk-fading-circle"> <div class="sk-fading-circle">
@ -33,21 +22,16 @@
You must enable JavaScript to use the You Yes Yet app. You must enable JavaScript to use the You Yes Yet app.
</p> </p>
</div> </div>
{% endblock %}
{% block extra-script %}
<!-- scripts and styles --> <!-- scripts and styles -->
<!-- ATTENTION \/ --> <!-- ATTENTION \/ -->
<!-- Leaflet --> <!-- Leaflet -->
<link rel="stylesheet" href="vendor/leaflet/dist/leaflet.css" /> <link rel="stylesheet" href="vendor/leaflet/dist/leaflet.css" />
<script src="vendor/leaflet/dist/leaflet.js"></script> <script src="vendor/leaflet/dist/leaflet.js"></script>
<!-- ATTENTION /\ --> <!-- ATTENTION /\ -->
<script type="text/javascript">
var context = "{{servlet-context}}";
var csrfToken = "{{csrf-token}}";
</script>
{% script "/js/app.js" %} {% script "/js/app.js" %}
</body> {% endblock %}
</html>

View file

@ -3,12 +3,14 @@
<head> <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-static.css" /> <link rel="stylesheet" type="text/css" href="css/yyy-common.css" />
<link rel="stylesheet" type="text/css" href="css/yyy-site.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>{{title}}</title> <title>{{title}}</title>
</head> </head>
<body> <body>
{% block whole-page %}
<header> <header>
<div id="nav"> <div id="nav">
<img id="nav-icon" src="img/threelines.png" alt="Menu"/> <img id="nav-icon" src="img/threelines.png" alt="Menu"/>
@ -16,8 +18,12 @@
<li class=""><a href="index.html">Home</a></li> <li class=""><a href="index.html">Home</a></li>
<li class=""><a href="library.html">Library</a></li> <li class=""><a href="library.html">Library</a></li>
<li class=""><a href="register.html">Register</a></li> <li class=""><a href="register.html">Register</a></li>
<li class=""><a href="login.html">Login</a></li> <li class="">{% if user %}<a href="logout.html">Logout</a>
{% else %}<a href="login.html">Login</a>{% endif %}</li>
<li class=""><a href="about.html">About</a></li> <li class=""><a href="about.html">About</a></li>
{% if user %}
<li id="user"><a href="profile">Logged in as {{user.username}}</a></li>
{% endif %}
</menu> </menu>
</div> </div>
@ -28,12 +34,40 @@
<div id="main-container" class="container"> <div id="main-container" class="container">
<div id="big-links"> <div id="big-links">
{{big-links}} {% block big-links %}
{% endblock %}
</div> </div>
<div if="#content"> <div if="#content">
{{content}} {% block content %}
{% endblock %}
</div>
<div id="back-link-container">
<a href="javascript:history.back()" id="back-link">Back</a>
</div> </div>
</div> </div>
<footer>
<div id="credits">
<div>
<img src="img/credits/ric-logo.png" width="24" height="24"/>
A project of the
<a href="https://radical.scot/">Radical Independence Campaign</a> ||
Version {{version}}
</div>
<div>
<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="img/credits/clojure-icon.gif"/> Powered by <a href="http://clojure.org">Clojure</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/smeagol">Github</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>
</footer>
{% endblock %}
<script type="text/javascript">
var context = "{{servlet-context}}";
var csrfToken = "{{csrf-token}}";
</script>
{% block extra-script %}
{% endblock %}
</body> </body>
</html> </html>

View file

@ -1,9 +1,4 @@
{% extends "base-unauthenticated.html" %} {% extends "base-unauthenticated.html" %}
{% block big-links %}
<div id="back-link-container">
<a href="javascript:history.back()" id="back-link">Back</a>
</div>
{% endblock %}
{% block content %} {% block content %}
<p> <p>
We're not going to do login in the long term; we're going to use oauth. We're not going to do login in the long term; we're going to use oauth.

View file

@ -1,5 +1,6 @@
{% extends "base-authenticated.html" %} {% extends "base-authenticated.html" %}
{% block title %} {% block title %}
{{ user }}
{% endblock %} {% endblock %}
{% block big-links %} {% block big-links %}
<div class="big-link-container"> <div class="big-link-container">
@ -7,7 +8,9 @@
</div> </div>
{% for role in roles %} {% for role in roles %}
<div class="big-link-container"> <div class="big-link-container">
<a href="{{role}}" class="big-link" id="big-link">{{role}}</a> <a href="{{role.name|lower}}" class="big-link" id="big-link">{{role.name}}</a>
</div> </div>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
{% block content %}
{% endblock %}

View file

@ -34,9 +34,11 @@
(defn app-page [] (defn app-page []
(layout/render "app.html")) (layout/render "app.html"))
(defn about-page [] (defn about-page []
(layout/render "about.html")) (layout/render "about.html"))
(defn call-me-page [request] (defn call-me-page [request]
(if (if
request request
@ -57,8 +59,10 @@
roles (if user (db-core/get-roles-by-canvasser db-core/*db* {:canvasser (:id user)}))] roles (if user (db-core/get-roles-by-canvasser db-core/*db* {:canvasser (:id user)}))]
(cond (cond
roles (layout/render "roles.html" roles (layout/render "roles.html"
{:title (str "Welcome " (:fullname user)) {:title (str "Welcome " (:fullname user) ", what do you want to do?")
:user user
:roles roles}) :roles roles})
(empty? roles)(response/found "/app")
true (assoc (response/found "/login") :session (dissoc session :user)) true (assoc (response/found "/login") :session (dissoc session :user))
))) )))