Add commit directory page
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;
|
||||||
|
|
||||||
|
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
|
||||||
|
Reference in New Issue
Block a user