Merge branch 'social' of github.com:samuelclay/NewsBlur into social

* 'social' of github.com:samuelclay/NewsBlur:
  Fixing blurblog preview, using fetched blurblog title when not available, styling on Friends.
  Removing dependency on original story when replying.
This commit is contained in:
Samuel Clay 2012-05-10 15:34:53 -07:00
commit b2d34d5dd3
4 changed files with 15 additions and 10 deletions

View file

@ -259,6 +259,7 @@ class MSocialProfile(mongo.Document):
'username': self.username,
'photo_url': self.profile_photo_url,
'num_subscribers': self.follower_count,
'feed_title': self.title,
'feed_address': "http://%s%s" % (domain, reverse('shared-stories-rss-feed',
kwargs={'user_id': self.user_id, 'username': self.username_slug})),
'feed_link': "http://%s%s" % (domain, reverse('load-social-page',

View file

@ -264,10 +264,6 @@ def save_comment_reply(request):
if not reply_comments:
return {'code': -1, 'message': 'Reply comments cannot be empty.'}
story = MStory.objects(story_feed_id=feed_id, story_guid=story_id).limit(1).first()
if not story:
return {'code': -1, 'message': 'Story not found. Reload NewsBlur.'}
shared_story = MSharedStory.objects.get(user_id=comment_user_id,
story_feed_id=feed_id,
story_guid=story_id)
@ -287,10 +283,10 @@ def save_comment_reply(request):
replies.append(story_reply)
shared_story.replies = replies
logging.user(request, "~FCUpdating comment reply in ~FM%s: ~SB~FB%s~FM" % (
story.story_title[:20], reply_comments[:30]))
shared_story.story_title[:20], reply_comments[:30]))
else:
logging.user(request, "~FCReplying to comment in: ~FM%s: ~SB~FB%s~FM" % (
story.story_title[:20], reply_comments[:30]))
shared_story.story_title[:20], reply_comments[:30]))
shared_story.replies.append(reply)
shared_story.save()

View file

@ -7391,7 +7391,7 @@ background: transparent;
border: 0;
border-top: 1px solid #E6E6E6;
padding: 0 12px;
margin: 0;
margin: 12px 0 0;
}
.NB-modal-friends fieldset legend {
padding: 0 12px;
@ -7516,7 +7516,7 @@ background: transparent;
}
.NB-modal-friends .NB-profile-section-heading {
text-align: center;
margin: 4px 0;
margin: 18px 0 0px;
border-bottom: 1px solid #E0E0E0;
padding: 0 0 16px;
}

View file

@ -917,7 +917,7 @@
scroll_story_titles_to_show_selected_story_title: function($story) {
var $story = $story || this.find_story_in_story_titles();
if (!$story) return;
if (!$story || !$story.length) return;
var $story_titles = this.$s.$story_titles;
var story_title_visisble = $story_titles.isScrollVisible($story);
if (!story_title_visisble) {
@ -931,7 +931,7 @@
scroll_feed_list_to_show_selected_feed: function($feed) {
$feed = $feed || this.find_feed_in_feed_list(this.active_feed);
if (!$feed) return;
if (!$feed || !$feed.length) return;
var $feed_lists = this.$s.$feed_lists;
var is_feed_visible = $feed_lists.isScrollVisible($feed);
if (!is_feed_visible) {
@ -1336,6 +1336,12 @@
make_feed_title_template: function(feed, type, depth) {
var unread_class = '';
var exception_class = '';
if (NEWSBLUR.utils.is_feed_social(feed)) {
if (!feed.feed_title) {
var profile = this.model.user_profiles.get(feed.user_id) || {};
feed.feed_title = profile.feed_title;
}
}
if (feed.ps) {
unread_class += ' unread_positive';
}
@ -2420,6 +2426,7 @@
if (this.flags['showing_social_feed_in_tryfeed_view']) {
this.show_tryfeed_follow_button();
this.correct_tryfeed_title();
}
}
},
@ -7163,6 +7170,7 @@
$('.NB-feeds-header-title', this.$s.$tryfeed_header).text(social_feed.get('username'));
$('.NB-feeds-header-icon', this.$s.$tryfeed_header).attr('src', $.favicon(social_feed.attributes));
$('.NB-feeds-header-title', this.$s.$tryfeed_header).text(social_feed.get('username'));
$tryfeed_container.slideDown(350, _.bind(function() {
this.open_social_stories(social_feed.get('id'), options);