diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 131aede..4bb2a0a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,7 +12,11 @@ class ApplicationController < Sinatra::Base end get "/" do - erb :welcome + if logged_in? + redirect '/bix_plans' + else + erb :welcome + end end helpers do @@ -20,12 +24,12 @@ class ApplicationController < Sinatra::Base def logged_in? !!current_user end - + def current_user @current_user ||= User.find_by_id(session[:user_id]) if session[:user_id] # uses memoization to prevent duplicate database queries end - + end -end \ No newline at end of file +end diff --git a/app/views/biz_plans/index.erb b/app/views/biz_plans/index.erb index 43c9a3f..ed19398 100644 --- a/app/views/biz_plans/index.erb +++ b/app/views/biz_plans/index.erb @@ -2,16 +2,16 @@ <% @biz_plans.each do |biz_plan| %>
-

<%= biz_plan.name %> by <%= biz_plan.user.username %>

+

<%= biz_plan.name %>

by

<%= biz_plan.user.username %>

<% if biz_plan.user == current_user %>

Edit

- +
- + <% end %>
<% end %> -

Add a Business Plan

\ No newline at end of file +

Add a Business Plan

diff --git a/app/views/layout.erb b/app/views/layout.erb index 3804fb9..59cbd7a 100644 --- a/app/views/layout.erb +++ b/app/views/layout.erb @@ -17,9 +17,12 @@

Show Off Your Business with BizUs App

<%= yield %> -

Signup

-

Login

-

Logout

+ <% if logged_in? %> +

Logout

+ <% else %> +

Signup

+

Login

+ <% end %> diff --git a/config/environment.rb b/config/environment.rb index 57b23d5..92f0611 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -8,7 +8,7 @@ :database => "db/#{ENV['SINATRA_ENV']}.sqlite" ) -require_relative '../secrets' +# require_relative '../secrets' require './app/controllers/application_controller' -require_all 'app' \ No newline at end of file +require_all 'app' diff --git a/db/development.sqlite b/db/development.sqlite index ade0cea..779f489 100644 Binary files a/db/development.sqlite and b/db/development.sqlite differ diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 0f5790f..e167e04 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -89,9 +89,13 @@ } .post { padding: 10px; - border: solid 5px black; - border-radius: 5px; - + border: solid 5px #36454f; + border-radius: 10px; + width: 40%; + margin: auto; + margin-bottom: 10px; + background-color: #3d3d5c; /* slight purple */ + color: #fff; /* white */ } .error { @@ -137,4 +141,11 @@ .error { color: red; } -} \ No newline at end of file +} + +a:link { + color: #3377ff; +} +a:visited { + color: #a31aff; +}