mirror of
https://github.com/openvk/openvk
synced 2024-11-15 03:31:18 +03:00
Merge cff7048261
into fab39bd7fd
This commit is contained in:
commit
f05b993947
28 changed files with 120 additions and 89 deletions
|
@ -544,6 +544,9 @@ final class UserPresenter extends OpenVKPresenter
|
|||
|
||||
if(in_array($this->postParam("main_page"), [0, 1]))
|
||||
$user->setMain_Page((int) $this->postParam("main_page"));
|
||||
|
||||
if(in_array($this->postParam("paginator"), [0, 1]))
|
||||
$user->setPaginator_type((int) $this->postParam("paginator"));
|
||||
} else if($_GET['act'] === "lMenu") {
|
||||
$settings = [
|
||||
"menu_bildoj" => "photos",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{ifset specpage}
|
||||
{include specpage, x => $dat}
|
||||
{else}
|
||||
<div class="container_gray">
|
||||
<div class="container_gray infContainer">
|
||||
{var $data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
|
||||
|
||||
{ifset top}
|
||||
|
@ -27,7 +27,7 @@
|
|||
{/ifset}
|
||||
|
||||
{if sizeof($data) > 0}
|
||||
<div class="content" n:foreach="$data as $dat">
|
||||
<div class="content infObj" n:foreach="$data as $dat">
|
||||
<table>
|
||||
<tbody n:attr="id => is_null($table_body_id) ? NULL : $table_body_id">
|
||||
<tr>
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
</div>
|
||||
|
||||
{if sizeof($corresps) > 0}
|
||||
<div class="crp-list">
|
||||
<div class="crp-list infContainer">
|
||||
<div n:foreach="$corresps as $coresp"
|
||||
class="crp-entry"
|
||||
class="crp-entry infObj"
|
||||
onmousedown="window.location.href = {$coresp->getURL()};" >
|
||||
{var $recipient = $coresp->getCorrespondents()[1]}
|
||||
{var $lastMsg = $coresp->getPreviewMessage()}
|
||||
|
|
|
@ -60,12 +60,12 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<div class="container_gray" style="background: white; border-top: none;">
|
||||
<div class="container_gray infContainer" style="background: white; border-top: none;">
|
||||
|
||||
{var $data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
|
||||
{if sizeof($data) > 0}
|
||||
|
||||
<div n:foreach="$data as $dat">
|
||||
<div n:foreach="$data as $dat" class="infObj">
|
||||
<div class="profile_thumb">
|
||||
<a href="{$owner->getURL()}">
|
||||
<img src="{$owner->getAvatarUrl('miniscule')}" style="width: 50px;">
|
||||
|
@ -107,6 +107,14 @@
|
|||
</article>
|
||||
</div>
|
||||
|
||||
{include "../components/paginator.xml", conf => (object) [
|
||||
"page" => $page,
|
||||
"count" => $count,
|
||||
"amount" => sizeof($data),
|
||||
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
|
||||
"atBottom" => true,
|
||||
]}
|
||||
|
||||
{else}
|
||||
{if isset($thisUser) && $thisUser->getId() == $owner->getId()}
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
page => $cPage,
|
||||
model => "notes",
|
||||
parent => $note,
|
||||
showTitle => false}
|
||||
showTitle => false,
|
||||
fromPost => true}
|
||||
</div>
|
||||
{/block}
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
{/if}
|
||||
<br/><br/>
|
||||
{if $album->getPhotosCount() > 0}
|
||||
<div class="container_gray album-flex">
|
||||
<div class="container_gray album-flex infContainer">
|
||||
{foreach $photos as $photo}
|
||||
{php if($photo->isDeleted()) continue; }
|
||||
<div class="album-photo">
|
||||
<div class="album-photo infObj">
|
||||
<a
|
||||
n:if="!is_null($thisUser) && $album->canBeModifiedBy($thisUser)"
|
||||
href="/album{$album->getPrettyId()}/remove_photo/{$photo->getId()}" class="album-photo--delete">
|
||||
|
|
|
@ -122,62 +122,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script n:if='$count > 0 && !empty($query)'>
|
||||
highlightText({$query}, '.page_wrap_content_main', ['text'])
|
||||
</script>
|
||||
{elseif $section === 'groups'}
|
||||
<div class='search_content content def_row_content' n:foreach="$data as $dat">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<a href="{$dat->getURL()}">
|
||||
<img src="{$dat->getAvatarUrl('tiny')}" width="75" alt="{_photo}" loading='lazy' />
|
||||
</a>
|
||||
</td>
|
||||
<td valign="top" style="width: 100%">
|
||||
<a href="{$dat->getURL()}">
|
||||
<b>
|
||||
<text style="overflow: hidden;"> {$dat->getCanonicalName()}
|
||||
{if $order == "id"}
|
||||
(id{$dat->getId()})
|
||||
{/if}
|
||||
</text>
|
||||
<img n:if="$dat->isVerified()"
|
||||
class="name-checkmark"
|
||||
src="/assets/packages/static/openvk/img/checkmark.png"
|
||||
/>
|
||||
</b>
|
||||
</a>
|
||||
|
||||
<table class="ugc-table">
|
||||
<tbody>
|
||||
{if !empty($dat->getDescription())}
|
||||
<tr>
|
||||
<td>
|
||||
<span class="nobold">{_description}:</span>
|
||||
</td>
|
||||
<td data-highlight='_clubDesc'>
|
||||
{$dat->getDescription() ?? '(' . tr("none") . ')'}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<td>
|
||||
<span class="nobold">{_size}:</span>
|
||||
</td>
|
||||
<td>
|
||||
{tr("participants", $dat->getFollowersCount())}
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div
|
||||
|
||||
<script n:if='$count > 0 && !empty($query)'>
|
||||
highlightText({$query}, '.page_wrap_content_main', ['text', "td[data-highlight='_clubDesc']"])
|
||||
|
|
|
@ -57,7 +57,8 @@
|
|||
{/if}
|
||||
|
||||
{if $isList}
|
||||
<table n:foreach="$tickets as $ticket" border="0" style="font-size: 11px; width: 610px;" class="post">
|
||||
<div class="infContainer">
|
||||
<table n:foreach="$tickets as $ticket" border="0" style="font-size: 11px; width: 610px;" class="post infObj">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="54" valign="top">
|
||||
|
@ -78,6 +79,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{if $count < 1}
|
||||
{include "../components/nothing.xml"}
|
||||
|
|
|
@ -584,6 +584,17 @@
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_ui_settings_paginator}</span>
|
||||
</td>
|
||||
<td>
|
||||
<select name="paginator">
|
||||
<option value="0" {if $user->getPaginatorType() == 0}selected{/if}>{_ui_settings_paginator_old}</option>
|
||||
<option value="1" {if $user->getPaginatorType() == 1}selected{/if}>{_ui_settings_paginator_new}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top" align="right">
|
||||
<input type="checkbox" name="theme_for_session" value="1">
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
count => $cCount,
|
||||
page => $cPage,
|
||||
model => "videos",
|
||||
parent => $video}
|
||||
parent => $video,
|
||||
fromPost => true}
|
||||
</div>
|
||||
<div style="float: left; min-height: 100px; width: 30%; overflow: hidden; overflow-wrap: break-word;">
|
||||
<div>
|
||||
|
|
|
@ -21,12 +21,16 @@
|
|||
{include "../components/textArea.xml", route => "/wall" . $thisUser->getId() . "/makePost", graffiti => true, polls => true, notes => true, hasSource => true}
|
||||
</div>
|
||||
|
||||
<div class="infContainer">
|
||||
{foreach $posts as $post}
|
||||
<div class="infObj">
|
||||
<a name="postGarter={$post->getId()}"></a>
|
||||
{include "../components/post.xml", post => $post, onWallOf => true, commentSection => true}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
<div class="postFeedBottom">
|
||||
<div class="postFeedBottom" n:if="$thisUser->getPaginatorType() == 0">
|
||||
<div class="postFeedPaginator">
|
||||
{include "../components/paginator.xml", conf => $paginatorConf}
|
||||
</div>
|
||||
|
@ -45,7 +49,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
{if $thisUser->getPaginatorType() == 1}
|
||||
{include "../components/paginator.xml", conf => $paginatorConf}
|
||||
{/if}
|
||||
|
||||
<script n:if="$thisUser->getPaginatorType() == 0">
|
||||
u("#pageSelect").nodes[0].value = {$paginatorConf->perPage};
|
||||
|
||||
u("#pageSelect").on("change", function(e) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{/block}
|
||||
|
||||
{block content}
|
||||
<center>
|
||||
<center class="infContainer">
|
||||
{foreach $posts as $post}
|
||||
<a name="postGarter={$post->getId()}"></a>
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@
|
|||
count => $cCount,
|
||||
page => $cPage,
|
||||
model => "posts",
|
||||
parent => $post }
|
||||
parent => $post,
|
||||
fromPost => true }
|
||||
</div>
|
||||
<div style="float: left; min-height: 100px; width: 32%;">
|
||||
<h4>{_actions}</h4>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
{include "../components/textArea.xml", route => "/wall$owner/makePost", hasSource => true}
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="content infContainer">
|
||||
{if sizeof($posts) > 0}
|
||||
{foreach $posts as $post}
|
||||
<a name="postGarter={$post->getId()}"></a>
|
||||
|
|
|
@ -8,15 +8,19 @@
|
|||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="infContainer">
|
||||
{if sizeof($comments) > 0}
|
||||
<div class="{if ($fromPost ?? false)}infObj{/if}">
|
||||
{foreach $comments as $comment}
|
||||
{include "comment.xml", comment => $comment}
|
||||
{/foreach}
|
||||
</div>
|
||||
<div style="margin-top: 11px;">
|
||||
{include "paginator.xml", conf => (object) ["page" => $page, "count" => $count, "amount" => sizeof($comments), "perPage" => 10]}
|
||||
</div>
|
||||
{else}
|
||||
{_comments_tip}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{script "js/al_comments.js"}
|
||||
|
|
5
Web/Presenters/templates/components/paginators/new.xml
Normal file
5
Web/Presenters/templates/components/paginators/new.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
{var $pageCount = ceil($conf->count / $conf->perPage)}
|
||||
|
||||
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage) && $conf->page < $pageCount" class="showMore" data-pageсount="{$pageCount}" data-page="{$conf->page}">
|
||||
{_show_more}
|
||||
</div>
|
12
Web/Presenters/templates/components/paginators/old.xml
Normal file
12
Web/Presenters/templates/components/paginators/old.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
{var $space = 3}
|
||||
{var $pageCount = ceil($conf->count / $conf->perPage)}
|
||||
|
||||
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage)" style="padding: 8px;">
|
||||
<div n:class="paginator, ($conf->atBottom ?? false) ? paginator-at-bottom">
|
||||
<a n:if="$conf->page > $space" n:attr="class => ($conf->page === 1 ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => 1]), 'k', '&', PHP_QUERY_RFC3986)}">«</a>
|
||||
{for $j = $conf->page - ($space-1); $j <= $conf->page + ($space-1); $j++}
|
||||
<a n:if="$j > 0 && $j <= $pageCount" n:attr="class => ($conf->page === $j ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => $j]), 'k', '&', PHP_QUERY_RFC3986)}">{$j}</a>
|
||||
{/for}
|
||||
<a n:if="$conf->page <= $pageCount-$space" n:attr="class => ($conf->page === $pageCount ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => $pageCount]), 'k', '&', PHP_QUERY_RFC3986)}">»</a>
|
||||
</div>
|
||||
</div>
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<div id="write" style="padding: 5px 0;" onfocusin="expand_wall_textarea({$textAreaId});">
|
||||
<form action="{$route}" method="post" enctype="multipart/form-data" style="margin:0;">
|
||||
<textarea id="wall-post-input{$textAreaId}" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea>
|
||||
<textarea id="wall-post-input{$textAreaId}" data-id="{$textAreaId}" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea>
|
||||
<div>
|
||||
<!-- padding to fix <br/> bug -->
|
||||
</div>
|
||||
|
|
|
@ -13,12 +13,14 @@
|
|||
{include "../components/textArea.xml", route => "/wall$owner/makePost", graffiti => true, polls => true, notes => true, hasSource => true}
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="content infContainer">
|
||||
{if sizeof($posts) > 0}
|
||||
{foreach $posts as $post}
|
||||
<div class="infObj">
|
||||
<a name="postGarter={$post->getId()}"></a>
|
||||
|
||||
{include "../components/post.xml", post => $post, commentSection => true}
|
||||
</div>
|
||||
{/foreach}
|
||||
{include "../components/paginator.xml", conf => $paginatorConf}
|
||||
{else}
|
||||
|
|
|
@ -2531,7 +2531,6 @@ a.poll-retract-vote {
|
|||
background-image: url(/assets/packages/static/openvk/img/videoico.png);
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Da search */
|
||||
|
||||
/* Header part */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
u(".comment-reply").on("click", function(e) {
|
||||
$(document).on("click", ".comment-reply", function(e) {
|
||||
let comment = u(e.target).closest(".post");
|
||||
let authorId = comment.data("owner-id");
|
||||
let authorNm = u(".post-author > a > b", comment.first()).text().trim();
|
||||
|
|
|
@ -19,6 +19,8 @@ var tooltipTemplate = Handlebars.compile(`
|
|||
</table>
|
||||
`);
|
||||
|
||||
function initMentions() {
|
||||
|
||||
tippy(".mention", {
|
||||
theme: "light vk",
|
||||
content: "⌛",
|
||||
|
@ -40,3 +42,6 @@ tippy(".mention", {
|
|||
that.setContent(tooltipTemplate(res));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initMentions()
|
||||
|
|
|
@ -378,7 +378,7 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") {
|
|||
return u(".ovk-photo-view-dimmer");
|
||||
}
|
||||
|
||||
u("#write > form").on("keydown", function(event) {
|
||||
$(document).on("keydown", "#write > form", function(event) {
|
||||
if(event.ctrlKey && event.keyCode === 13)
|
||||
this.submit();
|
||||
});
|
||||
|
@ -412,6 +412,8 @@ var tooltipClientNoInfoTemplate = Handlebars.compile(`
|
|||
</table>
|
||||
`);
|
||||
|
||||
function initTooltips() {
|
||||
|
||||
tippy(".client_app", {
|
||||
theme: "light vk",
|
||||
content: "⌛",
|
||||
|
@ -449,6 +451,10 @@ tippy(".client_app", {
|
|||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
initTooltips()
|
||||
|
||||
function addNote(textareaId, nid)
|
||||
{
|
||||
if(nid > 0) {
|
||||
|
|
|
@ -90,7 +90,7 @@ document.addEventListener("DOMContentLoaded", function() { //BEGIN
|
|||
});
|
||||
/* @rem-pai why this func wasn't named as "#_deleteDialog"? It looks universal IMO */
|
||||
|
||||
u("#_noteDelete").on("click", function(e) {
|
||||
$(document).on("click", "#_noteDelete", function(e) {
|
||||
var formHtml = "<form id='tmpPhDelF' action='" + u(this).attr("href") + "' >";
|
||||
formHtml += "<input type='hidden' name='hash' value='" + u("meta[name=csrf]").attr("value") + "' />";
|
||||
formHtml += "</form>";
|
||||
|
@ -111,7 +111,7 @@ document.addEventListener("DOMContentLoaded", function() { //BEGIN
|
|||
return e.preventDefault();
|
||||
});
|
||||
|
||||
u("#_pinGroup").on("click", async function(e) {
|
||||
$(document).on("click", "#_pinGroup", async function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let link = u(this).attr("href");
|
||||
|
|
1
install/sqls/000XX-better-paginator.sql
Normal file
1
install/sqls/000XX-better-paginator.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `profiles` ADD `paginator_type` TINYINT(1) NOT NULL DEFAULT '0' AFTER `client_name`;
|
|
@ -711,6 +711,10 @@
|
|||
"ui_settings_view_of_posts_old" = "Old";
|
||||
"ui_settings_view_of_posts_microblog" = "Microblog";
|
||||
"ui_settings_main_page" = "Main page";
|
||||
"ui_settings_paginator" = "Paginator";
|
||||
"ui_settings_paginator_old" = "Old (pages)";
|
||||
"ui_settings_paginator_new" = "New (infinite scroll)";
|
||||
|
||||
"ui_settings_sessions" = "Sessions";
|
||||
|
||||
"additional_links" = "Additional links";
|
||||
|
@ -1720,6 +1724,11 @@
|
|||
"paginator_page" = "Page $1";
|
||||
"paginator_next" = "Next";
|
||||
|
||||
/* Paginator (new) */
|
||||
|
||||
"show_more" = "show more";
|
||||
"error_loading_objects" = "Error when loading new objects. Try to reload page";
|
||||
|
||||
/* About */
|
||||
|
||||
"about_openvk" = "About OpenVK";
|
||||
|
|
|
@ -681,6 +681,9 @@
|
|||
"ui_settings_view_of_posts_old" = "Старый";
|
||||
"ui_settings_view_of_posts_microblog" = "Микроблог";
|
||||
"ui_settings_main_page" = "Главная страница";
|
||||
"ui_settings_paginator" = "Пагинатор";
|
||||
"ui_settings_paginator_old" = "Старый (постраничный)";
|
||||
"ui_settings_paginator_new" = "Новый (бесконечная прокрутка)";
|
||||
"ui_settings_sessions" = "Сессии";
|
||||
"additional_links" = "Дополнительные ссылки";
|
||||
"ad_poster" = "Рекламный плакат";
|
||||
|
@ -1608,6 +1611,11 @@
|
|||
"paginator_page" = "Страница $1";
|
||||
"paginator_next" = "Дальше";
|
||||
|
||||
/* Paginator (new) */
|
||||
|
||||
"show_more" = "показать больше";
|
||||
"error_loading_objects" = "Не удалось загрузить новые объекты. Попробуйте обновить страницу";
|
||||
|
||||
/* About */
|
||||
|
||||
"about_openvk" = "Об OpenVK";
|
||||
|
|
Loading…
Reference in a new issue