finish up adding the slack functionality with a redirect on the chat navbar button

This commit is contained in:
Michael Q Larson
2015-04-08 22:52:14 -07:00
parent 9145e959de
commit 9fb048183c
3 changed files with 7 additions and 8 deletions

View File

@ -74,14 +74,13 @@ module.exports = {
},
chat: function chat(req, res) {
if (req.user) {
if (req.user.sentSlackInvite) {
if (req.user && req.user.sentSlackInvite) {
res.redirect('https://freecode.slack.com/messages/general/');
}
}
} else {
res.render('resources/chat', {
title: "Enter Free Code Camp's Chat Rooms"
title: "Join our chat room"
});
}
},
nonprofitProjectInstructions: function nonprofitProjectInstructions(req, res) {

View File

@ -14,7 +14,7 @@
li
a(href='/challenges') Challenges
li
a(href='/chat') Chat
a(href='/chat', target='_blank') Chat
li
a(href='/stories/hot') News
li

View File

@ -5,7 +5,7 @@ block content
.text-center
if (user)
if (!user.sentSlackInvite)
a.btn.btn-primary.signup-btn.next-challenge-button(href="/api/slack") Join our Slack Chat Room
a.btn.btn-primary.btn-cta.next-challenge-button(href="/api/slack") Join our Slack Chat Room
.spacer
a.btn.btn-cta.signup-btn.next-challenge-button(href="/challenges") Take me to my next challenge
else