Link template folders to their contents

Clicking on template folder navigates to a page that displays that
folder's contents.

This reuses the existing choose template view by adding a filter
based on optional `template_folder_id` argument.

Service model methods are rewritten to match `all_templates` and
`get_template`. New `get_template_folder_path` method returns a
list of folders (from root to the current one) that the selected
folder is nested inside.
This commit is contained in:
Alexey Bezhan
2018-11-05 16:25:19 +00:00
parent 29bed8ba55
commit 20abe96fc9
4 changed files with 32 additions and 11 deletions

View File

@@ -1,4 +1,3 @@
import uuid
import json
import os
from contextlib import contextmanager
@@ -3241,6 +3240,4 @@ def url_for_endpoint_with_token(endpoint, token):
@pytest.fixture
def mock_get_template_folders(mocker):
return mocker.patch('app.template_folder_api_client.get_template_folders', return_value=[
{'id': uuid.uuid4(), 'name': 'Template Folder', 'parent_id': None}
])
return mocker.patch('app.template_folder_api_client.get_template_folders', return_value=[])