diff --git a/.gitignore b/.gitignore index 4541a7b9..ede23d93 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .bundle/ vendor/ +node_modules/ diff --git a/lib/sutty/login.rb b/lib/sutty/login.rb index 65313b30..fd9062bd 100644 --- a/lib/sutty/login.rb +++ b/lib/sutty/login.rb @@ -17,6 +17,9 @@ module Sutty enable :logging enable :auth_use_referrer + set :auth_error_message, 'Hubo un error al ingresar' + set :auth_success_message, '¡Bienvenida!' + # Configura Warden para usar la estrategia IMAP y obtener la cuenta # de usuaria a partir de la cookie. use Warden::Manager do |config| @@ -30,5 +33,9 @@ module Sutty end set :root, File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) + + before do + @has_cover = true + end end end diff --git a/package.json b/package.json new file mode 100644 index 00000000..97be469e --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "bootstrap": "4.0" + } +} diff --git a/public/assets/css/bootstrap.min.css b/public/assets/css/bootstrap.min.css new file mode 120000 index 00000000..e900d3be --- /dev/null +++ b/public/assets/css/bootstrap.min.css @@ -0,0 +1 @@ +../../../node_modules/bootstrap/dist/css/bootstrap.min.css \ No newline at end of file diff --git a/public/assets/css/bootstrap.min.css.map b/public/assets/css/bootstrap.min.css.map new file mode 120000 index 00000000..a9c9c3b0 --- /dev/null +++ b/public/assets/css/bootstrap.min.css.map @@ -0,0 +1 @@ +../../../node_modules/bootstrap/dist/css/bootstrap.min.css.map \ No newline at end of file diff --git a/public/assets/css/sutty.css b/public/assets/css/sutty.css new file mode 100644 index 00000000..b80bcaec --- /dev/null +++ b/public/assets/css/sutty.css @@ -0,0 +1,11 @@ +.background-cover { + background: url(/assets/img/background.jpg) no-repeat center center fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; +} + +.full-height { + height: 100vh; +} diff --git a/public/assets/img/background.jpg b/public/assets/img/background.jpg new file mode 100644 index 00000000..0e6c2d0d Binary files /dev/null and b/public/assets/img/background.jpg differ diff --git a/views/layout.haml b/views/layout.haml new file mode 100644 index 00000000..482fe73a --- /dev/null +++ b/views/layout.haml @@ -0,0 +1,10 @@ +!!! +%html + %head + %meta{content: "text/html; charset=UTF-8", 'http-equiv': "Content-Type"}/ + %title Sutty + %link{rel: 'stylesheet', type: 'text/css', href: '/assets/css/bootstrap.min.css'} + %link{rel: 'stylesheet', type: 'text/css', href: '/assets/css/sutty.css'} + %body{class: @has_cover ? 'background-cover' : ''} + .container + = yield diff --git a/views/login.haml b/views/login.haml index 05db7fcb..0eb8b201 100644 --- a/views/login.haml +++ b/views/login.haml @@ -1,11 +1,14 @@ -%h1 Hola! +.row.align-items-center.justify-content-center.full-height + .col-md-6.align-self-center + - if flash[:error] + .alert.alert-danger{role: 'alert'} + = flash[:error] -- if flash[:error] - .alert.alert-danger{role: 'alert'} - = flash[:error] + %form{method: 'post', action: '/login'} + .form-group + %input{type: 'email', name: 'username', class: 'form-control', placeholder: 'Correo'} + .form-group + %input{type: 'password', name: 'password', class: 'form-control', placeholder: 'Contraseña'} -%form{method: 'post', action: '/login'} - %input{type: 'email', name: 'username', placeholder: 'Correo'} - %input{type: 'password', name: 'password', placeholder: 'Contraseña'} - - %input{type: 'submit', value: 'Ingresar'} + .form-group + %input{type: 'submit', value: 'Ingresar', class: 'btn btn-lg btn-primary btn-block'} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..24e83b6c --- /dev/null +++ b/yarn.lock @@ -0,0 +1,7 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +bootstrap@4.0: + version "4.0.0-beta" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0-beta.tgz#dc5928175d2e71310bc668cf9e05a907211b72a6"