Skip to content

Commit

Permalink
Change login form to haml from html
Browse files Browse the repository at this point in the history
  • Loading branch information
canan8 committed May 17, 2020
1 parent 14a0521 commit c80ab33
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 37 deletions.
4 changes: 3 additions & 1 deletion app/views/layouts/_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -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? %>
<div class="right menu">
<div class="ui simple dropdown item" id="dropdown">
Account <i class="dropdown icon"></i>
Expand All @@ -11,4 +12,5 @@
<%= link_to 'Log out', root_path, class: 'item' %>
</div>
</div>
</div>
</div>
<% end %>
36 changes: 0 additions & 36 deletions app/views/welcome/index.html.erb

This file was deleted.

23 changes: 23 additions & 0 deletions app/views/welcome/index.html.haml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
resources :users, only: [:show, :index]
root 'welcome#index'
get 'teams', to: 'teams#index'
post 'login', to: 'sessions#create'
end

0 comments on commit c80ab33

Please sign in to comment.