Skip to content
Browse files

Facebox chat link with guest / login options

  • Loading branch information...
1 parent 46af064 commit 99078b1a55055a3c354fc98329ade404e0f10d5a @jordanbyron jordanbyron committed Feb 16, 2014
View
7 .env.example
@@ -7,8 +7,6 @@ AUTH_MODE=developer
SMTP_ADDRESS = localhost
SMTP_PORT = 1025
-CAMPFIRE_URL = example.com
-
### Github Auth Mode ###
# AUTH_MODE=github
@@ -45,3 +43,8 @@ STRIPE_WEBHOOK_PATH=/oh/yeah/stripe/webhooks
# CACHE_COOKER_USERNAME=pr-user
# CACHE_COOKER_PASSWORD=pr-pass
# CACHE_COOKER_REALM=Practicing Ruby
+
+## Chat URLs
+
+CHAT_GUEST_URL=http://campfire.com/guest
+CHAT_LOGIN_URL=http://campfire.com/login
View
1 app/assets/stylesheets/application.css.sass
@@ -28,3 +28,4 @@
@import partials/payments
@import partials/archives
@import partials/email_confirmation_warning
+@import partials/chat
View
5 app/assets/stylesheets/partials/_chat.sass
@@ -0,0 +1,5 @@
+#chat
+ font-family: sans-serif
+ text-align: center
+ a.btn
+ margin: 10px 0
View
4 app/assets/stylesheets/partials/_layout.sass
@@ -91,3 +91,7 @@ body
color: #ddd
border: none
height: 1px
+
+ a.btn
+ +classy-button
+ text-decoration: none
View
5 app/controllers/home_controller.rb
@@ -1,4 +1,5 @@
class HomeController < ApplicationController
+ before_filter :attempt_user_login, :only => 'chat'
def public_archives
redirect_to(articles_path) && return if current_user.try(:active?)
@@ -28,4 +29,8 @@ def toggle_nav
render :text => "OK"
end
+
+ def chat
+ render :layout => false
+ end
end
View
5 app/views/home/chat.html.haml
@@ -0,0 +1,5 @@
+#chat
+ = link_to "Chat with a guest accout", ENV["CHAT_GUEST_URL"],
+ :class => "btn"
+ = link_to "Chat with your campfire account", ENV["CHAT_LOGIN_URL"],
+ :class => "btn"
View
2 app/views/shared/_navigation.html.haml
@@ -9,7 +9,7 @@
%li= link_to "Public Archives", root_path(:anchor => "public-archives")
- else
%li= link_to "Archives", articles_path(:anchor => "archives")
- %li= link_to "Chat", CAMPFIRE_URL
+ %li= link_to "Chat", chat_path, :rel => "facebox"
%li= link_to "F/OSS", open_source_path
%li= link_to "Blog", "http://elmcitycraftworks.org"
%li= link_to "Contact", contact_path
View
1 config/initializers/campfire.rb
@@ -1 +0,0 @@
-CAMPFIRE_URL = ENV["CAMPFIRE_URL"]
View
1 config/routes.rb
@@ -14,6 +14,7 @@
get "/archives/public" => 'home#public_archives'
get "/contact" => 'home#contact', :as => 'contact'
get "/open-source" => 'home#open_source', :as => 'open_source'
+ get "/chat" => 'home#chat'
get "/articles/random" => 'articles#random', :as => 'random_article'
resources :articles do

0 comments on commit 99078b1

Please sign in to comment.
Something went wrong with that request. Please try again.