diff --git a/app/assets/images/mail-128.png b/app/assets/images/mail-128.png new file mode 100644 index 0000000..6b21e4a Binary files /dev/null and b/app/assets/images/mail-128.png differ diff --git a/app/assets/stylesheets/_footer.css.scss b/app/assets/stylesheets/_footer.css.scss index fd26682..64a97f7 100644 --- a/app/assets/stylesheets/_footer.css.scss +++ b/app/assets/stylesheets/_footer.css.scss @@ -1,4 +1,14 @@ +html { + position: relative; + min-height: 100%; +} +body { + margin: 0 0 $footer-height; +} + + .footer-2 { + $footer-background: desaturate(darken($base-accent-color, 20), 30); $footer-color: white; $footer-link-color: transparentize($footer-color, .6); @@ -8,6 +18,11 @@ padding: $base-line-height; width: 100%; + position: absolute; + left: 0; + bottom: 0; + height: $footer-height; + .footer-logo { margin-right: 1em; margin-bottom: 1em; diff --git a/app/assets/stylesheets/_variables.css.scss b/app/assets/stylesheets/_variables.css.scss new file mode 100644 index 0000000..83ba7c9 --- /dev/null +++ b/app/assets/stylesheets/_variables.css.scss @@ -0,0 +1 @@ +$footer-height: 100px; diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index c6a7c3b..2a6895b 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -12,15 +12,15 @@ *= require_self */ + @import "bourbon"; @import "bitters/bitters"; @import "neat"; +@import "variables"; @import "footer"; @import "header"; @import "employees"; - - .box { padding-top: 30px; } diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb new file mode 100644 index 0000000..4b8d543 --- /dev/null +++ b/app/controllers/invites_controller.rb @@ -0,0 +1,7 @@ +class InvitesController < ApplicationController + def create + email = params[:email] + InviteMailer.invite_email(email).deliver + redirect_to root_path + end +end diff --git a/app/controllers/job_titles_controller.rb b/app/controllers/job_titles_controller.rb new file mode 100644 index 0000000..d4a1252 --- /dev/null +++ b/app/controllers/job_titles_controller.rb @@ -0,0 +1,53 @@ +class JobTitlesController < ApplicationController + def index + @job_titles = JobTitle.all + end + + def new + @job_title = JobTitle.new + end + + def create + @job_title = JobTitle.new(job_title_params) + if @job_title.save + redirect_to @job_title + else + render :new + end + end + + def show + @job_title = find_job_title + end + + def edit + @job_title = find_job_title + end + + def update + @job_title = find_job_title + if @job_title.update(job_title_params) + redirect_to root_path + else + render :edit + end + end + + def destroy + job_title = find_job_title + job_title.destroy + redirect_to root_path + end + + private + + def job_title_params + params.require(:job_title).permit(:name) + end + + def find_job_title + JobTitle.find(params[:id]) + end + +end + diff --git a/app/mailers/invite_mailer.rb b/app/mailers/invite_mailer.rb new file mode 100644 index 0000000..9c74134 --- /dev/null +++ b/app/mailers/invite_mailer.rb @@ -0,0 +1,8 @@ +class InviteMailer < ActionMailer::Base + default from: "invite@dundermifflin.com" + + def invite_email(email) + mail(to: email, subject: 'Welcome to the Dunder Mifflin Family!') + end + +end diff --git a/app/views/application/_footer.html.erb b/app/views/application/_footer.html.erb index 7511fd5..416958c 100644 --- a/app/views/application/_footer.html.erb +++ b/app/views/application/_footer.html.erb @@ -6,6 +6,7 @@
+ Head over to DunderMifflin.com and create your account!
+ + diff --git a/app/views/job_titles/_job_title.html.erb b/app/views/job_titles/_job_title.html.erb new file mode 100644 index 0000000..7e15ccf --- /dev/null +++ b/app/views/job_titles/_job_title.html.erb @@ -0,0 +1,5 @@ +<%= link_to image_tag(employee.profile.avatar), [employee, :profile] %>
+<% end %> diff --git a/app/views/pages/invite.html.erb b/app/views/pages/invite.html.erb new file mode 100644 index 0000000..e1b6054 --- /dev/null +++ b/app/views/pages/invite.html.erb @@ -0,0 +1,8 @@ +