fix some of the news functionality
This commit is contained in:
@ -131,13 +131,13 @@ exports.returnIndividualStory = function(req, res, next) {
|
|||||||
msg: "404: We couldn't find a story with that name. Please double check the name."
|
msg: "404: We couldn't find a story with that name. Please double check the name."
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.redirect('/stories/');
|
return res.redirect('/news/');
|
||||||
}
|
}
|
||||||
|
|
||||||
story = story.pop();
|
story = story.pop();
|
||||||
var dashedNameFull = story.storyLink.toLowerCase().replace(/\s/g, '-');
|
var dashedNameFull = story.storyLink.toLowerCase().replace(/\s/g, '-');
|
||||||
if (dashedNameFull !== dashedName) {
|
if (dashedNameFull !== dashedName) {
|
||||||
return res.redirect('../stories/' + dashedNameFull);
|
return res.redirect('../news/' + dashedNameFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
var userVoted = false;
|
var userVoted = false;
|
||||||
@ -285,7 +285,7 @@ exports.newStory = function(req, res, next) {
|
|||||||
});
|
});
|
||||||
return res.json({
|
return res.json({
|
||||||
alreadyPosted: true,
|
alreadyPosted: true,
|
||||||
storyURL: '/stories/' + story.pop().storyLink
|
storyURL: '/news/' + story.pop().storyLink
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
resources.getURLTitle(url, processResponse);
|
resources.getURLTitle(url, processResponse);
|
||||||
@ -535,7 +535,7 @@ exports.storySubmission = function(req, res, next) {
|
|||||||
text: [
|
text: [
|
||||||
'Just a quick heads-up: ' + data.author.username + ' replied to you on Camper News.',
|
'Just a quick heads-up: ' + data.author.username + ' replied to you on Camper News.',
|
||||||
'You can keep this conversation going.',
|
'You can keep this conversation going.',
|
||||||
'Just head back to the discussion here: http://freecodecamp.com/stories/' + data.originalStoryLink,
|
'Just head back to the discussion here: http://freecodecamp.com/news/' + data.originalStoryLink,
|
||||||
'- the Free Code Camp Volunteer Team'
|
'- the Free Code Camp Volunteer Team'
|
||||||
].join('\n')
|
].join('\n')
|
||||||
};
|
};
|
||||||
|
@ -96,6 +96,10 @@ h1, h2, h3, h4, h5, h6, p, li {
|
|||||||
height: 100px;
|
height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.darker-background {
|
||||||
|
background-color: #dedede;
|
||||||
|
}
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
.btn-cta {
|
.btn-cta {
|
||||||
|
@ -265,7 +265,7 @@ $(document).ready(function() {
|
|||||||
$('#story-submit').bind('click', storySubmitButtonHandler);
|
$('#story-submit').bind('click', storySubmitButtonHandler);
|
||||||
})
|
})
|
||||||
.done(function (data, textStatus, xhr) {
|
.done(function (data, textStatus, xhr) {
|
||||||
window.location = '/stories/' + JSON.parse(data).storyLink;
|
window.location = '/news/' + JSON.parse(data).storyLink;
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -96,6 +96,7 @@
|
|||||||
$('#comment-to-comment-textinput').keyup(function (e) {
|
$('#comment-to-comment-textinput').keyup(function (e) {
|
||||||
if (e.which === 13 || e === 13) {
|
if (e.which === 13 || e === 13) {
|
||||||
$('#submit-comment-to-comment').click();
|
$('#submit-comment-to-comment').click();
|
||||||
|
$('#submit-comment-to-edit').click();
|
||||||
}
|
}
|
||||||
var text_length = $('#comment-to-comment-textinput').val().length;
|
var text_length = $('#comment-to-comment-textinput').val().length;
|
||||||
var text_remaining = text_max - text_length;
|
var text_remaining = text_max - text_length;
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
|
.row
|
||||||
|
.col-xs-12.col-sm-9
|
||||||
.panel.shadow
|
.input-group
|
||||||
.panel-body
|
input#searchArea.big-text-field.field-responsive.form-control(type='text', placeholder='Search our links')
|
||||||
.col-xs-12.col-sm-9
|
span.input-group-btn
|
||||||
.input-group
|
button#searchbutton.btn.btn-big.btn-primary.btn-responsive(type='button') Search
|
||||||
input#searchArea.big-text-field.field-responsive.form-control(type='text', placeholder='Search our links')
|
.visible-xs
|
||||||
span.input-group-btn
|
.button-spacer
|
||||||
button#searchbutton.btn.btn-big.btn-primary.btn-responsive(type='button') Search
|
.col-xs-12.col-sm-3
|
||||||
.visible-xs
|
span
|
||||||
.button-spacer
|
a.btn.btn-primary.btn-big.btn-block.btn-responsive(href='/stories/submit' class="#{ page === 'hot' ? '' : 'hidden' }") Submit
|
||||||
.col-xs-12.col-sm-3
|
span
|
||||||
span
|
a.btn.btn-success.btn-big.btn-block.btn-responsive(href='/news/' class="#{ (page !== 'hot') ? '' : 'hidden' }") All
|
||||||
a.btn.btn-primary.btn-big.btn-block.btn-responsive(href='/stories/submit' class="#{ page === 'hot' ? '' : 'hidden' }") Submit
|
|
||||||
span
|
|
||||||
a.btn.btn-success.btn-big.btn-block.btn-responsive(href='/news/' class="#{ (page !== 'hot') ? '' : 'hidden' }") All
|
|
||||||
|
|
||||||
.spacer
|
.spacer
|
||||||
#search-results
|
#search-results
|
||||||
.spacer
|
.spacer
|
||||||
|
Reference in New Issue
Block a user