From 7d8240f7be2eebafa86cf9ba3caba2d9f19954dd Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 20 Aug 2008 17:05:21 -0700 Subject: [PATCH] Added new notebook_sharing rate plan config option to control whether the user can share notebooks at all. --- NEWS | 3 +++ config/Common.py | 5 +++++ config/Desktop.py | 1 + view/Link_area.py | 8 ++++---- view/Main_page.py | 13 ++++++++----- view/Upgrade_page.py | 3 ++- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 0645c9c..507439d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +1.4.27: + * + 1.4.26: August 20, 2008: * Ported all database code to support SQLite in addition to the existing PostgreSQL support. This is a necessary first step for Luminotes Desktop. diff --git a/config/Common.py b/config/Common.py index 1f3fb38..c0c4d67 100644 --- a/config/Common.py +++ b/config/Common.py @@ -32,6 +32,7 @@ settings = { "designed_for": "students", "storage_quota_bytes": 30 * MEGABYTE, "included_users": 1, + "notebook_sharing": True, "notebook_collaboration": False, "user_admin": False, "fee": None, @@ -42,6 +43,7 @@ settings = { "designed_for": "home users", "storage_quota_bytes": 250 * MEGABYTE, "included_users": 1, + "notebook_sharing": True, "notebook_collaboration": True, "user_admin": False, "fee": 5, @@ -58,6 +60,7 @@ settings = { "designed_for": "professionals", "storage_quota_bytes": 500 * MEGABYTE, "included_users": 1, + "notebook_sharing": True, "notebook_collaboration": True, "user_admin": False, "fee": 9, @@ -74,6 +77,7 @@ settings = { "designed_for": "small teams", "storage_quota_bytes": 1000 * MEGABYTE, "included_users": 5, + "notebook_sharing": True, "notebook_collaboration": True, "user_admin": True, "fee": 19, @@ -90,6 +94,7 @@ settings = { "designed_for": "organizations", "storage_quota_bytes": 5000 * MEGABYTE, "included_users": 30, + "notebook_sharing": True, "notebook_collaboration": True, "user_admin": True, "fee": 99, diff --git a/config/Desktop.py b/config/Desktop.py index eaa6609..5e08293 100644 --- a/config/Desktop.py +++ b/config/Desktop.py @@ -15,6 +15,7 @@ settings = { "designed_for": "individuals", "storage_quota_bytes": None, # None indicates that there is no storage quota "included_users": 1, + "notebook_sharing": False, "notebook_collaboration": False, "user_admin": False, "fee": None, diff --git a/view/Link_area.py b/view/Link_area.py index 411267f..c62890c 100644 --- a/view/Link_area.py +++ b/view/Link_area.py @@ -4,7 +4,7 @@ from Search_form import Search_form class Link_area( Div ): - def __init__( self, notebooks, notebook, parent_id, notebook_path, updates_path, user ): + def __init__( self, notebooks, notebook, parent_id, notebook_path, updates_path, user, rate_plan ): linked_notebooks = [ nb for nb in notebooks if ( nb.read_write or not nb.name.startswith( u"Luminotes" ) ) and nb.name not in ( u"trash" ) and @@ -42,7 +42,7 @@ class Link_area( Div ): class_ = u"link_area_item", ) or None, - ( notebook.name == u"Luminotes blog" ) and Div( + ( rate_plan.get( u"notebook_sharing" ) and notebook.name == u"Luminotes blog" ) and Div( A( u"subscribe to rss", href = u"%s?rss" % notebook_path, @@ -55,7 +55,7 @@ class Link_area( Div ): title = u"Subscribe to the RSS feed for the Luminotes blog.", ), class_ = u"link_area_item", - ) or ( updates_path and Div( + ) or ( updates_path and rate_plan.get( u"notebook_sharing" ) and Div( A( u"subscribe to rss", href = updates_path, @@ -112,7 +112,7 @@ class Link_area( Div ): class_ = u"link_area_item", ) or None, - ( notebook.owner and user.username ) and Div( + ( notebook.owner and user.username and rate_plan.get( u"notebook_sharing" ) ) and Div( A( u"share", href = u"#", diff --git a/view/Main_page.py b/view/Main_page.py index 14371a8..91775af 100644 --- a/view/Main_page.py +++ b/view/Main_page.py @@ -78,10 +78,13 @@ class Main_page( Page ): else: title = None - updates_path = u"/notebooks/updates/%s?rss&%s" % ( - notebook.object_id, - urlencode( [ ( u"notebook_name", notebook.name.encode( "utf8" ) ) ] ), - ) + if rate_plan.get( u"notebook_sharing" ): + updates_path = u"/notebooks/updates/%s?rss&%s" % ( + notebook.object_id, + urlencode( [ ( u"notebook_name", notebook.name.encode( "utf8" ) ) ] ), + ) + else: + updates_path = None if notebook.name == u"Luminotes": notebook_path = u"/" @@ -231,7 +234,7 @@ class Main_page( Page ): id = u"center_content_area", ), Div( - Link_area( notebooks, notebook, parent_id, notebook_path, updates_path, user ), + Link_area( notebooks, notebook, parent_id, notebook_path, updates_path, user, rate_plan ), id = u"right_area", ), id = u"everything_area", diff --git a/view/Upgrade_page.py b/view/Upgrade_page.py index 9ee4e95..1042260 100644 --- a/view/Upgrade_page.py +++ b/view/Upgrade_page.py @@ -142,7 +142,8 @@ class Upgrade_page( Product_page ): class_ = u"feature_name", ), [ Td( - Img( src = u"/static/images/check.png", width = u"22", height = u"22" ), + plan[ u"notebook_sharing" ] and + Img( src = u"/static/images/check.png", width = u"22", height = u"22" ) or u" ", ) for plan in rate_plans ], ), Tr(