Merge pull request #450 from openvk/similartovk

Similartovk
This commit is contained in:
KosFurler 2022-02-06 22:54:47 +03:00 committed by GitHub
commit 16d41a7be7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 196 additions and 81 deletions

View file

@ -9,58 +9,62 @@
{ifset size}
{include size, x => $dat}
{/ifset}
{ifset specpage}
{include specpage, x => $dat}
{else}
<div class="container_gray">
{var data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
<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}
{if sizeof($data) > 0}
<div class="content" n:foreach="$data as $dat">
<table>
<tbody>
<tr>
<td valign="top">
<a href="{include link, x => $dat}">
<b>
{include name, x => $dat}
</b>
{include preview, x => $dat}
</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}
</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}
{/ifset}
</div>
{/block}
{/block}

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

@ -32,7 +32,7 @@
{/block}
{block size}
<div n:if="!is_null($thisUser) && $user->getId() === $thisUser->getId()" style="padding-bottom: 0px; border-bottom: 0;" class="summaryBar">
<div style="padding-bottom: 0px;border-bottom: 0;" class="summaryBar">
<div class="summary">
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
{tr("groups_list", $thisUser->getClubCount())}
@ -72,19 +72,19 @@
{block actions}
{var clubPinned = $thisUser->isClubPinned($x)}
{if $x->canBeModifiedBy($thisUser ?? NULL) && ($clubPinned || $thisUser->getPinnedClubCount() <= 10)}
<a style="width: 140px;" class="profile_link" href="{$x->getURL()}">
{if $x->canBeModifiedBy($thisUser ?? NULL)}
<a style="border-bottom: none; width: 140px;" class="profile_link" href="{$x->getURL()}">
{_check_community}
</a>
<a style="width: 140px;" class="profile_link" href="/groups_pin?club={$x->getId()}&hash={rawurlencode($csrfToken)}" id="_pinGroup" data-group-name="{$x->getName()}" data-group-url="{$x->getUrl()}">
{if $clubPinned}
{_remove_from_left_menu}
{else}
{_add_to_left_menu}
{/if}
</a>
{if ($clubPinned || $thisUser->getPinnedClubCount() <= 10)}
<a style="border-bottom: none; width: 140px;" class="profile_link" href="/groups_pin?club={$x->getId()}&hash={rawurlencode($csrfToken)}" data-group-name="{$x->getName()}" data-group-url="{$x->getUrl()}">
{if $clubPinned}
{_remove_from_left_menu}
{else}
{_add_to_left_menu}
{/if}
</a>
{/if}
<form action="/setSub/club" method="post">
<input type="hidden" name="act" value="rem" />
<input type="hidden" name="id" value="{$x->getId()}" />
@ -116,3 +116,26 @@
</div>
{/if}
{/block}
{block bottom}
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
<div class="groups_options">
<div id="gp_container" style="width: 200px;margin-right: 40px;">
<h4>{_open_new_group}</h4>
<span>{_open_group_desc}</span>
<form action="/groups_create">
<button class="button">{_create_group}</button>
</form>
</div>
<div id="gp_container" style="width: 344px;">
<h4>{_search_group}</h4>
<span>{_search_group_desc}</span>
<form action="/search">
<input name="type" type="hidden" value="groups">
<input name="query" class="header_search_input" value="" style="background: none;width: 155px;padding-left: 3px;">
<button class="button">{_search_by_groups}</button>
</form>
</div>
</div>
{/if}
{/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

@ -1866,6 +1866,17 @@ body.scrolled .toTop:hover {
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;
}
.border-block {
box-shadow: inset 0px 0 0px 1px #b6bfca, inset 0px 0 0px 10px #d8dfe7;
width: 300px;
@ -1874,4 +1885,4 @@ body.scrolled .toTop:hover {
.center {
margin: 0 auto;
}
}

View file

@ -323,6 +323,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

@ -332,9 +332,10 @@
"note" = "Заметка";
"name_note" = "Название";
"text_note" = "Содержание";
"create_note" = "Создать заметку";
"create_note" = "Добавить запись";
"edit_note" = "Редактировать заметку";
"actions" = "Действия";
"notes_start_screen" = "С помощью заметок Вы можете делиться событиями из жизни с друзьями, а так же быть в курсе того, что происходит у них.";
"edited" = "Отредактировано";
@ -344,6 +345,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" = "ред.";
@ -510,7 +517,7 @@
"info_uploaded_by" = "Загрузил";
"info_upload_date" = "Дата загрузки";
"videos_zero" = "Ни одной видеозаписи";
"videos_zero" = "Нет видео";
"videos_one" = "Одна видеозапись";
"videos_few" = "$1 видеозаписи";
"videos_many" = "$1 видеозаписей";