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

View file

@ -5,12 +5,25 @@
{block title}{_notes}{/block} {block title}{_notes}{/block}
{block header} {block header}
<a href="{$owner->getURL()}">{$owner->getCanonicalName()}</a> {if isset($thisUser) && $thisUser->getId() == $owner->getId()}
» {_my_notes}
{_notes} {else}
<a href="{$owner->getURL()}">
<div n:if="isset($thisUser) && $thisUser->getId() == $owner->getId()" style="float:right;"> {$owner->getCanonicalName()}</a>
<a href="/notes/create">{_create_note}</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> </div>
{/block} {/block}
@ -20,18 +33,66 @@
{* BEGIN ELEMENTS DESCRIPTION *} {* BEGIN ELEMENTS DESCRIPTION *}
{block link|strip|stripHtml} {block specpage}
/note{$x->getPrettyId()} <div class="container_gray" style="background: white; border-top: none;">
{/block}
{block preview} {var data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
<center><img src="/assets/packages/static/openvk/img/note_icon.png" alt="{_note}" style="margin-top: 17px;" /></center> {if sizeof($data) > 0}
{/block}
{block name} <div n:foreach="$data as $dat">
{$x->getName()} <div class="profile_thumb">
{/block} <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} {if sizeof($dat->getCommentsCount()) > 0}
{$x->getPreview(250)} {_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} {/block}

View file

@ -8,9 +8,17 @@
{block header} {block header}
<a href="{$user->getURL()}">{$user->getCanonicalName()}</a> <a href="{$user->getURL()}">{$user->getCanonicalName()}</a>
» {_"videos"} » {_"videos"}
{/block}
<div n:if="isset($thisUser) && $thisUser->getId() == $user->getId()" style="float: right;">
<a href="/videos/upload">{_"upload_video"}</a> {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> </div>
{/block} {/block}

View file

@ -1864,4 +1864,15 @@ body.scrolled .toTop:hover {
.group_info .label { .group_info .label {
width: auto !important; width: auto !important;
padding-right: 5px; 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_zero" = "No notes";
"notes_one" = "$1 note"; "notes_one" = "$1 note";
"notes_other" = "$1 notes"; "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 */ /* Menus */

View file

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