diff --git a/NEWS b/NEWS index c26446b..b0789cf 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +1.2.18: March ??, 2008 + * Newly redesigned upgrade/pricing/signup page. + 1.2.17: March 18, 2008 * Internet Explorer expects quoted download filenames, while Firefox doesn't. So I took that into account by quoting conditionally based on the diff --git a/controller/Root.py b/controller/Root.py index 2df7657..e1dd779 100644 --- a/controller/Root.py +++ b/controller/Root.py @@ -13,8 +13,8 @@ from model.User import User from view.Main_page import Main_page from view.Front_page import Front_page from view.Tour_page import Tour_page +from view.Upgrade_page import Upgrade_page from view.Notebook_rss import Notebook_rss -from view.Upgrade_note import Upgrade_note from view.Json import Json from view.Error_page import Error_page from view.Not_found_page import Not_found_page @@ -79,6 +79,8 @@ class Root( object ): if note_title in ( u"sign_up", u"login" ) and https_url and cherrypy.request.remote_addr != https_proxy_ip: if invite_id: return dict( redirect = u"%s/%s?invite_id=%s" % ( https_url, note_title, invite_id ) ) + if after_login: + return dict( redirect = u"%s/%s?after_login=%s" % ( https_url, note_title, after_login ) ) else: return dict( redirect = u"%s/%s" % ( https_url, note_title ) ) @@ -270,48 +272,35 @@ class Root( object ): return result - @expose( view = Main_page ) + @expose( view = Upgrade_page ) @strongly_expire @end_transaction @grab_user_id @validate( user_id = Valid_id( none_okay = True ), ) - def upgrade( self, user_id = None ): + def pricing( self, user_id = None ): """ - Provide the information necessary to display the Luminotes upgrade page. + Provide the information necessary to display the Luminotes pricing page. """ - anonymous = self.__database.select_one( User, User.sql_load_by_username( u"anonymous" ) ) - if anonymous: - main_notebook = self.__database.select_one( Notebook, anonymous.sql_load_notebooks( undeleted_only = True ) ) - else: - main_notebook = None - - if user_id: - user = self.__database.load( User, user_id ) - else: - user = None - - https_url = self.__settings[ u"global" ].get( u"luminotes.https_url" ) result = self.__users.current( user_id ) - result[ "notebook" ] = main_notebook - result[ "startup_notes" ] = self.__database.select_many( Note, main_notebook.sql_load_startup_notes() ) - result[ "total_notes_count" ] = self.__database.select_one( Note, main_notebook.sql_count_notes() ) - result[ "note_read_write" ] = False - result[ "notes" ] = [ Note.create( - object_id = u"upgrade", - contents = unicode( Upgrade_note( - self.__settings[ u"global" ].get( u"luminotes.rate_plans", [] ), - self.__settings[ u"global" ].get( u"luminotes.unsubscribe_button" ), - https_url, - user, - ) ), - notebook_id = main_notebook.object_id, - ) ] - result[ "invites" ] = [] + parents = [ notebook for notebook in result[ u"notebooks" ] if notebook.trash_id and not notebook.deleted ] + if len( parents ) > 0: + result[ "first_notebook" ] = parents[ 0 ] + else: + result[ "first_notebook" ] = None + + result[ "rate_plans" ] = self.__settings[ u"global" ].get( u"luminotes.rate_plans", [] ) + result[ "unsubscribe_button" ] = self.__settings[ u"global" ].get( u"luminotes.unsubscribe_button" ) return result + @expose() + def upgrade( self ): + return dict( + redirect = u"/pricing", + ) + # TODO: move this method to controller.Notebooks, and maybe give it a more sensible name @expose( view = Json ) @end_transaction diff --git a/controller/test/Test_root.py b/controller/test/Test_root.py index c328ceb..c0a8c7e 100644 --- a/controller/test/Test_root.py +++ b/controller/test/Test_root.py @@ -326,8 +326,8 @@ class Test_root( Test_controller ): assert u"error" not in result assert result[ u"notebook" ].object_id == self.privacy_notebook.object_id - def test_upgrade( self ): - result = self.http_get( "/upgrade" ) + def test_pricing( self ): + result = self.http_get( "/pricing" ) assert result[ u"user" ].username == u"anonymous" assert len( result[ u"notebooks" ] ) == 4 @@ -341,27 +341,14 @@ class Test_root( Test_controller ): assert rate_plan[ u"name" ] == u"super" assert rate_plan[ u"storage_quota_bytes" ] == 1337 * 10 - assert result[ u"notebook" ].object_id == self.anon_notebook.object_id - assert len( result[ u"startup_notes" ] ) == 0 - assert result[ u"note_read_write" ] is False + assert result[ u"first_notebook" ] == None + assert result[ u"rate_plans" ] == self.settings[ u"global" ].get( u"luminotes.rate_plans", [] ) + assert result[ u"unsubscribe_button" ] == self.settings[ u"global" ].get( u"luminotes.unsubscribe_button" ) - assert result[ u"notes" ] - assert len( result[ u"notes" ] ) == 1 - assert result[ u"notes" ][ 0 ].title == u"upgrade your wiki" - assert result[ u"notes" ][ 0 ].notebook_id == self.anon_notebook.object_id - - contents = result[ u"notes" ][ 0 ].contents - assert u"upgrade" in contents - assert u"Super" in contents - assert u"Extra super" in contents - - # since the user is not logged in, no subscription buttons should be shown - assert u"button" not in contents - - def test_upgrade_after_login( self ): + def test_pricing_after_login( self ): self.login() - result = self.http_get( "/upgrade", session_id = self.session_id ) + result = self.http_get( "/pricing", session_id = self.session_id ) assert result[ u"user" ].username == self.username assert len( result[ u"notebooks" ] ) == 5 @@ -375,22 +362,14 @@ class Test_root( Test_controller ): assert rate_plan[ u"name" ] == u"super" assert rate_plan[ u"storage_quota_bytes" ] == 1337 * 10 - assert result[ u"notebook" ].object_id == self.anon_notebook.object_id - assert len( result[ u"startup_notes" ] ) == 0 - assert result[ u"note_read_write" ] is False + assert result[ u"first_notebook" ].object_id == self.notebook.object_id + assert result[ u"rate_plans" ] == self.settings[ u"global" ].get( u"luminotes.rate_plans", [] ) + assert result[ u"unsubscribe_button" ] == self.settings[ u"global" ].get( u"luminotes.unsubscribe_button" ) - assert result[ u"notes" ] - assert len( result[ u"notes" ] ) == 1 - assert result[ u"notes" ][ 0 ].title == u"upgrade your wiki" - assert result[ u"notes" ][ 0 ].notebook_id == self.anon_notebook.object_id + def upgrade( self ): + result = self.http_get( "/upgrade" ) - contents = result[ u"notes" ][ 0 ].contents - assert u"upgrade" in contents - assert u"Super" in contents - assert u"Extra super" in contents - - # since the user is logged in, subscription buttons should be shown - assert u"button" in contents + assert result[ u"redirect" ] == u"/pricing" def test_next_id( self ): result = self.http_get( "/next_id" ) diff --git a/static/css/note.css b/static/css/note.css index aa9a497..2f34936 100644 --- a/static/css/note.css +++ b/static/css/note.css @@ -89,81 +89,6 @@ ol li { padding-right: 1em; } -#upgrade_table_area { - text-align: center; -} - -#upgrade_login_text { - font-weight: bold; - text-align: center; -} - -#upgrade_table { - border-collapse: collapse; - border: 1px solid #999999; - margin-left: auto; - margin-right: auto; -} - -#upgrade_table th { - padding: 0.5em; -} - -#upgrade_table td { - text-align: center; - background-color: #fafafa; - padding: 0.5em; -} - -#upgrade_table .plan_name { - width: 16%; - text-align: center; - background-color: #d0e0f0; -} - -#upgrade_table .feature_name { - width: 36%; - text-align: left; - background-color: #fafafa; -} - -#upgrade_table_small { - border-collapse: collapse; - border: 1px solid #999999; - margin-left: auto; - margin-right: auto; -} - -#upgrade_table_small th { - padding: 0.5em; -} - -#upgrade_table_small td { - text-align: center; - background-color: #fafafa; - padding: 0.5em; -} - -#upgrade_table_small .plan_name { - width: 33%; - text-align: center; - background-color: #d0e0f0; -} - -.price_text { - color: #ff6600; -} - -.month_text { - padding-top: 0.5em; - font-size: 75%; -} - -.subscribe_form { - margin-top: 0.5em; - margin-bottom: 0; -} - .thumbnail_left { float: left; margin: 0.5em; diff --git a/static/css/product.css b/static/css/product.css index ea764a4..192e096 100644 --- a/static/css/product.css +++ b/static/css/product.css @@ -105,10 +105,6 @@ margin-right: 20px; } -.hook_bullet_list { - list-style-type: none; -} - .hook_action_area { background-color: #ffff99; font-weight: bold; @@ -178,6 +174,10 @@ padding-bottom: 0.5em; } +.compact_list { + line-height: 100%; +} + .quotes_area { float: right; width: 400px; @@ -207,10 +207,12 @@ } .footer { + clear: both; background-color: #b0d0ff; height: 2em; margin-left: 0; margin-right: 0; + margin-top: 1em; border-top: 1px solid #999999; } @@ -247,3 +249,127 @@ .tour_screenshot_wrapper { padding: 1em; } + +.upgrade_subtitle { + text-align: center; + font-weight: bold; + padding-bottom: 0.5em; +} + +.upgrade_text { + text-align: left; +} + +.upgrade_area { + text-align: center; + padding-top: 1em; + padding-bottom: 1em; + background-color: #ffffff; + border-bottom: 1px solid #cccccc; + margin: 0 auto; + margin-bottom: 1em; +} + +.upgrade_table_area { + text-align: center; +} + +#upgrade_table { + border-collapse: collapse; + border: 1px solid #999999; + margin-left: auto; + margin-right: auto; + margin-bottom: 1em; +} + +#upgrade_table th { + padding: 0.5em; +} + +#upgrade_table td { + text-align: center; + background-color: #fafafa; + padding: 0.5em; +} + +#upgrade_table .plan_name { + width: 16%; + text-align: center; + background-color: #d0e0f0; +} + +#upgrade_table .feature_name { + width: 36%; + text-align: left; + background-color: #fafafa; +} + +#upgrade_table_small { + clear: both; + border-collapse: collapse; + border: 1px solid #999999; + margin-left: auto; + margin-right: auto; +} + +#upgrade_table_small th { + padding: 0.5em; +} + +#upgrade_table_small td { + text-align: center; + background-color: #fafafa; + padding: 0.5em; +} + +#upgrade_table_small .plan_name { + width: 33%; + text-align: center; + background-color: #d0e0f0; +} + +.price_text { + color: #ff6600; +} + +.month_text { + padding-top: 0.5em; + font-size: 75%; +} + +.subscribe_form { + margin-top: 0.5em; + margin-bottom: 0; +} + +.sign_up_button_area { + margin-top: 0.5em; +} + +.upgrade_left_area { + width: 400px; + margin-bottom: 1em; +} + +.upgrade_right_area { + float: right; + width: 400px; + margin-left: 20px; + margin-bottom: 1em; +} + +.thumbnail_left { + float: left; + margin: 0.5em; + margin-right: 1em; + margin-bottom: 0.5em; + border: 1px solid #999999; +} + +.thumbnail_right { + float: right; + margin: 0.5em; + margin-left: 1em; + margin-bottom: 0.5em; + border: 1px solid #999999; +} diff --git a/static/html/sign up.html b/static/html/sign up.html index 9469b5f..de0d15e 100644 --- a/static/html/sign up.html +++ b/static/html/sign up.html @@ -1,20 +1,15 @@
-To get started with your own personal wiki, all you need to do is sign up for -an account. There's nothing to download or install. +There's nothing to download or install.
-If you haven't seen it already, try the -demo first! The Luminotes demo doesn't require any sort of sign up. +If you're not ready to sign up +yet, try the demo first!
-Providing your email address is completely optional. I only ask for it -in case you ever need your password reset. Your email address will absolutely -not be given out or used for spam. -