Skip to content

Commit

Permalink
switch to container-fluid to stretch background colors across page
Browse files Browse the repository at this point in the history
  • Loading branch information
sjfox26 committed Apr 9, 2018
1 parent a27cead commit 3c999d2
Show file tree
Hide file tree
Showing 13 changed files with 234 additions and 149 deletions.
262 changes: 135 additions & 127 deletions .idea/workspace.xml

Large diffs are not rendered by default.

40 changes: 23 additions & 17 deletions app/assets/stylesheets/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $gray-medium-light: #eaeaea;
/* GLOBAL STYLES */
body {
padding-top: 60px;
font-family:"Trebuchet MS";
font-family: "AvenirNext",Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;
}

/* HEADER */
Expand All @@ -41,7 +41,6 @@ header {
//letter-spacing: -1px;
padding-top: 9px;
// font-weight: bold;
font-family: Helvetica, Arial, Verdana, sans-serif;

/* & is reference to parent logo. this is nested writing per 5.2.2 of Ruby on Rails Tutorial */
&:hover {
Expand Down Expand Up @@ -103,15 +102,14 @@ header {
footer {
position: fixed;
bottom: 0; /*https://stackoverflow.com/questions/19330611/fixed-footer-in-bootstrap*/
margin-top: 45px;
margin: 10px 0 20px;
padding-top: 5px;
border-top: 1px solid #eaeaea;
color: #777;
}

footer a {
color: #555;
font-size: 1.1em;
font-size: 1.25em;
margin-right: 20px;
}

footer a:hover {
Expand Down Expand Up @@ -148,10 +146,18 @@ footer ul li {

}

.location_and_hours_container{
.about_us_container{
padding: 0 50px;
}

#about_us{

}

.location_and_hours_container{
padding: 0 50px;
}

#location_and_hours{
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -180,17 +186,11 @@ footer ul li {

}

.about_us_container{
padding-left: 50px;
}

#about_us{

}

.about_tom_container{
margin-top: 20px;
//padding-left: 50px;
margin-top: 70px;
padding-top: 20px;
background-color: #f2f2f2;

}

Expand Down Expand Up @@ -219,7 +219,7 @@ footer ul li {
}

.tom_description_content{
padding-top: 15px;
padding: 15px;
}

.services_container{
Expand Down Expand Up @@ -391,3 +391,9 @@ h3{
.gallery_page_container, .row {
padding-top: 20px;
}

/* CONTACT STYLES */

.center{
text-align: center;
}
22 changes: 22 additions & 0 deletions app/controllers/messages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class MessagesController < ApplicationController
def new
@message = Message.new
end

def create
@message = Message.new(message_params)
if @message.valid?
MessageMailer.contact(@message).deliver_now
redirect_to new_message_url
flash[:notice] = "Thanks! We have received your message and will be in touch soon."
else
flash[:danger] = "There was an error in sending your message. Please try again."
render :new
end
end

private
def message_params
params.require(:message).permit(:name, :phone_number, :body)
end
end
4 changes: 4 additions & 0 deletions app/mailers/messages_mailer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class MessagesMailer < ApplicationMailer
def contact(@message)
end
end
2 changes: 1 addition & 1 deletion app/models/message.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Message
include ActiveModel::Model
attr_accessor :name, :phone_number, :body
validates :name, :phone_number, :body, presence: true
validates :name, :phone_number, presence: true
end
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<li class="nav-item"><%= link_to("Gallery", gallery_path, class: "nav-link")%></li>
<li class="nav-item"><%= link_to("Testimonials", '#', class: "nav-link")%></li>
<li class="nav-item"><%= link_to("About", about_path, class: "nav-link")%></li>
<li class="nav-item"><%= link_to("Contact", '#', class: "nav-link anchor")%></li>
<li class="nav-item"><%= link_to("Contact", contact_path, class: "nav-link anchor")%></li>
</ul><!--nav navbar-nav navbar-right-->
</div><!--collapse navbar-collapse-->
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class ="alert alert-<%= message_type %>"><%= message %></div>
<% end %>
<%= yield %>
<%= debug(params) if Rails.env.development? %>
<%= render 'layouts/footer' %>
</div>
</body>
Expand Down
27 changes: 27 additions & 0 deletions app/views/messages/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<div class="container">
<div class="row">

<div class="col-md-8 col-md-offset-2">

<h1> Contact Fox Decorating</h1>

<p class="center"> Drop us a line and we will be in touch soon!</p><br/>

<%= form_for @message, url: contact_path, method: :post do |f| %>
<%= f.label :name, "Name:" %>
<%= f.text_field :name, class: 'form-control' %>
<%= f.label :phone_number, "Contact Phone:" %>
<%= f.email_field :phone_number, class: 'form-control' %>
<%= f.label :body, "Optional Message:" %>
<%= f.email_field :body, class: 'form-control' %>
<% end %>
<br/>
<%= submit_tag("Contact Us", class: "btn btn-primary col-md-12") %>

</div>
</div>
</div>
5 changes: 3 additions & 2 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>

<div class="container_for_background">
<div class="content_container container">
<div class="content_container container-fluid">

<div class="row">

Expand Down Expand Up @@ -38,6 +38,7 @@
</div>

</div>
</div>

<div class="about_tom_container col-12">
<div id="about_tom">
Expand Down Expand Up @@ -71,7 +72,7 @@
</div>
</div>
</div>
</div>



<%#https://stackoverflow.com/questions/19918942/gmaps4rails-v2-change-default-zoom%>
Expand Down
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
root 'static_pages#home'
get '/about', to: 'static_pages#about'
get '/gallery', to: 'static_pages#gallery'

get '/contact', to: 'messages#new'
post '/contact', to: 'messages#create'
end
5 changes: 5 additions & 0 deletions spec/controllers/messages_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe MessagesController, type: :controller do

end
5 changes: 5 additions & 0 deletions spec/mailers/messages_mailer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require "rails_helper"

RSpec.describe MessagesMailer, type: :mailer do
pending "add some examples to (or delete) #{__FILE__}"
end
4 changes: 4 additions & 0 deletions spec/mailers/previews/messages_mailer_preview.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Preview all emails at http:https://localhost:3000/rails/mailers/messages_mailer
class MessagesMailerPreview < ActionMailer::Preview

end

0 comments on commit 3c999d2

Please sign in to comment.