fix(student): не дублировать главное фото записи/ученика в галерее
This commit is contained in:
@@ -148,7 +148,7 @@
|
||||
const items = data.entries.items;
|
||||
if (!items.length) return emptyHtml('Записей в журнале пока нет');
|
||||
return `<div class="sp-list">${items.map(e => {
|
||||
const photos = (e.photos || []).map(p => photoTile(p.photo_path));
|
||||
const photos = (e.photos || []).filter(p => p.photo_path !== e.photo_path).map(p => photoTile(p.photo_path));
|
||||
if (e.photo_path) photos.unshift(photoTile(e.photo_path, null, e.photo_original_path));
|
||||
return `<div class="lesson-item">
|
||||
<div class="lesson-item-head">
|
||||
@@ -193,7 +193,7 @@
|
||||
|
||||
function photosHtml() {
|
||||
const main = data.photos.photo_path;
|
||||
const items = data.photos.items || [];
|
||||
const items = (data.photos.items || []).filter(p => p.photo_path !== main);
|
||||
if (!main && !items.length) return emptyHtml('Фотографий нет');
|
||||
const tiles = [];
|
||||
if (main) tiles.push(photoTile(main, 'sp-photo'));
|
||||
|
||||
Reference in New Issue
Block a user