Layout: Made a brand new layout for notes list and update counter in video list

This commit is contained in:
kosfurler 2022-02-01 19:50:53 +03:00
parent a2b13116e6
commit 3f1b852e50
6 changed files with 161 additions and 69 deletions

View file

@ -10,54 +10,58 @@
{include size, x => $dat}
{/ifset}
<div class="container_gray">
{var data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
{ifset specpage}
{include specpage, x => $dat}
{else}
<div class="container_gray">
{var data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
{if sizeof($data) > 0}
<div class="content" n:foreach="$data as $dat">
<table>
<tbody>
<tr>
<td valign="top">
<a href="{include link, x => $dat}">
{include preview, x => $dat}
</a>
</td>
<td valign="top" style="width: 100%">
{ifset infotable}
{include infotable, x => $dat}
{else}
<a href="{include link, x => $dat}">
<b>
{include name, x => $dat}
</b>
</a>
<br/>
{include description, x => $dat}
{/ifset}
</td>
<td n:ifset="actions" valign="top" class="action_links" style="width: 150px; text-transform: lowercase;">
{include actions, x => $dat}
</td>
</tr>
</tbody>
</table>
</div>
{include "components/paginator.xml", conf => (object) [
"page" => $page,
"count" => $count,
"amount" => sizeof($data),
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
"atBottom" => true,
]}
{else}
{ifset customErrorMessage}
{include customErrorMessage}
{if sizeof($data) > 0}
<div class="content" n:foreach="$data as $dat">
<table>
<tbody>
<tr>
<td valign="top">
<a href="{include link, x => $dat}">
{include preview, x => $dat}
</a>
</td>
<td valign="top" style="width: 100%">
{ifset infotable}
{include infotable, x => $dat}
{else}
<a href="{include link, x => $dat}">
<b>
{include name, x => $dat}
</b>
</a>
<br/>
{include description, x => $dat}
{/ifset}
</td>
<td n:ifset="actions" valign="top" class="action_links" style="width: 150px; text-transform: lowercase;">
{include actions, x => $dat}
</td>
</tr>
</tbody>
</table>
</div>
{include "components/paginator.xml", conf => (object) [
"page" => $page,
"count" => $count,
"amount" => sizeof($data),
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
"atBottom" => true,
]}
{else}
{include "components/nothing.xml"}
{/ifset}
{/if}
</div>
{ifset customErrorMessage}
{include customErrorMessage}
{else}
{include "components/nothing.xml"}
{/ifset}
{/if}
</div>
{/ifset}
{ifset bottom}
{include bottom}

View file

@ -5,12 +5,25 @@
{block title}{_notes}{/block}
{block header}
<a href="{$owner->getURL()}">{$owner->getCanonicalName()}</a>
»
{_notes}
<div n:if="isset($thisUser) && $thisUser->getId() == $owner->getId()" style="float:right;">
<a href="/notes/create">{_create_note}</a>
{if isset($thisUser) && $thisUser->getId() == $owner->getId()}
{_my_notes}
{else}
<a href="{$owner->getURL()}">
{$owner->getCanonicalName()}</a>
»
{_notes}
{/if}
{/block}
{block size}
<div style="padding-bottom: 0px; padding-top: 0;" class="summaryBar">
<div class="summary">
{tr("notes_list", $count)}
<span n:if="isset($thisUser) && $thisUser->getId() == $owner->getId()">
&nbsp;|&nbsp;
<a href="/notes/create">{_create_note}</a>
</span>
</div>
</div>
{/block}
@ -20,18 +33,66 @@
{* BEGIN ELEMENTS DESCRIPTION *}
{block link|strip|stripHtml}
/note{$x->getPrettyId()}
{/block}
{block specpage}
<div class="container_gray" style="background: white; border-top: none;">
{block preview}
<center><img src="/assets/packages/static/openvk/img/note_icon.png" alt="{_note}" style="margin-top: 17px;" /></center>
{/block}
{var data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
{if sizeof($data) > 0}
{block name}
{$x->getName()}
{/block}
<div n:foreach="$data as $dat">
<div class="profile_thumb">
<a href="{$owner->getURL()}">
<img src="{$owner->getAvatarUrl()}" style="width: 50px;">
</a>
</div>
<article class="note_body" id="userContent" style="width: 540px; display: inline-block; margin-bottom: 35px;">
<div class="note_header">
<div class="note_title">
<div class="note_title">
<a href="/note{$dat->getPrettyId()}">{$dat->getName()}</a>
</div>
</div>
<div class="byline">
<span><a href="{$owner->getURL()}">{$owner->getCanonicalName()}</a></span> {$dat->getPublicationTime()}
<span n:if="$dat->getEditTime() > $dat->getPublicationTime()">({_edited} {$dat->getEditTime()})</span>
</div>
</div>
<div style="margin-left: 6px;">
{$dat->getText(750)|noescape}
</div>
<div class="note_footer" style="margin: 10px 0 0;">
<div class="comments_count">
<a href="/note{$dat->getPrettyId()}">
{block description}
{$x->getPreview(250)}
{if sizeof($dat->getCommentsCount()) > 0}
{_comments} ({$dat->getCommentsCount()})
{else}
{_no_comments}
{/if}
</a>
<span n:if="isset($thisUser) && $thisUser->getId() === $dat->getOwner()->getId()">&nbsp;|&nbsp;
<a id="_noteDelete" href="/note{$dat->getOwner()->getId()}_{$dat->getId()}/delete">{_delete}</a>
&nbsp;|&nbsp;
<a href="/note{$dat->getOwner()->getId()}_{$dat->getVirtualId()}/edit">{_edit}</a>
</span>
</div>
</div>
</article>
</div>
{else}
{if isset($thisUser) && $thisUser->getId() == $owner->getId()}
<div style="padding: 10px 20px 20px;"><h4 style="border: none;padding-bottom: 5px;">{_welcome}</h4>{_notes_start_screen}</div>
{else}
{ifset customErrorMessage}
{include ../customErrorMessage}
{else}
{include ../components/nothing.xml}
{/ifset}
{/if}
{/if}
</div>
{/block}

View file

@ -8,9 +8,17 @@
{block header}
<a href="{$user->getURL()}">{$user->getCanonicalName()}</a>
» {_"videos"}
<div n:if="isset($thisUser) && $thisUser->getId() == $user->getId()" style="float: right;">
<a href="/videos/upload">{_"upload_video"}</a>
{/block}
{block size}
<div style="padding-bottom: 0px;border-bottom: 0; padding-top: 0;" class="summaryBar">
<div class="summary">
{tr("videos", $count)}
<span n:if="isset($thisUser) && $thisUser->getId() == $user->getId()">
&nbsp;|&nbsp;
<a href="/videos/upload">{_upload_video}</a>
</span>
</div>
</div>
{/block}

View file

@ -1864,4 +1864,15 @@ body.scrolled .toTop:hover {
.group_info .label {
width: auto !important;
padding-right: 5px;
}
}
table td[width="120"] {
text-align: right;
}
.profile_thumb {
padding: 0px 10px 0px 0px;
width: 50px;
display: inline-block;
vertical-align: top;
}

View file

@ -310,6 +310,7 @@
"notes_zero" = "No notes";
"notes_one" = "$1 note";
"notes_other" = "$1 notes";
"notes_start_screen" = "With notes, you can share your events with friends and see what's going on with them.";
/* Menus */

View file

@ -324,9 +324,10 @@
"note" = "Заметка";
"name_note" = "Название";
"text_note" = "Содержание";
"create_note" = "Создать заметку";
"create_note" = "Добавить запись";
"edit_note" = "Редактировать заметку";
"actions" = "Действия";
"notes_start_screen" = "С помощью заметок Вы можете делиться событиями из жизни с друзьями, а так же быть в курсе того, что происходит у них.";
"edited" = "Отредактировано";
@ -336,6 +337,12 @@
"notes_many" = "$1 заметок";
"notes_other" = "$1 заметок";
"notes_list_zero" = "Не найдено ни одной заметки";
"notes_list_one" = "Найдена одна заметка";
"notes_list_few" = "Найдено $1 заметки";
"notes_list_many" = "Найдено $1 заметок";
"notes_list_other" = "Найдено $1 заметок";
/* Menus */
"edit_button" = "ред.";
@ -502,7 +509,7 @@
"info_uploaded_by" = "Загрузил";
"info_upload_date" = "Дата загрузки";
"videos_zero" = "Ни одной видеозаписи";
"videos_zero" = "Нет видео";
"videos_one" = "Одна видеозапись";
"videos_few" = "$1 видеозаписи";
"videos_many" = "$1 видеозаписей";