Permalink
Browse files

fixing merge conflict

  • Loading branch information...
1 parent b5ccc81 commit 065395b6889d79f8ad596d691f2a1b351bd1e49f @roycyang roycyang committed Jun 29, 2012
Showing with 2,124 additions and 639 deletions.
  1. +1 −1 LICENSE.md
  2. +2 −2 README.md
  3. +1 −1 api/newsblur.py
  4. +1 −1 apps/analyzer/fixtures/classifiers.json
  5. +1 −1 apps/feed_import/fixtures/opml_import.json
  6. +1 −1 apps/reader/fixtures/subscriptions.json
  7. +54 −13 apps/reader/views.py
  8. +1 −1 apps/rss_feeds/fixtures/bootstrap.json
  9. +1 −1 apps/rss_feeds/fixtures/rss_feeds.json
  10. +2 −0 apps/rss_feeds/models.py
  11. +176 −20 apps/social/models.py
  12. +18 −0 apps/social/tasks.py
  13. +1 −0 apps/social/urls.py
  14. +78 −14 apps/social/views.py
  15. +9 −2 assets.yml
  16. +1 −1 config/fixtures/bootstrap.json
  17. +2 −0 config/hosts
  18. +1 −3 config/mongodb.prod.conf
  19. +22 −34 config/nginx.newsblur.conf
  20. +4 −4 config/postgresql.conf
  21. +1 −1 config/supervisor_celeryd.conf
  22. +20 −9 fabfile.py
  23. +14 −21 local_settings.py.template
  24. +118 −20 media/css/reader.css
  25. +403 −9 media/css/social/social_page.css
  26. BIN media/img/mobile/SidebarAllMyFiles.icns
  27. BIN media/img/mobile/SidebarLaptop.icns
  28. BIN media/img/mobile/SidebariMac.icns
  29. BIN media/img/mobile/SidebariPad.icns
  30. BIN media/img/mobile/SidebariPhone.icns
  31. BIN media/img/mobile/iphone-icon-newsblur.png
  32. BIN media/img/reader/background-control-light.png
  33. BIN media/img/reader/diigo.png
  34. BIN media/img/reader/evernote.png
  35. BIN media/img/reader/kippt.png
  36. +44 −3 media/js/newsblur/common/assetmodel.js
  37. +1 −2 media/js/newsblur/models/feeds.js
  38. +5 −1 media/js/newsblur/models/folders.js
  39. +7 −4 media/js/newsblur/models/stories.js
  40. +173 −180 media/js/newsblur/reader/reader.js
  41. +1 −1 media/js/newsblur/reader/reader_intro.js
  42. +1 −1 media/js/newsblur/reader/reader_keyboard.js
  43. +12 −0 media/js/newsblur/reader/reader_preferences.js
  44. +1 −1 media/js/newsblur/reader/reader_send_email.js
  45. +3 −4 media/js/newsblur/reader/reader_social_profile.js
  46. +36 −7 media/js/newsblur/reader/reader_utils.js
  47. +1 −1 media/js/newsblur/static/about.js
  48. +1 −1 media/js/newsblur/static/faq.js
  49. +3 −2 media/js/newsblur/views/feed_list_view.js
  50. +4 −0 media/js/newsblur/views/feed_title_view.js
  51. +94 −47 media/js/newsblur/views/original_tab_view.js
  52. +1 −1 media/js/newsblur/views/profile_badge_view.js
  53. +6 −5 media/js/newsblur/views/story_comment_view.js
  54. +1 −1 media/js/newsblur/views/story_comments_view.js
  55. +18 −13 media/js/newsblur/views/story_detail_view.js
  56. +143 −108 media/js/newsblur/views/story_list_view.js
  57. +130 −40 media/js/newsblur/views/story_share_view.js
  58. +9 −5 media/js/newsblur/views/story_titles_view.js
  59. +25 −5 settings.py
  60. +5 −4 templates/mail/email_base.txt
  61. +6 −6 templates/mail/email_base.xhtml
  62. +2 −0 templates/mail/email_new_account.xhtml
  63. +14 −0 templates/mail/email_new_follower.txt
  64. +36 −0 templates/mail/email_new_follower.xhtml
  65. +1 −1 templates/reader/feeds.xhtml
  66. +109 −20 templates/social/social_page.xhtml
  67. +1 −1 templates/static/about.xhtml
  68. +9 −4 templates/static/api.xhtml
  69. +238 −4 templates/static/api.yml
  70. +2 −2 templates/static/faq.xhtml
  71. +1 −1 templates/static/press.xhtml
  72. +31 −0 utils/bootstrap_intel.py
  73. +2 −0 utils/munin/newsblur_updates.py
  74. +13 −2 utils/story_functions.py
  75. +1 −1 utils/templatetags/utils_tags.py
