From c80ab331d9760d257dbdb1b7626e9b1b07da6f0f Mon Sep 17 00:00:00 2001 From: Canan Date: Sun, 17 May 2020 18:27:01 +0300 Subject: [PATCH] Change login form to haml from html --- app/views/layouts/_navigation.html.erb | 4 ++- app/views/welcome/index.html.erb | 36 -------------------------- app/views/welcome/index.html.haml | 23 ++++++++++++++++ config/routes.rb | 1 + 4 files changed, 27 insertions(+), 37 deletions(-) delete mode 100644 app/views/welcome/index.html.erb create mode 100644 app/views/welcome/index.html.haml diff --git a/app/views/layouts/_navigation.html.erb b/app/views/layouts/_navigation.html.erb index 8a2a633..dd893ac 100644 --- a/app/views/layouts/_navigation.html.erb +++ b/app/views/layouts/_navigation.html.erb @@ -1,6 +1,7 @@ <%= link_to 'Pretro', root_path, class: 'item' %> <%= link_to 'Home', root_path, class: 'item' %> <%= link_to 'Teams', teams_path, class: 'item' %> +<% if user_signed_in? %> - \ No newline at end of file + +<% end %> \ No newline at end of file diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb deleted file mode 100644 index 351fc21..0000000 --- a/app/views/welcome/index.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -

Welcome to Pretro!

- -
-
-
-
-
-
- -
- - -
-
-
- -
- - -
-
-
Login
-
-
-
-
- - Sign Up -
-
-
-
- Or -
-
-
\ No newline at end of file diff --git a/app/views/welcome/index.html.haml b/app/views/welcome/index.html.haml new file mode 100644 index 0000000..6de2159 --- /dev/null +++ b/app/views/welcome/index.html.haml @@ -0,0 +1,23 @@ +%h2.ui.centered.header Welcome to Pretro! +.ui.container + .ui.placeholder.segment + .ui.two.column.very.relaxed.stackable.grid + .column + = form_with scope: :session, class: "ui form", url: login_path do |f| + .field + =f.label :username + .ui.left.icon.input + =f.text_field :username, placeholder: "Username" + %i.user.icon + .field + =f.label :password + .ui.left.icon.input + =f.text_field :password, placeholder: "Password" + %i.lock.icon + = f.button "Log in", class: "ui blue submit button" + .middle.aligned.column + .ui.big.button + %i.signup.icon + Sign Up + .ui.vertical.divider + Or diff --git a/config/routes.rb b/config/routes.rb index d9492fd..77dbea4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,4 +3,5 @@ resources :users, only: [:show, :index] root 'welcome#index' get 'teams', to: 'teams#index' + post 'login', to: 'sessions#create' end