Skip to content

Commit

Permalink
Design update, app is complete now
Browse files Browse the repository at this point in the history
  • Loading branch information
Bianca committed Mar 12, 2020
1 parent 86be619 commit 2012900
Show file tree
Hide file tree
Showing 29 changed files with 57 additions and 214 deletions.
4 changes: 0 additions & 4 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ p, em, strong {
font-size: small;
}

.btn {
margin: 1vw;
}

// Login & user creation screens

.user-screens {
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?

def after_sign_in_path_for(user)
stored_location_for(user) || dashboard_path
end

protected

def configure_permitted_parameters
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/page_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ def dashboard
@bookings_out = Booking.where(user_id: current_user.id)
end

def home
end

def about
end
end
2 changes: 1 addition & 1 deletion app/views/bookings/_booking-in-flags.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="card-text text-center text-primary">
<div class="card-text text-center text-primary flex-column justify-content-center">
<% state = state(booking) %>
<% if state.start_with? "error" %>
<h5>Please log a ticket <a href="https://github.com/miztrz/kitnappd/issues">here</a> and quote error code <%= state.delete_prefix("error ") %>. We will resolve this as soon as possible.</h5>
Expand Down
2 changes: 1 addition & 1 deletion app/views/bookings/_booking-out-flags.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="card-text text-center text-primary mb-3">
<div class="card-text text-center text-primary row d-flex justify-content-center">
<% state = state(booking) %>
<% if state.start_with? "error" %>
<h5>Please log a ticket <a href="https://github.com/miztrz/kitnappd/issues">here</a> and quote error code <%= state.delete_prefix("error ") %>. We will resolve this as soon as possible.</h5>
Expand Down
4 changes: 2 additions & 2 deletions app/views/bookings/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%= form.label 'End date', class: "col-sm-2 col-form-label" %>
<%= form.date_field :end_time, type:'date', class: "form-control col-sm-4" %>
</div>
<div class="actions">
<%= form.submit "Create booking", class: "btn btn-primary btn-block" %>
<div class="row d-flex justify-content-center">
<%= form.submit "Create booking", class: "btn btn-outline-primary" %>
</div>
<% end %>
6 changes: 0 additions & 6 deletions app/views/bookings/edit.html.erb

This file was deleted.

45 changes: 0 additions & 45 deletions app/views/bookings/index.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion app/views/bookings/index.json.jbuilder

This file was deleted.

5 changes: 0 additions & 5 deletions app/views/bookings/new.html.erb

This file was deleted.

39 changes: 0 additions & 39 deletions app/views/bookings/show.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion app/views/bookings/show.json.jbuilder

This file was deleted.

5 changes: 1 addition & 4 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
<em class="text-muted col-sm-12">(we need your current password to confirm your changes)</em>
</div>
<div class="form-group row d-flex justify-content-around">
<%= f.submit "Update", class: "btn btn-primary btn-block" %>
</div>
<div class="form-group row d-flex justify-content-around">
<%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-primary btn-block" %>
<%= f.submit "Update", class: "btn btn-outline-primary" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
4 changes: 2 additions & 2 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<%= f.label 'Confirm', class: "col-sm-3 col-form-label" %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control col-sm-9", placeholder: "Password confirmation" %>
</div>
<div class="form-group row d-flex justify-content-around">
<%= f.submit "Sign up", class: "btn btn-primary btn-block" %>
<div class="form-group row d-flex justify-content-center">
<%= f.submit "Sign up", class: "btn btn-outline-primary" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
4 changes: 2 additions & 2 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<%= f.label :password, class: "col-sm-3 col-form-label" %><br />
<%= f.password_field :password, autocomplete: "current-password", class: "form-control col-sm-9", placeholder: "Password" %>
</div>
<div class="form-group row d-flex justify-content-around">
<%= f.submit "Log in", class: "btn btn-primary btn-block" %>
<div class="form-group row d-flex justify-content-center">
<%= f.submit "Log in", class: "btn btn-outline-primary mb-3" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
39 changes: 9 additions & 30 deletions app/views/devise/shared/_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,47 +1,26 @@
<div class="form-group row d-flex justify-content-around">
<%- if controller_name != 'sessions' && !user_signed_in? %>
<div class="form-group row d-flex justify-content-around">
<%= link_to "Log in", new_session_path(resource_name), class: "btn btn-primary btn-block" %>
</div>
<%= link_to "Log in", new_session_path(resource_name), class: "btn btn-outline-primary" %>
<% end %>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<div class="form-group row d-flex justify-content-around">
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn btn-primary btn-block" %>
</div>
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn btn-outline-primary" %>
<% end %>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<div class="form-group row d-flex justify-content-around">
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn btn-primary btn-block" %>
</div>
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn btn-outline-primary" %>
<% end %>
<%- if user_signed_in? && controller_name == 'registrations' %>
<div class="form-group row d-flex justify-content-around">
<%= link_to "Change password", edit_password_path(resource_name), class: "btn btn-primary btn-block" %>
</div>
<%= link_to "Change password", edit_password_path(resource_name), class: "btn btn-outline-primary" %>
<% end %>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<div class="form-group row d-flex justify-content-around">
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: "btn btn-primary btn-block" %>
</div>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: "btn btn-outline-primary" %>
<% end %>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<div class="form-group row d-flex justify-content-around">
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: "btn btn-primary btn-block" %>
</div>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: "btn btn-outline-primary" %>
<% end %>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<div class="form-group row d-flex justify-content-around">
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), class: "btn btn-primary btn-block" %>
</div>
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), class: "btn btn-outline-primary" %>
<% end %>
<% end %>

