witten
/
luminotes
Archived
1
0
Fork 0

Added new notebook_sharing rate plan config option to control whether the user can share notebooks at all.

This commit is contained in:
Dan Helfman 2008-08-20 17:05:21 -07:00
parent f5b0839e4b
commit 7d8240f7be
6 changed files with 23 additions and 10 deletions

3
NEWS
View File

@ -1,3 +1,6 @@
1.4.27:
*
1.4.26: August 20, 2008: 1.4.26: August 20, 2008:
* Ported all database code to support SQLite in addition to the existing * Ported all database code to support SQLite in addition to the existing
PostgreSQL support. This is a necessary first step for Luminotes Desktop. PostgreSQL support. This is a necessary first step for Luminotes Desktop.

View File

@ -32,6 +32,7 @@ settings = {
"designed_for": "students", "designed_for": "students",
"storage_quota_bytes": 30 * MEGABYTE, "storage_quota_bytes": 30 * MEGABYTE,
"included_users": 1, "included_users": 1,
"notebook_sharing": True,
"notebook_collaboration": False, "notebook_collaboration": False,
"user_admin": False, "user_admin": False,
"fee": None, "fee": None,
@ -42,6 +43,7 @@ settings = {
"designed_for": "home users", "designed_for": "home users",
"storage_quota_bytes": 250 * MEGABYTE, "storage_quota_bytes": 250 * MEGABYTE,
"included_users": 1, "included_users": 1,
"notebook_sharing": True,
"notebook_collaboration": True, "notebook_collaboration": True,
"user_admin": False, "user_admin": False,
"fee": 5, "fee": 5,
@ -58,6 +60,7 @@ settings = {
"designed_for": "professionals", "designed_for": "professionals",
"storage_quota_bytes": 500 * MEGABYTE, "storage_quota_bytes": 500 * MEGABYTE,
"included_users": 1, "included_users": 1,
"notebook_sharing": True,
"notebook_collaboration": True, "notebook_collaboration": True,
"user_admin": False, "user_admin": False,
"fee": 9, "fee": 9,
@ -74,6 +77,7 @@ settings = {
"designed_for": "small teams", "designed_for": "small teams",
"storage_quota_bytes": 1000 * MEGABYTE, "storage_quota_bytes": 1000 * MEGABYTE,
"included_users": 5, "included_users": 5,
"notebook_sharing": True,
"notebook_collaboration": True, "notebook_collaboration": True,
"user_admin": True, "user_admin": True,
"fee": 19, "fee": 19,
@ -90,6 +94,7 @@ settings = {
"designed_for": "organizations", "designed_for": "organizations",
"storage_quota_bytes": 5000 * MEGABYTE, "storage_quota_bytes": 5000 * MEGABYTE,
"included_users": 30, "included_users": 30,
"notebook_sharing": True,
"notebook_collaboration": True, "notebook_collaboration": True,
"user_admin": True, "user_admin": True,
"fee": 99, "fee": 99,

View File

@ -15,6 +15,7 @@ settings = {
"designed_for": "individuals", "designed_for": "individuals",
"storage_quota_bytes": None, # None indicates that there is no storage quota "storage_quota_bytes": None, # None indicates that there is no storage quota
"included_users": 1, "included_users": 1,
"notebook_sharing": False,
"notebook_collaboration": False, "notebook_collaboration": False,
"user_admin": False, "user_admin": False,
"fee": None, "fee": None,

View File

@ -4,7 +4,7 @@ from Search_form import Search_form
class Link_area( Div ): 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 linked_notebooks = [ nb for nb in notebooks if
( nb.read_write or not nb.name.startswith( u"Luminotes" ) ) and ( nb.read_write or not nb.name.startswith( u"Luminotes" ) ) and
nb.name not in ( u"trash" ) and nb.name not in ( u"trash" ) and
@ -42,7 +42,7 @@ class Link_area( Div ):
class_ = u"link_area_item", class_ = u"link_area_item",
) or None, ) or None,
( notebook.name == u"Luminotes blog" ) and Div( ( rate_plan.get( u"notebook_sharing" ) and notebook.name == u"Luminotes blog" ) and Div(
A( A(
u"subscribe to rss", u"subscribe to rss",
href = u"%s?rss" % notebook_path, 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.", title = u"Subscribe to the RSS feed for the Luminotes blog.",
), ),
class_ = u"link_area_item", class_ = u"link_area_item",
) or ( updates_path and Div( ) or ( updates_path and rate_plan.get( u"notebook_sharing" ) and Div(
A( A(
u"subscribe to rss", u"subscribe to rss",
href = updates_path, href = updates_path,
@ -112,7 +112,7 @@ class Link_area( Div ):
class_ = u"link_area_item", class_ = u"link_area_item",
) or None, ) or None,
( notebook.owner and user.username ) and Div( ( notebook.owner and user.username and rate_plan.get( u"notebook_sharing" ) ) and Div(
A( A(
u"share", u"share",
href = u"#", href = u"#",

View File

@ -78,10 +78,13 @@ class Main_page( Page ):
else: else:
title = None title = None
updates_path = u"/notebooks/updates/%s?rss&%s" % ( if rate_plan.get( u"notebook_sharing" ):
notebook.object_id, updates_path = u"/notebooks/updates/%s?rss&%s" % (
urlencode( [ ( u"notebook_name", notebook.name.encode( "utf8" ) ) ] ), notebook.object_id,
) urlencode( [ ( u"notebook_name", notebook.name.encode( "utf8" ) ) ] ),
)
else:
updates_path = None
if notebook.name == u"Luminotes": if notebook.name == u"Luminotes":
notebook_path = u"/" notebook_path = u"/"
@ -231,7 +234,7 @@ class Main_page( Page ):
id = u"center_content_area", id = u"center_content_area",
), ),
Div( 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"right_area",
), ),
id = u"everything_area", id = u"everything_area",

View File

@ -142,7 +142,8 @@ class Upgrade_page( Product_page ):
class_ = u"feature_name", class_ = u"feature_name",
), ),
[ Td( [ 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"&nbsp",
) for plan in rate_plans ], ) for plan in rate_plans ],
), ),
Tr( Tr(