##// END OF EJS Templates
repo: introduce enable_downloads and enable_statistics when creating repos...
Mads Kiilerich -
r8729:f2dc57c1 stable
parent child Browse files
Show More
@@ -1230,8 +1230,8 b' class ApiController(JSONRPCController):'
1230 1230 clone_uri=clone_uri,
1231 1231 repo_group=group_name,
1232 1232 repo_landing_rev=landing_rev,
1233 enable_statistics=enable_statistics,
1234 enable_downloads=enable_downloads,
1233 repo_enable_statistics=enable_statistics,
1234 repo_enable_downloads=enable_downloads,
1235 1235 repo_copy_permissions=copy_permissions,
1236 1236 )
1237 1237
@@ -711,13 +711,10 b' def create_repo(form_data, cur_user):'
711 711 copy_fork_permissions = form_data.get('copy_permissions')
712 712 copy_group_permissions = form_data.get('repo_copy_permissions')
713 713 fork_of = form_data.get('fork_parent_id')
714 enable_statistics = form_data['repo_enable_statistics']
715 enable_downloads = form_data['repo_enable_downloads']
714 716 state = form_data.get('repo_state', db.Repository.STATE_PENDING)
715 717
716 # repo creation defaults, private and repo_type are filled in form
717 defs = db.Setting.get_default_repo_settings(strip_prefix=True)
718 enable_statistics = defs.get('repo_enable_statistics')
719 enable_downloads = defs.get('repo_enable_downloads')
720
721 718 try:
722 719 db_repo = RepoModel()._create_repo(
723 720 repo_name=repo_name_full,
@@ -58,6 +58,20 b''
58 58 </div>
59 59 </div>
60 60 <div class="form-group">
61 <label class="control-label" for="repo_enable_statistics">${_('Enable statistics')}:</label>
62 <div>
63 ${h.checkbox('repo_enable_statistics',value="True")}
64 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
65 </div>
66 </div>
67 <div class="form-group">
68 <label class="control-label" for="repo_enable_downloads">${_('Enable downloads')}:</label>
69 <div>
70 ${h.checkbox('repo_enable_downloads',value="True")}
71 <span class="help-block">${_('Enable download menu on summary page.')}</span>
72 </div>
73 </div>
74 <div class="form-group">
61 75 <div class="buttons">
62 76 ${h.submit('add',_('Add'),class_="btn btn-default")}
63 77 </div>
@@ -792,8 +792,8 b' class _BaseTestApi(object):'
792 792 ('clone_uri', {'clone_uri': None}),
793 793 ('landing_rev', {'landing_rev': 'branch:master'}),
794 794 ('private', {'private': True}),
795 #('enable_statistics', {'enable_statistics': True}), # currently broken
796 #('enable_downloads', {'enable_downloads': True}), # currently broken
795 ('enable_statistics', {'enable_statistics': True}),
796 ('enable_downloads', {'enable_downloads': True}),
797 797 ('repo_group', {'group': 'test_group_for_update'}),
798 798 ])
799 799 def test_api_create_repo(self, changing_attr, updates):
@@ -95,6 +95,8 b' class Fixture(object):'
95 95 repo_group='-1',
96 96 repo_description='DESC',
97 97 repo_private=False,
98 repo_enable_statistics=False,
99 repo_enable_downloads=False,
98 100 repo_landing_rev='rev:tip',
99 101 repo_copy_permissions=False,
100 102 repo_state=db.Repository.STATE_CREATED,
General Comments 0
You need to be logged in to leave comments. Login now