mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Adding new iPhone screenshots. Also rewriting rss feed to include user comments.
This commit is contained in:
parent
e0e351b9e1
commit
2c942cf89f
9 changed files with 60 additions and 16 deletions
|
@ -6,10 +6,12 @@ from bson.objectid import ObjectId
|
|||
from django.shortcuts import get_object_or_404, render_to_response
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.sites.models import Site
|
||||
from django.template.loader import render_to_string
|
||||
from django.http import HttpResponse, HttpResponseRedirect, Http404
|
||||
from django.conf import settings
|
||||
from django.template import RequestContext
|
||||
from django.utils import feedgenerator
|
||||
from apps.rss_feeds.models import MStory, Feed, MStarredStory
|
||||
from apps.social.models import MSharedStory, MSocialServices, MSocialProfile, MSocialSubscription, MCommentReply
|
||||
from apps.social.models import MInteraction, MActivity
|
||||
|
@ -21,7 +23,6 @@ from apps.reader.models import MUserStory, UserSubscription
|
|||
from apps.profile.models import Profile
|
||||
from utils import json_functions as json
|
||||
from utils import log as logging
|
||||
from utils import PyRSS2Gen as RSS
|
||||
from utils.user_functions import get_user, ajax_login_required
|
||||
from utils.view_functions import render_to
|
||||
from utils.story_functions import format_story_link_date__short
|
||||
|
@ -1017,37 +1018,55 @@ def shared_stories_rss_feed(request, user_id, username):
|
|||
|
||||
username = username and username.lower()
|
||||
profile = MSocialProfile.get_user(user.pk)
|
||||
params = {'username': profile.username_slug, 'user_id': user.pk}
|
||||
if not username or profile.username_slug.lower() != username:
|
||||
params = {'username': profile.username_slug, 'user_id': user.pk}
|
||||
return HttpResponseRedirect(reverse('shared-stories-rss-feed', kwargs=params))
|
||||
|
||||
social_profile = MSocialProfile.get_user(user_id)
|
||||
|
||||
current_site = Site.objects.get_current()
|
||||
current_site = current_site and current_site.domain
|
||||
|
||||
data = {}
|
||||
data['title'] = social_profile.title
|
||||
data['link'] = social_profile.blurblog_url
|
||||
data['description'] = "Stories shared by %s on NewsBlur." % user.username
|
||||
data['lastBuildDate'] = datetime.datetime.utcnow()
|
||||
data['items'] = []
|
||||
data['generator'] = 'NewsBlur'
|
||||
data['generator'] = 'NewsBlur - http://www.newsblur.com'
|
||||
data['docs'] = None
|
||||
data['author_name'] = user.username
|
||||
data['feed_url'] = "http://%s%s" % (
|
||||
current_site,
|
||||
reverse('shared-stories-rss-feed', kwargs=params),
|
||||
)
|
||||
rss = feedgenerator.Atom1Feed(**data)
|
||||
|
||||
shared_stories = MSharedStory.objects.filter(user_id=user.pk).order_by('-shared_date')[:25]
|
||||
for shared_story in shared_stories:
|
||||
feed = Feed.get_by_id(shared_story.story_feed_id)
|
||||
content = render_to_string('social/rss_story.xhtml', {
|
||||
'feed': feed,
|
||||
'user': user,
|
||||
'social_profile': social_profile,
|
||||
'shared_story': shared_story,
|
||||
'content': (shared_story.story_content_z and
|
||||
zlib.decompress(shared_story.story_content_z))
|
||||
})
|
||||
story_data = {
|
||||
'title': shared_story.story_title,
|
||||
'link': shared_story.story_permalink,
|
||||
'description': shared_story.story_content_z and zlib.decompress(shared_story.story_content_z),
|
||||
'author': shared_story.story_author_name,
|
||||
'description': content,
|
||||
'author_name': shared_story.story_author_name,
|
||||
'categories': shared_story.story_tags,
|
||||
'guid': shared_story.story_guid,
|
||||
'pubDate': shared_story.shared_date,
|
||||
'unique_id': shared_story.story_guid,
|
||||
'pubdate': shared_story.shared_date,
|
||||
}
|
||||
data['items'].append(RSS.RSSItem(**story_data))
|
||||
rss.add_item(**story_data)
|
||||
|
||||
rss = RSS.RSS2(**data)
|
||||
|
||||
return HttpResponse(rss.to_xml())
|
||||
logging.user(request, "~FBGenerating ~SB%s~SN's RSS feed: ~FM%s" % (
|
||||
user.username,
|
||||
request.META['HTTP_USER_AGENT'][:100]
|
||||
))
|
||||
return HttpResponse(rss.writeString('utf-8'))
|
||||
|
||||
@json.json_view
|
||||
def social_feed_trainer(request):
|
||||
|
|
2
fabfile.py
vendored
2
fabfile.py
vendored
|
@ -357,7 +357,7 @@ def setup_repo():
|
|||
with settings(warn_only=True):
|
||||
run('git clone https://github.com/samuelclay/NewsBlur.git newsblur')
|
||||
sudo('mkdir -p /srv')
|
||||
sudo('ln -s /home/ubuntu/newsblur /srv/newsblur')
|
||||
sudo('ln -f -s /home/%s/newsblur /srv/newsblur' % env.user)
|
||||
|
||||
def setup_repo_local_settings():
|
||||
with cd(env.NEWSBLUR_PATH):
|
||||
|
|
BIN
media/img/iphone/v1.6 - iPhone 1 (tall).png
Normal file
BIN
media/img/iphone/v1.6 - iPhone 1 (tall).png
Normal file
Binary file not shown.
After Width: | Height: | Size: 153 KiB |
BIN
media/img/iphone/v1.6 - iPhone 2 (tall).png
Normal file
BIN
media/img/iphone/v1.6 - iPhone 2 (tall).png
Normal file
Binary file not shown.
After Width: | Height: | Size: 120 KiB |
BIN
media/img/iphone/v1.6 - iPhone 3 (tall).png
Normal file
BIN
media/img/iphone/v1.6 - iPhone 3 (tall).png
Normal file
Binary file not shown.
After Width: | Height: | Size: 633 KiB |
BIN
media/img/iphone/v1.6 - iPhone 4 (tall).png
Normal file
BIN
media/img/iphone/v1.6 - iPhone 4 (tall).png
Normal file
Binary file not shown.
After Width: | Height: | Size: 497 KiB |
BIN
media/img/iphone/v1.6 - iPhone 5 (tall).png
Normal file
BIN
media/img/iphone/v1.6 - iPhone 5 (tall).png
Normal file
Binary file not shown.
After Width: | Height: | Size: 225 KiB |
|
@ -2109,6 +2109,9 @@
|
|||
},
|
||||
|
||||
open_friends_modal: function() {
|
||||
NEWSBLUR.assets.preference('has_found_friends', true);
|
||||
NEWSBLUR.reader.check_hide_getting_started();
|
||||
|
||||
NEWSBLUR.reader_friends = new NEWSBLUR.ReaderFriends();
|
||||
},
|
||||
|
||||
|
@ -2510,11 +2513,11 @@
|
|||
]),
|
||||
$.make('li', { className: 'NB-menu-item NB-menu-manage-profile-editor' }, [
|
||||
$.make('div', { className: 'NB-menu-manage-image' }),
|
||||
$.make('div', { className: 'NB-menu-manage-title' }, 'Profile')
|
||||
$.make('div', { className: 'NB-menu-manage-title' }, 'Profile & Blurblog')
|
||||
]),
|
||||
$.make('li', { className: 'NB-menu-item NB-menu-manage-friends' }, [
|
||||
$.make('div', { className: 'NB-menu-manage-image' }),
|
||||
$.make('div', { className: 'NB-menu-manage-title' }, 'Friends')
|
||||
$.make('div', { className: 'NB-menu-manage-title' }, 'Friends & Followers')
|
||||
]),
|
||||
$.make('li', { className: 'NB-menu-item NB-menu-manage-preferences' }, [
|
||||
$.make('div', { className: 'NB-menu-manage-image' }),
|
||||
|
|
22
templates/social/rss_story.xhtml
Normal file
22
templates/social/rss_story.xhtml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<table style="border: 1px solid #E0E0E0; margin: 0; padding: 0; background-color: #F0F0F0" valign="top" align="left" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td rowspan="2" style="padding: 6px;"><img src="{{ social_profile.photo_url }}" style="width: 36px; height: 36px; border-radius: 4px; vertical-align: middle;"></td>
|
||||
<td width="100%">
|
||||
<b>
|
||||
{{ user.username }}
|
||||
<a href="{{ shared_story.blurblog_permalink }}">shared this story</a>
|
||||
{% if feed %}from <img src="{{ feed.favicon_url_fqdn }}"> {{ feed.feed_title }}{% endif %}{% if shared_story.comments %}:{% else %}.{% endif %}</b>
|
||||
</td>
|
||||
</tr>
|
||||
{% if shared_story.comments %}
|
||||
<tr>
|
||||
<td>
|
||||
<p>{{ shared_story.comments }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
|
||||
<hr style="clear: both">
|
||||
|
||||
{{ content|safe }}
|
Loading…
Add table
Reference in a new issue