Merge branch 'feature/commit' of https://github.com/freecodecamp/freecodecamp into feature/commit
This commit is contained in:
@ -56,6 +56,11 @@ export default function commit(app) {
|
|||||||
pledge
|
pledge
|
||||||
);
|
);
|
||||||
|
|
||||||
|
router.get(
|
||||||
|
'/commit/directory',
|
||||||
|
renderDirectory
|
||||||
|
);
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
'/commit/stop-commitment',
|
'/commit/stop-commitment',
|
||||||
sendNonUserToCommit,
|
sendNonUserToCommit,
|
||||||
@ -167,6 +172,13 @@ export default function commit(app) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderDirectory(req, res) {
|
||||||
|
res.render('commit/directory', {
|
||||||
|
title: 'Commit Directory',
|
||||||
|
nonprofits
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function completeCommitment(req, res, next) {
|
function completeCommitment(req, res, next) {
|
||||||
const { user } = req;
|
const { user } = req;
|
||||||
|
|
||||||
@ -204,7 +216,7 @@ export default function commit(app) {
|
|||||||
msg = `No pledge found for user ${user.username}.`;
|
msg = `No pledge found for user ${user.username}.`;
|
||||||
}
|
}
|
||||||
req.flash('errors', { msg });
|
req.flash('errors', { msg });
|
||||||
return res.redirect('/commit');
|
return res.redirect(`/${user.username}`);
|
||||||
},
|
},
|
||||||
next
|
next
|
||||||
);
|
);
|
||||||
|
@ -161,6 +161,10 @@ block content
|
|||||||
.panel.panel-info
|
.panel.panel-info
|
||||||
.panel-heading.text-center Manage Your Account
|
.panel-heading.text-center Manage Your Account
|
||||||
.panel-body
|
.panel-body
|
||||||
|
.col-xs-12
|
||||||
|
a.btn.btn-lg.btn-block.btn-warning.btn-link-social(href='/logout')
|
||||||
|
span.ion-android-exit
|
||||||
|
| Sign me out of Free Code Camp
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com')
|
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com')
|
||||||
span.ion-email
|
span.ion-email
|
||||||
@ -177,12 +181,8 @@ block content
|
|||||||
| Let other people see all my solutions
|
| Let other people see all my solutions
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
a.btn.btn-lg.btn-block.btn-success.btn-link-social(href='/commit')
|
a.btn.btn-lg.btn-block.btn-success.btn-link-social(href='/commit')
|
||||||
span.ion-android-exit
|
span.ion-edit
|
||||||
| Edit my pledge
|
| Edit my pledge
|
||||||
.col-xs-12
|
|
||||||
a.btn.btn-lg.btn-block.btn-warning.btn-link-social(href='/logout')
|
|
||||||
span.ion-android-exit
|
|
||||||
| Sign me out of Free Code Camp
|
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
a.btn.btn-lg.btn-block.btn-danger.btn-link-social.confirm-deletion
|
a.btn.btn-lg.btn-block.btn-danger.btn-link-social.confirm-deletion
|
||||||
span.ion-trash-b
|
span.ion-trash-b
|
||||||
|
21
server/views/commit/directory.jade
Normal file
21
server/views/commit/directory.jade
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
extends ../layout
|
||||||
|
block content
|
||||||
|
.panel.panel-info
|
||||||
|
.panel-heading.text-center Commit to one of these nonprofits
|
||||||
|
.panel-body
|
||||||
|
.row
|
||||||
|
.col-xs-12.col-sm-6.col-sm-offset-3
|
||||||
|
for nonprofit in nonprofits
|
||||||
|
.spacer
|
||||||
|
.row
|
||||||
|
.text-center
|
||||||
|
h2= nonprofit.displayName
|
||||||
|
.row
|
||||||
|
.col-xs-12.col-sm-8.col-sm-offset-2
|
||||||
|
img.img-responsive.img-center(src=nonprofit.imgUrl)
|
||||||
|
p= nonprofit.description
|
||||||
|
.row
|
||||||
|
.col-xs-12.col-sm-8.col-sm-offset-2
|
||||||
|
a.text-center.btn.btn-primary.btn-lg.btn-block(href='/commit?nonprofit=#{nonprofit.name}') Go to #{nonprofit.displayName}
|
||||||
|
.spacer
|
||||||
|
|
@ -13,7 +13,7 @@ block content
|
|||||||
a(href='#{imgUrl}' data-lightbox='img-enlarge' alt='#{imgAlt}')
|
a(href='#{imgUrl}' data-lightbox='img-enlarge' alt='#{imgAlt}')
|
||||||
img.img-responsive(src='#{imgUrl}' alt='#{imgAlt}')
|
img.img-responsive(src='#{imgUrl}' alt='#{imgAlt}')
|
||||||
p= description
|
p= description
|
||||||
a or browse our directory
|
a(href='/commit/directory') or browse our directory
|
||||||
.spacer
|
.spacer
|
||||||
form.form(name='commit')
|
form.form(name='commit')
|
||||||
.hidden
|
.hidden
|
||||||
@ -45,17 +45,15 @@ block content
|
|||||||
.spacer
|
.spacer
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
||||||
a#commit-btn-submit.btn.btn-block.btn-lg.signup-btn(href='https://www.girldevelopit.com/donate' target='_blank') Commit (and open donate page)
|
a#commit-btn-submit.btn.btn-block.btn-lg.signup-btn(href=donateUrl target='_blank') Commit (and open donate page)
|
||||||
.button-spacer
|
.button-spacer
|
||||||
.spacer
|
|
||||||
if pledge
|
if pledge
|
||||||
form.row(name='stop-pledge' action='/commit/stop-commitment' method='post')
|
form.row(name='stop-pledge' action='/commit/stop-commitment' method='post')
|
||||||
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
||||||
button.btn.btn-sm.btn-danger(name='submit' type='submit') Stop my pledge
|
button.btn.btn-sm.btn-danger(name='submit' type='submit') Stop my pledge
|
||||||
.spacer
|
|
||||||
else
|
else
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
h4.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
||||||
a(href='/') Maybe later
|
a(href='/') Maybe later
|
||||||
.spacer
|
.spacer
|
||||||
script.
|
script.
|
||||||
|
Reference in New Issue
Block a user