<div class="form-group row d-flex justify-content-around">
<%= link_to "Back", :back , class: "btn btn-primary btn-block" %>
<%= link_to "Back", :back , class: "btn btn-outline-primary" %>
</div>
23 changes: 13 additions & 10 deletions app/views/kittens/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<%= form_with(model: kitten, local: true) do |form| %>
<section class="container">
<%= form_with(model: kitten, local: true) do |form| %>
<% if kitten.errors.any? %>
<div id="error_explanation" class="alert alert-warning alert-dismissible fade show" role="alert" >
<div id="error_explanation" class="alert alert-warning alert-dismissible fade show" role="alert">
<h5><%= pluralize(kitten.errors.count, "error") %> prohibited this kitten from being saved:</h5>
<ul>
<% kitten.errors.full_messages.each do |message| %>
Expand All @@ -12,21 +13,21 @@
<span aria-hidden="true">&times;</span>
</button>
</div>
<% end %>l
<% end %>
<div class="form-group row">
<%= form.label :name, class: "col-sm-2 col-form-label" %>
<div class="input-group col-sm-4 mb-3">
<%= form.text_field :name, class: "form-control col-sm-4", placeholder: "Kitten Name" %>
<%= form.text_field :name, class: "form-control", placeholder: "Kitten Name" %>
</div>
<%= form.label :breed, class: "col-sm-2 col-form-label" %>
<div class="input-group col-sm-4 mb-3">
<%= form.text_field :breed, class: "form-control col-sm-4", placeholder: "Kitten Breed" %>
<%= form.text_field :breed, class: "form-control", placeholder: "Kitten Breed" %>
</div>
</div>
<div class="form-group row">
<%= form.label :description, class: "col-sm-2 col-form-label" %>
<div class="input-group col-sm-4 mb-3">
<%= form.text_area :description, class: "form-control col-sm-10" %>
<div class="input-group col-sm-10 mb-3">
<%= form.text_area :description, class: "form-control" %>
</div>
</div>
<div class="form-group row">
Expand All @@ -48,7 +49,9 @@
<% if kitten.images.attached? %>
<%= render 'imagegallery' %>
<% end %>
<div class="actions">
<%= form.submit class:"btn btn-primary btn-block col-12" %>
<div class="form-group row d-flex justify-content-around">
<%= form.submit class:"btn btn-outline-primary" %>
<%= link_to 'Back', kittens_path, class: "btn btn-outline-primary" %>
</div>
<% end %>
<% end %>
</section>
2 changes: 0 additions & 2 deletions app/views/kittens/_kitten.json.jbuilder

