fix some issues with @terakilobyte and beautify the camper news index view
This commit is contained in:
22
app.js
22
app.js
@ -311,7 +311,7 @@ app.get('/nodeschool-challenges', 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('/about', function(req, res) {
|
||||
@ -435,13 +435,6 @@ app.get(
|
||||
storyController.recentJSON
|
||||
);
|
||||
|
||||
app.get(
|
||||
'/stories/',
|
||||
function(req, res) {
|
||||
res.redirect(302, '/stories/hot');
|
||||
}
|
||||
);
|
||||
|
||||
app.get(
|
||||
'/stories/comments/:id',
|
||||
storyController.comments
|
||||
@ -483,21 +476,10 @@ app.post(
|
||||
);
|
||||
|
||||
app.get(
|
||||
'/stories/hot',
|
||||
'/stories/',
|
||||
storyController.hot
|
||||
);
|
||||
|
||||
app.get(
|
||||
'/stories/recent',
|
||||
storyController.recent
|
||||
);
|
||||
|
||||
|
||||
app.get(
|
||||
'/stories/search',
|
||||
storyController.search
|
||||
);
|
||||
|
||||
app.post(
|
||||
'/stories/search',
|
||||
storyController.getStories
|
||||
|
@ -407,7 +407,7 @@ module.exports = {
|
||||
var urlImage = metaImage.attr('content') ? metaImage.attr('content') : '';
|
||||
var metaTitle = $('title');
|
||||
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.description = description;
|
||||
callback(null, result);
|
||||
|
@ -930,11 +930,17 @@ iframe.iphone {
|
||||
|
||||
.story-headline {
|
||||
font-size: 20px;
|
||||
@media (max-width: 767px) {
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 14px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.story-byline {
|
||||
margin-top: 5px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.media-stories {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
#reply-to-main-post, #upvote {
|
||||
@ -979,7 +985,7 @@ iframe.iphone {
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
@media (max-width: 768px) {
|
||||
margin-top: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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>",
|
||||
"<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>Example: if you and the camper you're paired up with (your pair) each stated you could work 20 hours per week (on the  <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:",
|
||||
" <ol>",
|
||||
" <li>Your estimated time commitment (10, 20 or 40 hours per week)</li>",
|
||||
|
@ -61,12 +61,12 @@ block content
|
||||
.text-center
|
||||
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.
|
||||
#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)
|
||||
.col-xs-12.col-sm-8.col-sm-offset-2
|
||||
.text-center
|
||||
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
|
||||
.col-xs-12.text-center
|
||||
if !user
|
||||
|
@ -21,35 +21,12 @@
|
||||
|
||||
$(div)
|
||||
.html(
|
||||
"<div class='row'>" +
|
||||
"<div class='hidden-xs col-sm-2 col-md-1 positive-5 news-number'>" +
|
||||
(i + 1) +
|
||||
"</div>" +
|
||||
"<div class='visible-xs col-sm-2 col-md-1'>" +
|
||||
"<div class='visible-xs row'>" +
|
||||
"<div class='visible-xs col-sm-1 col-md-1'>" +
|
||||
"<a href='" + data[i].link + "'>" +
|
||||
"<img class='mobile-story-image img-responsive' src='" + (!!data[i].image ? data[i].image : data[i].author.picture) + "'/>" +
|
||||
"</a>" +
|
||||
"</div>" +
|
||||
"<div class='hidden-xs col-sm-2 col-md-1'>" +
|
||||
"<a href='/" + data[i].author.username + "'>" +
|
||||
"<img class='img-responsive ' src='" + data[i].author.picture + "'/>" +
|
||||
"</a>" +
|
||||
"</div>" +
|
||||
"<div class='col-xs-12 col-sm-8 col-md-10'>" +
|
||||
"<div class='row'>" +
|
||||
"<div class='story-headline col-xs-12 wrappable'>" +
|
||||
"<a href='" + data[i].link + "' target='_blank'>" +
|
||||
data[i].headline +
|
||||
"</a>" +
|
||||
"</div>" +
|
||||
"<div class='hidden-xs'>" +
|
||||
"<span>" +
|
||||
"<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' href='/stories/" + linkedName + "'>discuss</a> · " +
|
||||
rank + (rank > 1 ? " points" : " point") + " · posted " +
|
||||
moment(data[i].timePosted).fromNow() +
|
||||
" 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 " +
|
||||
@ -61,6 +38,28 @@
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"<div class='hidden-xs row media-stories'>" +
|
||||
"<div class='media'>" +
|
||||
"<div class='media-left'>" +
|
||||
"<a href='/'" + data[i].author.username + "'>" +
|
||||
"<img class='img-news' src='" + data[i].author.picture + "'/>" +
|
||||
"</a>" +
|
||||
"</div>" +
|
||||
"<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> · " +
|
||||
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>" +
|
||||
"</h2>" +
|
||||
"</div>" +
|
||||
"</div>"
|
||||
);
|
||||
|
@ -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-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
|
||||
.input-group(class="#{ page === 'hot' ? '' : 'hidden' }")
|
||||
input#searchArea.big-text-field.field-responsive.form-control(type='text', placeholder='Search our links', autofocus)
|
||||
|
@ -3,7 +3,7 @@
|
||||
div(ng-controller="URLSubmitController")
|
||||
|
||||
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
|
||||
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")
|
||||
|
@ -16,12 +16,12 @@
|
||||
.col-xs-12.col-md-1
|
||||
label.control-label.control-label-story-submission(for='name') Title
|
||||
.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)
|
||||
//.col-xs-12.col-md-11.col-md-offset-1(ng-cloak, ng-show="submitStory.title.$error.required")
|
||||
// alert(type='danger')
|
||||
// span.ion-close-circled
|
||||
// | A headline is required to submit.
|
||||
|
||||
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")
|
||||
alert(type='danger')
|
||||
span.ion-close-circled
|
||||
| A headline is required to submit.
|
||||
.form-group
|
||||
.col-xs-12.col-md-1
|
||||
label.control-label.control-label-story-submission(for='name') Comment
|
||||
@ -43,7 +43,7 @@
|
||||
.row
|
||||
.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.
|
||||
$('#story-url').val(storyURL).attr('disabled', 'disabled');
|
||||
$('#story-title').val(storyTitle);
|
||||
|
Reference in New Issue
Block a user