Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/template_data_source.py |
| diff --git a/chrome/common/extensions/docs/server2/template_data_source.py b/chrome/common/extensions/docs/server2/template_data_source.py |
| index 9f3d8ef9841905cc1cca5d9db5e66cb2633443a3..39ead98c1344f48d3a3c9f06f484d9a969b14f8a 100644 |
| --- a/chrome/common/extensions/docs/server2/template_data_source.py |
| +++ b/chrome/common/extensions/docs/server2/template_data_source.py |
| @@ -11,19 +11,17 @@ from third_party.handlebar import Handlebar |
| import url_constants |
| # Increment this if there are changes to the data stored about templates. |
| -_VERSION = 1 |
| +_VERSION = 2 |
| EXTENSIONS_URL = '/chrome/extensions' |
| -def _MakeChannelDict(channel_name): |
| +def _MakeChannelDict(channel_name, all_channels): |
| return { |
| - 'showWarning': channel_name != 'stable', |
| - 'channels': [ |
| - { 'name': 'Stable', 'path': 'stable' }, |
| - { 'name': 'Dev', 'path': 'dev' }, |
| - { 'name': 'Beta', 'path': 'beta' }, |
| - { 'name': 'Trunk', 'path': 'trunk' } |
| - ], |
| + 'channels' : [{'name': channel['name'].upper(), |
|
cduvall
2013/03/21 18:43:53
reformat to:
'channels' : [
{
'name': ...
epeterson
2013/03/25 19:35:11
Done.
|
| + 'version': channel['version'], |
| + 'path': channel['name'], |
| + 'isCurrent': channel['name'] == channel_name} |
| + for channel in all_channels], |
| 'current': channel_name |
| } |
| @@ -54,8 +52,9 @@ class TemplateDataSource(object): |
| cache_factory, |
| ref_resolver_factory, |
| public_template_path, |
| - private_template_path): |
| - self._branch_info = _MakeChannelDict(channel_name) |
| + private_template_path, |
| + all_channels): |
| + self._branch_info = _MakeChannelDict(channel_name, all_channels) |
| self._api_data_source_factory = api_data_source_factory |
| self._api_list_data_source_factory = api_list_data_source_factory |
| self._intro_data_source_factory = intro_data_source_factory |
| @@ -77,8 +76,6 @@ class TemplateDataSource(object): |
| """Returns a new TemplateDataSource bound to |request|. |
| """ |
| branch_info = self._branch_info.copy() |
| - branch_info['showWarning'] = (not path.startswith('apps') and |
| - branch_info['showWarning']) |
| return TemplateDataSource( |
| branch_info, |
| self._api_data_source_factory.Create(request), |