This file was deleted.

8 changes: 2 additions & 6 deletions app/views/kittens/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
<h1>Editing </h1>

<%= render 'form', kitten: @kitten %>
<%= link_to 'Show', @kitten %> |
<%= link_to 'Back', kittens_path %>
<% @page_title = "Editing #{@kitten.name}" %>
<%= render 'form', kitten: @kitten %>
1 change: 0 additions & 1 deletion app/views/kittens/index.json.jbuilder

This file was deleted.

7 changes: 2 additions & 5 deletions app/views/kittens/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<h1>New Kitten</h1>

<%= render 'form', kitten: @kitten %>
<%= link_to 'Back', kittens_path %>
<% @page_title = "New Kitten" %>
<%= render 'form', kitten: @kitten %>
13 changes: 6 additions & 7 deletions app/views/kittens/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<h5 class="col-sm-3">Description</h5>
<h6 class="col-sm-9"><%= @kitten.description %></h6>
</div>
<div class="row d-flex justify-content-around mb-3">
<% if user_signed_in? && @kitten.user_id == current_user.id %>
<%= link_to 'Edit', edit_kitten_path(@kitten), class:"btn btn-outline-primary" %>
<% end %>
<%= link_to 'Back', _back_url, class:"btn btn-outline-primary" %>
</div>
</section> <!-- kitten-details -->

<section class="container kitten-images">
Expand Down Expand Up @@ -39,10 +45,3 @@
<%= render 'bookings/form' %>
<% end %>
</section>

<section class="container">
<% if user_signed_in? && @kitten.user_id == current_user.id %>
<%= link_to 'Edit', edit_kitten_path(@kitten), class:"btn btn-primary btn-block" %>
<% end %>
<%= link_to 'Back', _back_url, class:"btn btn-primary btn-block" %>
</section>
1 change: 0 additions & 1 deletion app/views/kittens/show.json.jbuilder

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/layouts/_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ul class="navbar-nav">
<% if user_signed_in? %>
<li class="nav-item">
<%= link_to 'Dashboard', page_dashboard_path, class: 'nav-link' %>
<%= link_to 'Dashboard', dashboard_path, class: 'nav-link' %>
</li>
<li class="nav-item">
<%= link_to 'Logout', destroy_user_session_path, method: :delete, class: 'nav-link' %>
Expand Down
2 changes: 0 additions & 2 deletions app/views/page/about.html.erb

This file was deleted.

10 changes: 5 additions & 5 deletions app/views/page/dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<h5 class="col-sm-2">Email:</h5>
<h6 class="col-sm-10"><%= current_user.email %></h6>
</div>
<div class="form-group row d-flex justify-content-between">
<%= link_to "Edit details", edit_user_registration_path(current_user), class: "col-md-10 btn btn-primary btn-block" %>
<%= link_to "Change password", edit_user_password_path(current_user), class: "col-md-10 btn btn-primary btn-block" %>
<div class="form-group row d-flex justify-content-around">
<%= link_to "Edit", edit_user_registration_path(current_user), class: "btn btn-outline-primary" %>
<%= link_to "Change password", edit_user_password_path(current_user), class: "btn btn-outline-primary" %>
</div>
</section>
<section class="dash-bookings">
Expand All @@ -24,8 +24,8 @@
</div>
<section class="dash-kitten-cards">
<h2>Your Kittens</h2>
<div class="form-group row d-flex justify-content-between">
<%= link_to "New kitten", new_kitten_path, class: "btn btn-primary btn-block" %>
<div class="form-group row d-flex justify-content-center">
<%= link_to "New kitten", new_kitten_path, class: "btn btn-outline-primary" %>
</div>
<div class="kitten-cards">
<% @kittens.each do |kitten| %>
Expand Down
Loading

0 comments on commit 2012900

Please sign in to comment.