From: <al...@us...> - 2009-10-31 02:29:05
|
Revision: 12769 http://translate.svn.sourceforge.net/translate/?rev=12769&view=rev Author: alaaosh Date: 2009-10-31 02:28:54 +0000 (Sat, 31 Oct 2009) Log Message: ----------- use view_mode=review on quality check links Modified Paths: -------------- src/trunk/Pootle/local_apps/pootle_app/views/language/dispatch.py src/trunk/Pootle/local_apps/pootle_app/views/language/item_dict.py Modified: src/trunk/Pootle/local_apps/pootle_app/views/language/dispatch.py =================================================================== --- src/trunk/Pootle/local_apps/pootle_app/views/language/dispatch.py 2009-10-31 02:27:40 UTC (rev 12768) +++ src/trunk/Pootle/local_apps/pootle_app/views/language/dispatch.py 2009-10-31 02:28:54 UTC (rev 12769) @@ -78,6 +78,25 @@ params.view_mode = 'translate' return url_manip.make_url(path, params.encode()) +def review(request, path, **kwargs): + params = TranslatePageState(request.GET, **kwargs) + # In Pootle, URLs ending in translate.html are used when the user + # translates all files in a directory (for example, if the user is + # going through all fuzzy translations in a directory). If this is + # the case, we need to pass the current store name in the 'store' + # GET variable so that Pootle will know where to continue from + # when the user clicks submit/skip/suggest on a translation + # unit. But otherwise the store name is the last component of the + # path name and we don't need to pass the 'store' GET variable. + if path[-1] == '/': + path = path + 'translate.html' + else: + params.store = None + + if 'view_mode' not in kwargs: + params.view_mode = 'review' + return url_manip.make_url(path, params.encode()) + def show_directory(request, directory_path, **kwargs): params = ProjectIndexState(request.GET, **kwargs).encode() return url_manip.make_url(directory_path, params) Modified: src/trunk/Pootle/local_apps/pootle_app/views/language/item_dict.py =================================================================== --- src/trunk/Pootle/local_apps/pootle_app/views/language/item_dict.py 2009-10-31 02:27:40 UTC (rev 12768) +++ src/trunk/Pootle/local_apps/pootle_app/views/language/item_dict.py 2009-10-31 02:28:54 UTC (rev 12769) @@ -82,7 +82,7 @@ {"checks": checkcount, "checkspercent": (checkcount * 100) / total} ) #url_opts[str(checkname)] = 1 - checklink = {'href': dispatch.translate(request, path_obj.pootle_path, match_names=[checkname]), + checklink = {'href': dispatch.review(request, path_obj.pootle_path, match_names=[checkname]), 'text': checkname.replace('check-', '', 1), 'stats': stats} #del url_opts[str(checkname)] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |