Portfolio: Show all items in portfolio course - refs BT#18201

pull/3737/head
Angel Fernando Quiroz Campos 5 years ago
parent 0a819765fb
commit 9f809fbe02
  1. 4
      main/portfolio/list.php
  2. 4
      main/template/default/portfolio/items.html.twig
  3. 6
      main/template/default/portfolio/list.html.twig

@ -28,7 +28,7 @@ $form = new FormValidator('a');
$form->addUserAvatar('user', get_lang('User'), 'medium');
$form->setDefaults(['user' => $owner]);
$criteria = ['user' => $owner];
$criteria = [];
if (!$allowEdit) {
$criteria['isVisible'] = true;
@ -41,6 +41,8 @@ $categories = $em
if ($course) {
$criteria['course'] = $course;
$criteria['session'] = $session;
} else {
$criteria['user'] = $owner;
}
$criteria['category'] = null;

@ -1,4 +1,4 @@
{% macro display(items, category_id, allow_edit, _c) %}
{% macro display(items, category_id, allow_edit, _c, _u) %}
{% set edit_img = 'edit.png'|img(22, 'Edit'|get_lang) %}
{% set visible_img = 'visible.png'|img(22, 'Invisible'|get_lang) %}
{% set invisible_img = 'invisible.png'|img(22, 'Visible'|get_lang) %}
@ -9,7 +9,7 @@
{% for item in items %}
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="heading-item-{{ item.id }}">
{% if allow_edit %}
{% if _u.id == item.user.id %}
<div class="pull-right">
<a href="{{ baseurl ~ {'action':'edit_item', 'id':item.id}|url_encode }}">
{{ edit_img }}

@ -10,7 +10,7 @@
<h3>{{ user.completeName }} <small>{{ user.username }}</small></h3>
{% endif %}
{{ items.display(uncategorized_items, 0, allow_edit, _c) }}
{{ items.display(uncategorized_items, 0, allow_edit, _c, _u) }}
{% for category in portfolio %}
<div class="panel panel-info">
@ -21,7 +21,7 @@
{{ category.title }}
</a>
{% if allow_edit %}
{% if user.id == category.user.id %}
<div class="pull-right">
<a href="{{ baseurl ~ {'action':'edit_category', 'id':category.id}|url_encode }}">
{{ edit_img }}
@ -48,7 +48,7 @@
</div>
<div class="collapse" id="collapse-category-{{ category.id }}">
{{ items.display(category.items(course, session, not allow_edit), category.id, allow_edit, _c) }}
{{ items.display(category.items(course, session, not allow_edit), category.id, allow_edit, _c, _u) }}
</div>
</div>
</div>

Loading…
Cancel
Save