fix some issues with @terakilobyte and beautify the camper news index view

This commit is contained in:
Quincy Larson
2015-04-30 14:55:00 -07:00
parent 164411e2c4
commit cc13b325d6
10 changed files with 71 additions and 84 deletions

22
app.js
View File

@ -311,7 +311,7 @@ app.get('/nodeschool-challenges', function(req, res) {
app.get('/news', function(req, res) { app.get('/news', function(req, res) {
res.redirect(301, '/stories/hot'); res.redirect(301, '/stories/');
}); });
app.get('/learn-to-code', challengeMapController.challengeMap); app.get('/learn-to-code', challengeMapController.challengeMap);
app.get('/about', function(req, res) { app.get('/about', function(req, res) {
@ -435,13 +435,6 @@ app.get(
storyController.recentJSON storyController.recentJSON
); );
app.get(
'/stories/',
function(req, res) {
res.redirect(302, '/stories/hot');
}
);
app.get( app.get(
'/stories/comments/:id', '/stories/comments/:id',
storyController.comments storyController.comments
@ -483,21 +476,10 @@ app.post(
); );
app.get( app.get(
'/stories/hot', '/stories/',
storyController.hot storyController.hot
); );
app.get(
'/stories/recent',
storyController.recent
);
app.get(
'/stories/search',
storyController.search
);
app.post( app.post(
'/stories/search', '/stories/search',
storyController.getStories storyController.getStories

View File

@ -407,7 +407,7 @@ module.exports = {
var urlImage = metaImage.attr('content') ? metaImage.attr('content') : ''; var urlImage = metaImage.attr('content') ? metaImage.attr('content') : '';
var metaTitle = $('title'); var metaTitle = $('title');
var description = metaDescription.attr('content') ? metaDescription.attr('content') : ''; var description = metaDescription.attr('content') ? metaDescription.attr('content') : '';
result.title = metaTitle.text().length < 141 ? metaTitle.text() : metaTitle.text().slice(0, 137) + " ..."; result.title = metaTitle.text().length < 90 ? metaTitle.text() : metaTitle.text().slice(0, 87) + "...";
result.image = urlImage; result.image = urlImage;
result.description = description; result.description = description;
callback(null, result); callback(null, result);

View File

@ -930,11 +930,17 @@ iframe.iphone {
.story-headline { .story-headline {
font-size: 20px; font-size: 20px;
@media (max-width: 767px) { margin-left: 14px;
text-align: center; margin-top: -5px;
margin-top: 10px; }
margin-bottom: 10px;
} .story-byline {
margin-top: 5px;
font-size: 14px;
}
.media-stories {
margin-left: 20px;
} }
#reply-to-main-post, #upvote { #reply-to-main-post, #upvote {
@ -979,7 +985,7 @@ iframe.iphone {
border-radius: 5px; border-radius: 5px;
width: 100%; width: 100%;
@media (max-width: 768px) { @media (max-width: 768px) {
margin-top: 5px; margin-right: 5px;
} }
} }

View File

@ -308,7 +308,7 @@
"<p>You'll continue to work on nonprofit projects until you've built a sufficiently impressive portfolio and references to start your job search. Your portfolio will ultimately have three to five nonprofit projects. We estimate that the 900 hours of nonprofit projects you're going to complete, in addition to the 100 hours of challenges you've already completed, will be enough to qualify you for your first coding job. This will produce a much broader portfolio than a traditional coding bootcamp, which generally only has one or two capstone projects.</p>", "<p>You'll continue to work on nonprofit projects until you've built a sufficiently impressive portfolio and references to start your job search. Your portfolio will ultimately have three to five nonprofit projects. We estimate that the 900 hours of nonprofit projects you're going to complete, in addition to the 100 hours of challenges you've already completed, will be enough to qualify you for your first coding job. This will produce a much broader portfolio than a traditional coding bootcamp, which generally only has one or two capstone projects.</p>",
"<h2>Choosing your first Nonprofit Project</h2>", "<h2>Choosing your first Nonprofit Project</h2>",
"<p>We've categorized all the nonprofit projects by estimated time investment per camper: 100 hours, 200 hours, and 300 hours. These are only rough estimates.</p>", "<p>We've categorized all the nonprofit projects by estimated time investment per camper: 100 hours, 200 hours, and 300 hours. These are only rough estimates.</p>",
"<p>Example: if you and the camper you're paired up with (your pair) each stated you could work 20 hours per week (on the &thinsp;<a href=\"http://goo.gl/forms/f61dLt67t8\">form you filled out</a>). If the project is a 100 hour per camper project, you should be able to complete it in about 5 weeks.</p>", "<p>Example: if you and the camper you're paired up with (your pair) each stated you could work 20 hours per week. If the project is a 100 hour per camper project, you should be able to complete it in about 5 weeks.</p>",
"<p>Our team of nonprofit project camp counselors will match you and your pair based on:", "<p>Our team of nonprofit project camp counselors will match you and your pair based on:",
" <ol>", " <ol>",
" <li>Your estimated time commitment (10, 20 or 40 hours per week)</li>", " <li>Your estimated time commitment (10, 20 or 40 hours per week)</li>",

View File

@ -20,19 +20,19 @@ block content
.ten-pixel-break .ten-pixel-break
a.btn.btn-big.signup-btn.btn-block(href="/login") Start learning to code (it's free) a.btn.btn-big.signup-btn.btn-block(href="/login") Start learning to code (it's free)
.spacer .spacer
#show-all-dialog.modal(tabindex='-1') #show-all-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation .modal-dialog.animated.fadeInUp.fast-animation
.modal-content .modal-content
.modal-header.all-list-header Field Guide Articles .modal-header.all-list-header Field Guide Articles
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body .modal-body
include ../partials/field-guide include ../partials/field-guide
#fieldGuideId.hidden= fieldGuideId #fieldGuideId.hidden= fieldGuideId
script. script.
$(document).ready(function() { $(document).ready(function() {
$('body').keydown(function(e) { $('body').keydown(function(e) {
if (e.ctrlKey && e.keyCode == 13) { if (e.ctrlKey && e.keyCode == 13) {
$('.next-field-guide-button').click(); $('.next-field-guide-button').click();
} }
});
}); });
});

View File

@ -61,12 +61,12 @@ block content
.text-center .text-center
a.btn.btn-primary.btn-big.btn-block.disabled(href='/nonprofits/interested-in-nonprofit/#{dashedName}') I'm interested in building this project * a.btn.btn-primary.btn-big.btn-block.disabled(href='/nonprofits/interested-in-nonprofit/#{dashedName}') I'm interested in building this project *
p * Complete all our Bonfires, Ziplines, and Basejumps to unlock this. p * Complete all our Bonfires, Ziplines, and Basejumps to unlock this.
#showAllButton.btn.btn-info.btn-big.btn-block Show all Nonprofits Projects #showAllButton.btn.btn-info.btn-big.btn-block Show all Nonprofit Projects
if (buttonActive) if (buttonActive)
.col-xs-12.col-sm-8.col-sm-offset-2 .col-xs-12.col-sm-8.col-sm-offset-2
.text-center .text-center
a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/interested-in-nonprofit/#{dashedName}') I'm interested in building this project a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/interested-in-nonprofit/#{dashedName}') I'm interested in building this project
#showAllButton.btn.btn-info.btn-big.btn-block Show all Nonprofits Projects #showAllButton.btn.btn-info.btn-big.btn-block Show all Nonprofit Projects
.row .row
.col-xs-12.text-center .col-xs-12.text-center
if !user if !user

View File

@ -21,46 +21,45 @@
$(div) $(div)
.html( .html(
"<div class='row'>" + "<div class='visible-xs row'>" +
"<div class='hidden-xs col-sm-2 col-md-1 positive-5 news-number'>" + "<div class='visible-xs col-sm-1 col-md-1'>" +
(i + 1) +
"</div>" +
"<div class='visible-xs col-sm-2 col-md-1'>" +
"<a href='" + data[i].link + "'>" + "<a href='" + data[i].link + "'>" +
"<img class='mobile-story-image img-responsive' src='" + (!!data[i].image ? data[i].image : data[i].author.picture) + "'/>" + "<img class='mobile-story-image img-responsive' src='" + (!!data[i].image ? data[i].image : data[i].author.picture) + "'/>" +
"</a>" + "</a>" +
"</div>" + "</div>" +
"<div class='hidden-xs col-sm-2 col-md-1'>" + "<div class='visible-xs'>" +
"<a href='/" + data[i].author.username + "'>" + "<div class='col-xs-12 text-center'>" +
"<img class='img-responsive ' src='" + data[i].author.picture + "'/>" + rank + (rank > 1 ? " points" : " point") + " · posted " +
"</a>" + moment(data[i].timePosted).fromNow() +
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " +
"</div>" +
"<div class='col-xs-12'>" +
"<br><a class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost' href='/stories/" + linkedName + "'>discuss</a>" +
"</div>" +
"</div>" + "</div>" +
"<div class='col-xs-12 col-sm-8 col-md-10'>" + "</div>" +
"<div class='row'>" + "<div class='hidden-xs row media-stories'>" +
"<div class='story-headline col-xs-12 wrappable'>" + "<div class='media'>" +
"<a href='" + data[i].link + "' target='_blank'>" + "<div class='media-left'>" +
data[i].headline + "<a href='/'" + data[i].author.username + "'>" +
"</a>" + "<img class='img-news' src='" + data[i].author.picture + "'/>" +
"</div>" + "</a>" +
"<div class='hidden-xs'>" + "</div>" +
"<span>" + "<h2 class='media-body'>" +
"<div class='media-body-wrapper'>" +
"<div class='story-headline'>" +
"<a href='" + data[i].link + "' target='_blank'>" +
data[i].headline +
"</a>" +
"</div>" +
"<div class='story-byline col-xs-12 wrappable'>" +
"<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' href='/stories/" + linkedName + "'>discuss</a> · " + "<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' href='/stories/" + linkedName + "'>discuss</a> · " +
rank + (rank > 1 ? " points" : " point") + " · posted " + rank + (rank > 1 ? " points" : " point") + " · posted " +
moment(data[i].timePosted).fromNow() + moment(data[i].timePosted).fromNow() +
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " + " by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " +
"</span>" +
"</div>" +
"<div class='visible-xs'>" +
"<div class='col-xs-12 text-center'>" +
rank + (rank > 1 ? " points" : " point") + " · posted " +
moment(data[i].timePosted).fromNow() +
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " +
"</div>" +
"<div class='col-xs-12'>" +
"<br><a class='btn btn-no-shadow btn-primary btn-block btn-primary-ghost' href='/stories/" + linkedName + "'>discuss</a>" +
"</div>" + "</div>" +
"</div>" + "</div>" +
"</div>" + "</h2>" +
"</div>" + "</div>" +
"</div>" "</div>"
); );

View File

@ -1,5 +1,5 @@
a.btn.btn-primary.btn-big.btn-block(href='/stories/submit' class="#{ page === 'hot' ? '' : 'hidden' }") Submit a link a.btn.btn-primary.btn-big.btn-block(href='/stories/submit' class="#{ page === 'hot' ? '' : 'hidden' }") Submit a link
a.btn.btn-success.btn-big.btn-block(href='/stories/hot' class="#{ (page === 'show' || page === 'submit' || page === 'storySubmission') ? '' : 'hidden' }") Show all Links a.btn.btn-success.btn-big.btn-block(href='/stories/' class="#{ (page === 'show' || page === 'submit' || page === 'storySubmission') ? '' : 'hidden' }") Show all Links
.spacer .spacer
.input-group(class="#{ page === 'hot' ? '' : 'hidden' }") .input-group(class="#{ page === 'hot' ? '' : 'hidden' }")
input#searchArea.big-text-field.field-responsive.form-control(type='text', placeholder='Search our links', autofocus) input#searchArea.big-text-field.field-responsive.form-control(type='text', placeholder='Search our links', autofocus)

View File

@ -3,7 +3,7 @@
div(ng-controller="URLSubmitController") div(ng-controller="URLSubmitController")
form.input-group(name='URLSubmit') form.input-group(name='URLSubmit')
input#story-url.big-text-field.field-responsive.form-control(placeholder='Paste your link here', name='link', type='url', ng-model='possibleURL' autofocus) input#story-url.big-text-field.field-responsive.form-control(placeholder='Paste your link here', name='link', type='url', ng-model='possibleURL', required='required', autofocus)
span.input-group-btn span.input-group-btn
button#preliminary-story-submit.btn.btn-big.btn-primary.btn-responsive(type='button', ng-disabled='URLSubmit.link.$invalid') Submit button#preliminary-story-submit.btn.btn-big.btn-primary.btn-responsive(type='button', ng-disabled='URLSubmit.link.$invalid') Submit
div(ng-show="URLSubmit.link.$error.url && !URLsubmit.link.$pristine") div(ng-show="URLSubmit.link.$error.url && !URLsubmit.link.$pristine")
@ -52,4 +52,4 @@
return this.id; return this.id;
}) })
.get() .get()
.join('&'); .join('&');

View File

@ -16,12 +16,12 @@
.col-xs-12.col-md-1 .col-xs-12.col-md-1
label.control-label.control-label-story-submission(for='name') Title label.control-label.control-label-story-submission(for='name') Title
.col-xs-12.col-md-11 .col-xs-12.col-md-11
input#story-title.form-control(placeholder='Type a headline for your link here', name='Title', maxlength='90' autofocus)
// input#story-title.form-control(placeholder='Type a headline for your link here', name='Title', maxlength='90' ng-model='submitStory.title.Title',required='required', autocomplete="off" autofocus) input#story-title.form-control(placeholder='Type a headline for your link here', name='Title', maxlength='90' ng-model='submitStory.title',required='required', autocomplete="off", ng-init='submitStory.title="#{storyTitle}"' autofocus)
//.col-xs-12.col-md-11.col-md-offset-1(ng-cloak, ng-show="submitStory.title.$error.required") .col-xs-12.col-md-11.col-md-offset-1(ng-cloak, ng-show="submitStory.title.$error.required")
// alert(type='danger') alert(type='danger')
// span.ion-close-circled span.ion-close-circled
// | A headline is required to submit. | A headline is required to submit.
.form-group .form-group
.col-xs-12.col-md-1 .col-xs-12.col-md-1
label.control-label.control-label-story-submission(for='name') Comment label.control-label.control-label-story-submission(for='name') Comment
@ -43,7 +43,7 @@
.row .row
.form-group .form-group
button.btn.btn-big.btn-block.btn-primary#story-submit(type='submit', ng-disabled='submitStory.$invalid') Submit button.btn.btn-big.btn-block.btn-primary#story-submit(type='submit', ng-disabled='submitStory.$invalid || !submitStory') Submit
script. script.
$('#story-url').val(storyURL).attr('disabled', 'disabled'); $('#story-url').val(storyURL).attr('disabled', 'disabled');
$('#story-title').val(storyTitle); $('#story-title').val(storyTitle);