finish up adding the slack functionality with a redirect on the chat navbar button
This commit is contained in:
@ -74,14 +74,13 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
chat: function chat(req, res) {
|
chat: function chat(req, res) {
|
||||||
if (req.user) {
|
if (req.user && req.user.sentSlackInvite) {
|
||||||
if (req.user.sentSlackInvite) {
|
|
||||||
res.redirect('https://freecode.slack.com/messages/general/');
|
res.redirect('https://freecode.slack.com/messages/general/');
|
||||||
}
|
} else {
|
||||||
|
res.render('resources/chat', {
|
||||||
|
title: "Join our chat room"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
res.render('resources/chat', {
|
|
||||||
title: "Enter Free Code Camp's Chat Rooms"
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
nonprofitProjectInstructions: function nonprofitProjectInstructions(req, res) {
|
nonprofitProjectInstructions: function nonprofitProjectInstructions(req, res) {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
li
|
li
|
||||||
a(href='/challenges') Challenges
|
a(href='/challenges') Challenges
|
||||||
li
|
li
|
||||||
a(href='/chat') Chat
|
a(href='/chat', target='_blank') Chat
|
||||||
li
|
li
|
||||||
a(href='/stories/hot') News
|
a(href='/stories/hot') News
|
||||||
li
|
li
|
||||||
|
@ -5,7 +5,7 @@ block content
|
|||||||
.text-center
|
.text-center
|
||||||
if (user)
|
if (user)
|
||||||
if (!user.sentSlackInvite)
|
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
|
.spacer
|
||||||
a.btn.btn-cta.signup-btn.next-challenge-button(href="/challenges") Take me to my next challenge
|
a.btn.btn-cta.signup-btn.next-challenge-button(href="/challenges") Take me to my next challenge
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user