From 3a6e1f52d920390041fdb0b1991546f61bc1a8ba Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 20 May 2016 22:42:43 -0400 Subject: make assets accessible when unauthed, populate login page --- src/guff.cr | 7 ++-- src/views/login-page.ecr | 99 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 74 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/guff.cr b/src/guff.cr index 2468c25..70bbc71 100644 --- a/src/guff.cr +++ b/src/guff.cr @@ -242,13 +242,14 @@ module Guff end end - class AssetsHandler < AuthenticatedHandler + # TODO: check referrer, add x-frame-options + class AssetsHandler < Handler def initialize(context : Context) - super(context, %w{admin editor}) + super(context) @etags = {} of String => String end - def authenticated_call(context : HTTP::Server::Context) + def call(context : HTTP::Server::Context) req_path = context.request.path.not_nil! if matching_request?(context.request.method, req_path) diff --git a/src/views/login-page.ecr b/src/views/login-page.ecr index 644f0ab..5e3c8ce 100644 --- a/src/views/login-page.ecr +++ b/src/views/login-page.ecr @@ -3,37 +3,78 @@ Guff Login + + <%= + styles %w{ + ../assets/font-awesome-4.5.0/css/font-awesome.min.css + ../assets/bootstrap-3.3.6/css/bootstrap.min.css + ../assets/bootstrap-3.3.6/css/bootstrap-theme.min.css + } + %> -
- - - - - - - - - -
+
+
+
+
+ + + Guff Login + +
+ +
+
+
+ + + +
+ +
+ + + +
+ +
+ +
+
+
+
+
+
+ + <%= + scripts %w{ + ../assets/jquery-2.2.1.min.js + ../assets/bootstrap-3.3.6/js/bootstrap.min.js + } + %> -- cgit v1.2.3