move trial mode services from org dashboard to separate page

the new page is platform admin only, and also has search built in
also, split test_organisation_invites into two files
This commit is contained in:
Leo Hemsted
2019-05-21 14:56:15 +01:00
parent a65450b118
commit 9795f2b838
6 changed files with 740 additions and 639 deletions

View File

@@ -70,7 +70,10 @@ def add_organisation():
@login_required
@user_has_permissions()
def organisation_dashboard(org_id):
organisation_services = organisations_client.get_organisation_services(org_id)
organisation_services = [
service for service in organisations_client.get_organisation_services(org_id)
if service['active'] and not service['restricted']
]
for service in organisation_services:
has_permission = current_user.has_permission_for_service(service['id'], 'view_activity')
service.update({'has_permission_to_view': has_permission})
@@ -81,6 +84,19 @@ def organisation_dashboard(org_id):
)
@main.route("/organisations/<org_id>/trial-services", methods=['GET'])
@login_required
@user_is_platform_admin
def organisation_trial_mode_services(org_id):
organisation_services = organisations_client.get_organisation_services(org_id)
return render_template(
'views/organisations/organisation/trial-mode-services.html',
search_form=SearchByNameForm(),
services=[service for service in organisation_services if not service['active'] or service['restricted']]
)
@main.route("/organisations/<org_id>/users", methods=['GET'])
@login_required
@user_has_permissions()