View
@@ -1,7 +1,7 @@
The MIT License
===============
-Copyright (c) 2009-2010 Samuel Clay <samuel@ofbrooklyn.com>.
+Copyright (c) 2009-2012 Samuel Clay, NewsBlur <samuel@newsblur.com>.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -145,7 +145,7 @@ these after the installation below.
4. Run the development server. At this point, all dependencies should be installed and no
additional configuration is needed. If you find that something is not working at this
point, please email the resulting output to Samuel Clay at
- [samuel@ofbrooklyn.com](samuel@ofbrooklyn.com).
+ [samuel@newsblur.com](samuel@newsblur.com).
./manage.py runserver
@@ -230,7 +230,7 @@ reader, and feed importer. To run the test suite:
## Author
* Created by [Samuel Clay](http://www.samuelclay.com).
- * Email address: <samuel@ofbrooklyn.com>
+ * Email address: <samuel@newsblur.com>
* [@samuelclay](http://twitter.com/samuelclay) on Twitter.
View
@@ -6,7 +6,7 @@
import cookielib
import json
-__author__ = "Dananjaya Ramanayake <dananjaya86@gmail.com>, Samuel Clay <samuel@ofbrooklyn.com>"
+__author__ = "Dananjaya Ramanayake <dananjaya86@gmail.com>, Samuel Clay <samuel@newsblur.com>"
__version__ = "1.0"
API_URL = "http://www.newsblur.com/"
@@ -55,7 +55,7 @@
"groups": [],
"user_permissions": [],
"password": "sha1$7b94b$ac9e6cf08d0fa16a67e56e319c0935aeb26db2a2",
- "email": "samuel@ofbrooklyn.com",
+ "email": "samuel@newsblur.com",
"date_joined": "2009-01-04 17:32:58"
}
}
@@ -13,7 +13,7 @@
"groups": [],
"user_permissions": [],
"password": "sha1$7b94b$ac9e6cf08d0fa16a67e56e319c0935aeb26db2a2",
- "email": "samuel@ofbrooklyn.com",
+ "email": "samuel@newsblur.com",
"date_joined": "2009-01-04 17:32:58"
}
}
@@ -150,7 +150,7 @@
"groups": [],
"user_permissions": [],
"password": "sha1$7b94b$ac9e6cf08d0fa16a67e56e319c0935aeb26db2a2",
- "email": "samuel@ofbrooklyn.com",
+ "email": "samuel@newsblur.com",
"date_joined": "2009-01-04 17:32:58"
}
},
View
@@ -16,6 +16,7 @@
from django.core.mail import mail_admins
from django.core.validators import email_re
from django.core.mail import EmailMultiAlternatives
+from django.contrib.sites.models import Site
from mongoengine.queryset import OperationError
from pymongo.helpers import OperationFailure
from operator import itemgetter
@@ -33,7 +34,9 @@
from apps.rss_feeds.models import Feed, MFeedPage, DuplicateFeed, MStory, MStarredStory, FeedLoadtime
except:
pass
-from apps.social.models import MSharedStory, MSocialProfile, MSocialSubscription, MActivity
+from apps.social.models import MSharedStory, MSocialProfile, MSocialServices
+from apps.social.models import MSocialSubscription, MActivity
+from apps.social.views import load_social_page
from utils import json_functions as json
from utils.user_functions import get_user, ajax_login_required
from utils.feed_functions import relative_timesince
@@ -48,9 +51,20 @@
SINGLE_DAY = 60*60*24
-@never_cache
@render_to('reader/feeds.xhtml')
def index(request):
+ if request.method == "GET" and request.subdomain and request.subdomain != 'dev':
+ username = request.subdomain
+ try:
+ if '.' in username:
+ username = username.split('.')[0]
+ user = User.objects.get(username__iexact=username)
+ except User.DoesNotExist:
+ return HttpResponseRedirect('http://%s%s' % (
+ Site.objects.get_current().domain.replace('www', 'dev'),
+ reverse('index')))
+ return load_social_page(request, user_id=user.pk, username=request.subdomain)
+
# XXX TODO: Remove me on launch.
if request.method == "GET" and request.user.is_anonymous() and not request.REQUEST.get('letmein'):
return {}, 'reader/social_signup.xhtml'
@@ -211,6 +225,7 @@ def load_feeds(request):
}
social_feeds = MSocialSubscription.feeds(**social_params)
social_profile = MSocialProfile.profile(user.pk)
+ social_services = MSocialServices.profile(user.pk)
user.profile.dashboard_date = datetime.datetime.now()
user.profile.save()
@@ -219,6 +234,7 @@ def load_feeds(request):
'feeds': feeds.values() if version == 2 else feeds,
'social_feeds': social_feeds,
'social_profile': social_profile,
+ 'social_services': social_services,
'folders': json.decode(folders.folders),
'starred_count': starred_count,
}
@@ -228,22 +244,25 @@ def load_feeds(request):
def load_feed_favicons(request):
user = get_user(request)
feed_ids = request.REQUEST.getlist('feed_ids')
- user_subs = UserSubscription.objects.select_related('feed').filter(user=user, active=True)
- if feed_ids and len(feed_ids) > 0:
- user_subs = user_subs.filter(feed__in=feed_ids)
+
+ if not feed_ids:
+ user_subs = UserSubscription.objects.select_related('feed').filter(user=user, active=True)
+ feed_ids = [sub['feed__pk'] for sub in user_subs.values('feed__pk')]
- feed_ids = [sub['feed__pk'] for sub in user_subs.values('feed__pk')]
feed_icons = dict([(i.feed_id, i.data) for i in MFeedIcon.objects(feed_id__in=feed_ids)])
return feed_icons
def load_feeds_flat(request):
user = request.user
include_favicons = request.REQUEST.get('include_favicons', False)
+ update_counts = request.REQUEST.get('update_counts', False)
+
feeds = {}
iphone_version = "1.2"
if include_favicons == 'false': include_favicons = False
+ if update_counts == 'false': update_counts = False
if not user.is_authenticated():
return HttpResponseForbidden()
@@ -285,7 +304,23 @@ def make_feeds_folder(items, parent_folder="", depth=0):
make_feeds_folder(folder, flat_folder_name, depth+1)
make_feeds_folder(folders)
- data = dict(flat_folders=flat_folders, feeds=feeds, user=user.username, iphone_version=iphone_version)
+
+ social_params = {
+ 'user_id': user.pk,
+ 'include_favicon': include_favicons,
+ 'update_counts': update_counts,
+ }
+ social_feeds = MSocialSubscription.feeds(**social_params)
+ social_profile = MSocialProfile.profile(user.pk)
+
+ data = {
+ "flat_folders": flat_folders,
+ "feeds": feeds,
+ "social_feeds": social_feeds,
+ "social_profile": social_profile,
+ "user": user.username,
+ "iphone_version": iphone_version,
+ }
return data
@ratelimit(minutes=1, requests=20)
@@ -643,14 +678,20 @@ def load_river_stories(request):
# starred_stories = {}
# Intelligence classifiers for all feeds involved
- classifier_feeds = list(MClassifierFeed.objects(user_id=user.pk,
- feed_id__in=found_feed_ids))
- classifier_authors = list(MClassifierAuthor.objects(user_id=user.pk,
+ if found_feed_ids:
+ classifier_feeds = list(MClassifierFeed.objects(user_id=user.pk,
feed_id__in=found_feed_ids))
- classifier_titles = list(MClassifierTitle.objects(user_id=user.pk,
+ classifier_authors = list(MClassifierAuthor.objects(user_id=user.pk,
+ feed_id__in=found_feed_ids))
+ classifier_titles = list(MClassifierTitle.objects(user_id=user.pk,
+ feed_id__in=found_feed_ids))
+ classifier_tags = list(MClassifierTag.objects(user_id=user.pk,
feed_id__in=found_feed_ids))
- classifier_tags = list(MClassifierTag.objects(user_id=user.pk,
- feed_id__in=found_feed_ids))
+ else:
+ classifier_feeds = []
+ classifier_authors = []
+ classifier_titles = []
+ classifier_tags = []
classifiers = sort_classifiers_by_feed(user=user, feed_ids=found_feed_ids,
classifier_feeds=classifier_feeds,
classifier_authors=classifier_authors,
@@ -20,7 +20,7 @@
"groups": [],
"user_permissions": [],
"password": "sha1$d5473$d07ce4495b088ff0f41a62d5113d0189ce8f0096",
- "email": "samuel@ofbrooklyn.com",
+ "email": "samuel@newsblur.com",
"date_joined": "2011-07-18 00:23:49"
}
}
@@ -125,7 +125,7 @@
"groups": [],
"user_permissions": [],
"password": "sha1$7b94b$ac9e6cf08d0fa16a67e56e319c0935aeb26db2a2",
- "email": "samuel@ofbrooklyn.com",
+ "email": "samuel@newsblur.com",
"date_joined": "2009-01-04 17:32:58"
}
}
View
@@ -933,6 +933,8 @@ def format_story(cls, story_db, feed_id=None, text=False):
text = re.sub(r'\n+', '\n\n', text)
text = re.sub(r'\t+', '\t', text)
story['text'] = text
+ if '<ins' in story['story_content'] or '<del' in story['story_content']:
+ story['has_modifications'] = True
return story
Oops, something went wrong.

0 comments on commit 065395b

Please sign in to comment.