mirror of
https://github.com/openvk/openvk
synced 2025-07-07 08:19:49 +03:00
Compare commits
1 commit
1c8da7c5ae
...
7f2290b7f1
Author | SHA1 | Date | |
---|---|---|---|
|
7f2290b7f1 |
10 changed files with 7 additions and 87 deletions
|
@ -113,6 +113,7 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
"amount" => sizeof($this->template->posts),
|
"amount" => sizeof($this->template->posts),
|
||||||
"perPage" => OPENVK_DEFAULT_PER_PAGE,
|
"perPage" => OPENVK_DEFAULT_PER_PAGE,
|
||||||
];
|
];
|
||||||
|
$this->template->ignore_status = $owner->isIgnoredBy($this->user->identity);
|
||||||
|
|
||||||
|
|
||||||
$this->logPostsViewed($this->template->posts, $user);
|
$this->logPostsViewed($this->template->posts, $user);
|
||||||
|
@ -200,7 +201,6 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
foreach ($posts->page((int) ($_GET["p"] ?? 1), $perPage) as $post) {
|
foreach ($posts->page((int) ($_GET["p"] ?? 1), $perPage) as $post) {
|
||||||
$this->template->posts[] = $this->posts->get($post->id);
|
$this->template->posts[] = $this->posts->get($post->id);
|
||||||
}
|
}
|
||||||
$this->template->feedIgnoreButton = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderGlobalFeed(): void
|
public function renderGlobalFeed(): void
|
||||||
|
@ -241,7 +241,6 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
$this->template->posts[] = $this->posts->get($post->id);
|
$this->template->posts[] = $this->posts->get($post->id);
|
||||||
}
|
}
|
||||||
$this->template->feedIgnoreButton = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderHashtagFeed(string $hashtag): void
|
public function renderHashtagFeed(string $hashtag): void
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
|
|
||||||
<span n:if="$post->isPinned()" class="nobold">{_pinned}</span>
|
<span n:if="$post->isPinned()" class="nobold">{_pinned}</span>
|
||||||
|
|
||||||
<a n:if="$canBeDeleted && !($forceNoDeleteLink ?? false) && $compact == false" class="delete" href="/wall{$post->getPrettyId()}/delete"></a>
|
<a n:if="$canBeDeleted && !($forceNoDeleteLink ?? false) && $compact == false" class="delete" href="/wall{$post->getPrettyId()}/delete"></a>
|
||||||
<a n:if="$feedIgnoreButton && !$canBeDeleted" class="ignore" id="__ignoreSomeoneFeed" title="{_feed_ignore}" data-val='1' data-id="{$wallOwner->getRealId()}"></a>
|
<a n:if="!$canBeDeleted" class="ignore" id="__ignoreSomeone" title="{if !$ignore_status}{_ignore_user}{else}{_unignore_user}{/if}" data-val='{!$ignore_status ? 1 : 0}' data-id="{$wallOwner->getId()}"></a>
|
||||||
|
|
||||||
{if $canBePinned && !($forceNoPinLink ?? false) && $compact == false}
|
{if $canBePinned && !($forceNoPinLink ?? false) && $compact == false}
|
||||||
{if $post->isPinned()}
|
{if $post->isPinned()}
|
||||||
|
|
|
@ -135,8 +135,8 @@
|
||||||
<a href="/wall{$post->getPrettyId()}/delete">{_delete}</a> |
|
<a href="/wall{$post->getPrettyId()}/delete">{_delete}</a> |
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $feedIgnoreButton && !$canBeDeleted}
|
{if !$canBeDeleted}
|
||||||
<a id="__ignoreSomeoneFeed" data-val='1' data-id="{$wallOwner->getRealId()}">{_feed_ignore}</a> |
|
<a class="delete" id="__ignoreSomeone" data-val='{!$ignore_status ? 1 : 0}' data-id="{$wallOwner->getId()}">{if !$ignore_status}{_ignore_user}{else}{_unignore_user}{/if}</a> |
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if !($forceNoPinLink ?? false) && $canBePinned}
|
{if !($forceNoPinLink ?? false) && $canBePinned}
|
||||||
|
|
|
@ -914,15 +914,6 @@ h4 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ignore-message {
|
|
||||||
padding: 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.small-textarea {
|
.small-textarea {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,8 @@
|
||||||
height: 16px;
|
height: 16px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
background: url("/assets/packages/static/openvk/img/ignore.png") no-repeat 0 0;
|
background: url("/assets/packages/static/openvk/img/audios_controls.png") no-repeat 0 0;
|
||||||
|
background-position: -51px -67px;
|
||||||
opacity: 0.1;
|
opacity: 0.1;
|
||||||
transition-duration: 0.3s;
|
transition-duration: 0.3s;
|
||||||
}
|
}
|
||||||
|
@ -100,15 +101,6 @@
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ignore-message {
|
|
||||||
padding: 5px 0;
|
|
||||||
border-bottom: 1px #ddd solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-author .delete {
|
.post-author .delete {
|
||||||
float: right;
|
float: right;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 295 B |
|
@ -43,53 +43,6 @@ u(document).on("click", "#__ignoreSomeone", async (e) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
u(document).on("click", "#__ignoreSomeoneFeed", async (e) => {
|
|
||||||
e.preventDefault()
|
|
||||||
|
|
||||||
const TARGET = u(e.target)
|
|
||||||
const ENTITY_ID = Number(e.target.dataset.id)
|
|
||||||
const VAL = Number(e.target.dataset.val)
|
|
||||||
const ACT = VAL == 1 ? 'ignore' : 'unignore'
|
|
||||||
const METHOD_NAME = ACT == 'ignore' ? 'addBan' : 'deleteBan'
|
|
||||||
const PARAM_NAME = ENTITY_ID < 0 ? 'group_ids' : 'user_ids'
|
|
||||||
const ENTITY_NAME = ENTITY_ID < 0 ? 'club' : 'user'
|
|
||||||
const URL = `/method/newsfeed.${METHOD_NAME}?auth_mechanism=roaming&${PARAM_NAME}=${Math.abs(ENTITY_ID)}`
|
|
||||||
|
|
||||||
TARGET.closest('.post').addClass('lagged')
|
|
||||||
const REQ = await fetch(URL)
|
|
||||||
const RES = await REQ.json()
|
|
||||||
TARGET.closest('.post').removeClass('lagged')
|
|
||||||
|
|
||||||
if(RES.error_code) {
|
|
||||||
switch(RES.error_code) {
|
|
||||||
case -10:
|
|
||||||
fastError(';/')
|
|
||||||
break
|
|
||||||
case -50:
|
|
||||||
fastError(tr('ignored_sources_limit'))
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
fastError(res.error_msg)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if(RES.response == 1) {
|
|
||||||
if(ACT == 'unignore') {
|
|
||||||
TARGET.closest('.scroll_node').find('.post').removeClass('post-hidden');
|
|
||||||
TARGET.closest('.ignore-message').remove()
|
|
||||||
} else {
|
|
||||||
TARGET.closest('.post').addClass('post-hidden');
|
|
||||||
TARGET.closest('.scroll_node').append(`
|
|
||||||
<div class="ignore-message" width="100%">
|
|
||||||
${tr(`feed_${ENTITY_NAME}_ignored`)} <a id="__ignoreSomeoneFeed" data-val='0' data-id='${ENTITY_ID}' href="#">${tr('feed_unignore')}</a>
|
|
||||||
</div>
|
|
||||||
`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
u(document).on('click', '#__feed_settings_link', (e) => {
|
u(document).on('click', '#__feed_settings_link', (e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
|
|
|
@ -359,11 +359,6 @@
|
||||||
"subscriptions_one" = "$1 subscription";
|
"subscriptions_one" = "$1 subscription";
|
||||||
"subscriptions_other" = "$1 subscriptions";
|
"subscriptions_other" = "$1 subscriptions";
|
||||||
|
|
||||||
"feed_user_ignored" = "User will no longer appear in the feed.";
|
|
||||||
"feed_club_ignored" = "Club will no longer appear in the feed.";
|
|
||||||
"feed_unignore" = "Restore.";
|
|
||||||
"feed_ignore" = "Not interested";
|
|
||||||
|
|
||||||
/* Group */
|
/* Group */
|
||||||
|
|
||||||
"group" = "Group";
|
"group" = "Group";
|
||||||
|
|
|
@ -290,11 +290,6 @@
|
||||||
"change_geo_name" = "Изменить название точки";
|
"change_geo_name" = "Изменить название точки";
|
||||||
"change_geo_name_new" = "Новое название";
|
"change_geo_name_new" = "Новое название";
|
||||||
|
|
||||||
"feed_user_ignored" = "Пользователь больше не будет появляться в ленте.";
|
|
||||||
"feed_club_ignored" = "Группа больше не будет появляться в ленте.";
|
|
||||||
"feed_unignore" = "Вернуть.";
|
|
||||||
"feed_ignore" = "Не интересно";
|
|
||||||
|
|
||||||
/* Friends */
|
/* Friends */
|
||||||
|
|
||||||
"friends" = "Друзья";
|
"friends" = "Друзья";
|
||||||
|
|
|
@ -280,11 +280,6 @@
|
||||||
"change_geo_name" = "Змінити назву розташування";
|
"change_geo_name" = "Змінити назву розташування";
|
||||||
"change_geo_name_new" = "Нова назва";
|
"change_geo_name_new" = "Нова назва";
|
||||||
|
|
||||||
"feed_user_ignored" = "Користувач більше не з'являтиметься у стрічці.";
|
|
||||||
"feed_club_ignored" = "Спiльнота більше не з'являтиметься у стрічці.";
|
|
||||||
"feed_unignore" = "Повернути.";
|
|
||||||
"feed_ignore" = "Не цікаво";
|
|
||||||
|
|
||||||
/* Friends */
|
/* Friends */
|
||||||
|
|
||||||
"friends" = "Друзі";
|
"friends" = "Друзі";
|
||||||
|
|
Loading…
Reference in a new issue