Introducing top level browsing

We introduce a new /p/<project_url>/browse endpoint, which allows to
see all top-level nodes of a project.
This commit is contained in:
2019-04-04 00:27:09 +02:00
parent 479153af9b
commit 4afe23e284
3 changed files with 98 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
| {% from '_macros/_asset_list_item.html' import asset_list_item %}
include ../../../../pillar/src/templates/mixins/components
| {% block body %}
#node-container
section.d-flex
h4.p-4 Browse
section.node-details-description.px-4.
Browse project
section.container-fluid
| {% if nodes %}
+card-deck(id="asset_list_explore", class="pl-4")
| {% for node in nodes %}
| {{ asset_list_item(node, current_user) }}
| {% endfor %}
| {% else %}
.list-node-children-container
.list-node-children-empty No items... yet!
| {% endif %}
script.
// Generate GA pageview
ga('send', 'pageview', location.pathname);
| {% endblock %}

View File

@@ -240,7 +240,8 @@ link(href="{{ url_for('static_cloud', filename='assets/css/project-main.css') }}
| {% endif %}
#project_context
| {% block project_context %}
| {% if show_project %}
| {% if show_project and not browse %}
| {# Embed the project view only if we are not exploring it. #}
| {% include "projects/view_embed.html" %}
| {% endif %}
| {% endblock project_context %}
@@ -496,6 +497,11 @@ script.
}
$('.project-mode-view').displayAs('inline-block');
$('.project-mode-edit').hide();
{% if browse %}
let url = "{{url_for('cloud.project_browse_view_nodes', project_url=project.url)}}";
loadProjectContent(url);
{% endif %}
} else {
displayNode(nodeId, false);
}