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:
27
src/templates/projects/browse_embed.pug
Normal file
27
src/templates/projects/browse_embed.pug
Normal 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 %}
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user