Skip to content

Commit

Permalink
#24: Content List Tab under SQLI Admin
Browse files Browse the repository at this point in the history
  • Loading branch information
obounjerte committed Jul 29, 2021
1 parent 6fb6b1f commit 5b12fb8
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Controller/SQLIContentListController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php


namespace SQLI\EzToolboxBundle\Controller;


class SQLIAllContentList extends \Controller
{

}
89 changes: 89 additions & 0 deletions Resources/views/ContentList/all_content_list.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{% extends '@ezdesign/ui/layout.html.twig' %}

{% block title %}{{ 'Content List'|trans }}{% endblock %}

{%- block breadcrumbs -%}
{% include '@ezdesign/ui/breadcrumbs.html.twig' with { items: [
{ value: 'url.list'|trans|desc('Content List') }
]} %}
{%- endblock -%}

{%- block page_title -%}
{% include '@ezdesign/ui/page_title.html.twig' with {
title: 'url.list'|trans|desc('Content List'),
icon_name: 'article'
} %}
{%- endblock -%}

{% block javascripts %}
<script src="{{ asset('sqli-eztoolbox/Resources/asset/js/dropdown.js')}}"></script>
{% endblock %}

{%- block content -%}

<section class="container my-4">
<div class="my-4">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="contentTypeFilter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if app.request.get('contentTypeIdentifier') == false %}
Content Type
{% else %}
{% for group, types in contentTypes %}
{% for type in types %}
{% if type.identifier == app.request.get('contentTypeIdentifier') %}
{{ type.name }}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
</button>
<div class="dropdown-menu" aria-labelledby="contentTypeFilter">
{% for group, types in contentTypes %}
<h6 class="dropdown-header">{{ group }}</h6>
{% for type in types %}
<a class="dropdown-item" href="{{ path('sqli_eztoolbox_all_content_list', { 'contentTypeIdentifier': type.identifier }) }}">{{ type.name }}</a>
{% endfor %}
{% endfor %}
</div>
</div>
</div>
<div class="ez-table-header">
<div class="ez-table-header__headline">{{ "Content List"|trans }} --
{% if totalCount > 1 %}
{{ totalCount }}{{ "entity.content_list_total_objects"|trans}}
{% else %}
{{ totalCount }}{{ "content_list_total_object"|trans}}
{% endif %}
</div>
</div>
<table class="table">
<thead>
<tr>
<th>{{ 'Content name'|trans }}</th>
<th>{{ 'Content Type'|trans }}</th>
<th>{{ 'Modified'|trans }}</th>
<th>{{ 'Published'|trans }}</th>
</tr>
</thead>
<tbody>
{% for article in articles %}
<tr>
<td><a href={{ez_path(article)}}>{{ ez_content_name(article.contentInfo) }}</a></td>
<td>{{ article.contentInfo.contentTypeId }}</td>
<td>{{ article.contentInfo.modificationDate|ez_full_datetime }}</td>
<td>{{ article.contentInfo.publishedDate|ez_full_datetime }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ pagerfanta(articles, 'ez') }}
</section>

<script>
$(".dropdown-menu a ").click(function () {
let x = $(this).text();
alert(x);
});
</script>

{%- endblock -%}

0 comments on commit 5b12fb8

Please sign in to comment.