From dfb1eb89909076b5d76ba27c1b5e558ea7914c5b Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Thu, 28 Jul 2016 09:21:38 -0400 Subject: clean up login page --- src/guff/views/pages/login.cr | 21 +++++++++++++++++++++ src/views/pages/login.ecr | 19 ++++--------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/guff/views/pages/login.cr b/src/guff/views/pages/login.cr index dae1a82..8dc7b65 100644 --- a/src/guff/views/pages/login.cr +++ b/src/guff/views/pages/login.cr @@ -1,10 +1,31 @@ require "../html" class Guff::Views::Pages::Login < Guff::Views::HTMLView + TITLE = "Guff" + + 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 + } + + SCRIPTS = %w{ + assets/jquery-2.2.1.min.js + assets/bootstrap-3.3.6/js/bootstrap.min.js + } + def initialize(context : Context, @error : String? = nil) super(context) end + private def styles + super(STYLES) + end + + private def scripts + super(SCRIPTS) + end + def get_csrf_token @context.models.csrf.create_token end diff --git a/src/views/pages/login.ecr b/src/views/pages/login.ecr index 16f63a4..4762104 100644 --- a/src/views/pages/login.ecr +++ b/src/views/pages/login.ecr @@ -2,15 +2,9 @@ - Guff Login + <%= h(TITLE) %> - <%= - 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 - } - %> + <%= styles %> @@ -25,7 +19,7 @@ class='navbar-brand' > - Guff + <%= h(TITLE) %> @@ -105,10 +99,5 @@ - <%= - scripts %w{ - assets/jquery-2.2.1.min.js - assets/bootstrap-3.3.6/js/bootstrap.min.js - } - %> + <%= scripts %> -- cgit v1.2.3