Show More
@@ -1230,8 +1230,8 b' class ApiController(JSONRPCController):' | |||||
1230 | clone_uri=clone_uri, |
|
1230 | clone_uri=clone_uri, | |
1231 | repo_group=group_name, |
|
1231 | repo_group=group_name, | |
1232 | repo_landing_rev=landing_rev, |
|
1232 | repo_landing_rev=landing_rev, | |
1233 | enable_statistics=enable_statistics, |
|
1233 | repo_enable_statistics=enable_statistics, | |
1234 | enable_downloads=enable_downloads, |
|
1234 | repo_enable_downloads=enable_downloads, | |
1235 | repo_copy_permissions=copy_permissions, |
|
1235 | repo_copy_permissions=copy_permissions, | |
1236 | ) |
|
1236 | ) | |
1237 |
|
1237 |
@@ -711,13 +711,10 b' def create_repo(form_data, cur_user):' | |||||
711 | copy_fork_permissions = form_data.get('copy_permissions') |
|
711 | copy_fork_permissions = form_data.get('copy_permissions') | |
712 | copy_group_permissions = form_data.get('repo_copy_permissions') |
|
712 | copy_group_permissions = form_data.get('repo_copy_permissions') | |
713 | fork_of = form_data.get('fork_parent_id') |
|
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 | state = form_data.get('repo_state', db.Repository.STATE_PENDING) |
|
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 | try: |
|
718 | try: | |
722 | db_repo = RepoModel()._create_repo( |
|
719 | db_repo = RepoModel()._create_repo( | |
723 | repo_name=repo_name_full, |
|
720 | repo_name=repo_name_full, |
@@ -58,6 +58,20 b'' | |||||
58 | </div> |
|
58 | </div> | |
59 | </div> |
|
59 | </div> | |
60 | <div class="form-group"> |
|
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 | <div class="buttons"> |
|
75 | <div class="buttons"> | |
62 | ${h.submit('add',_('Add'),class_="btn btn-default")} |
|
76 | ${h.submit('add',_('Add'),class_="btn btn-default")} | |
63 | </div> |
|
77 | </div> |
@@ -792,8 +792,8 b' class _BaseTestApi(object):' | |||||
792 | ('clone_uri', {'clone_uri': None}), |
|
792 | ('clone_uri', {'clone_uri': None}), | |
793 | ('landing_rev', {'landing_rev': 'branch:master'}), |
|
793 | ('landing_rev', {'landing_rev': 'branch:master'}), | |
794 | ('private', {'private': True}), |
|
794 | ('private', {'private': True}), | |
795 |
|
|
795 | ('enable_statistics', {'enable_statistics': True}), | |
796 |
|
|
796 | ('enable_downloads', {'enable_downloads': True}), | |
797 | ('repo_group', {'group': 'test_group_for_update'}), |
|
797 | ('repo_group', {'group': 'test_group_for_update'}), | |
798 | ]) |
|
798 | ]) | |
799 | def test_api_create_repo(self, changing_attr, updates): |
|
799 | def test_api_create_repo(self, changing_attr, updates): |
@@ -95,6 +95,8 b' class Fixture(object):' | |||||
95 | repo_group='-1', |
|
95 | repo_group='-1', | |
96 | repo_description='DESC', |
|
96 | repo_description='DESC', | |
97 | repo_private=False, |
|
97 | repo_private=False, | |
|
98 | repo_enable_statistics=False, | |||
|
99 | repo_enable_downloads=False, | |||
98 | repo_landing_rev='rev:tip', |
|
100 | repo_landing_rev='rev:tip', | |
99 | repo_copy_permissions=False, |
|
101 | repo_copy_permissions=False, | |
100 | repo_state=db.Repository.STATE_CREATED, |
|
102 | repo_state=db.Repository.STATE_CREATED, |
General Comments 0
You need to be logged in to leave comments.
Login now