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

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

@ -32,7 +32,7 @@
{/block} {/block}
{block size} {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"> <div class="summary">
{if !is_null($thisUser) && $user->getId() === $thisUser->getId()} {if !is_null($thisUser) && $user->getId() === $thisUser->getId()}
{tr("groups_list", $thisUser->getClubCount())} {tr("groups_list", $thisUser->getClubCount())}
@ -72,19 +72,19 @@
{block actions} {block actions}
{var clubPinned = $thisUser->isClubPinned($x)} {var clubPinned = $thisUser->isClubPinned($x)}
{if $x->canBeModifiedBy($thisUser ?? NULL) && ($clubPinned || $thisUser->getPinnedClubCount() <= 10)} {if $x->canBeModifiedBy($thisUser ?? NULL)}
<a style="width: 140px;" class="profile_link" href="{$x->getURL()}"> <a style="border-bottom: none; width: 140px;" class="profile_link" href="{$x->getURL()}">
{_check_community} {_check_community}
</a> </a>
{if ($clubPinned || $thisUser->getPinnedClubCount() <= 10)}
<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()}"> <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} {if $clubPinned}
{_remove_from_left_menu} {_remove_from_left_menu}
{else} {else}
{_add_to_left_menu} {_add_to_left_menu}
{/if} {/if}
</a> </a>
{/if}
<form action="/setSub/club" method="post"> <form action="/setSub/club" method="post">
<input type="hidden" name="act" value="rem" /> <input type="hidden" name="act" value="rem" />
<input type="hidden" name="id" value="{$x->getId()}" /> <input type="hidden" name="id" value="{$x->getId()}" />
@ -116,3 +116,26 @@
</div> </div>
{/if} {/if}
{/block} {/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} {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

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

View file

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

@ -332,9 +332,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" = "Отредактировано";
@ -344,6 +345,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" = "ред.";
@ -510,7 +517,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 видеозаписей";