- Добавлен тур по аудиозаписям, но пока без скриншотов.
- "Мои Аудиозаписи" в меню теперь располагаются под Моими Видеозаписями для канона
- В настройках приватности "кто может видеть мои аудиозаписи" теперь располагаются под "кто может видеть мои видеозаписи"
- В настройках внешнего вида мои аудиозаписи тоже под видео
- Изменён <title> на странице аудиозаписей. Теперь показывается "Аудиозаписи" + имя пользователя в родительном падеже. А если это группа, то "Аудиозаписи группы". То же самое с плейлистами
- Исправлены ссылка в ссылке на странице с плейлистами
- При наведении на название песни больше не сносится иконка explicit
- Добавлена максимальная длина названия и описания плейлиста при редактировании.
This commit is contained in:
lalka2018 2023-11-09 21:29:35 +03:00
parent bc29eb91e7
commit 11c563a7cd
17 changed files with 107 additions and 78 deletions

View file

@ -190,7 +190,7 @@ class User extends RowModel
function getMorphedName(string $case = "genitive", bool $fullName = true): string
{
$name = $fullName ? ($this->getLastName() . " " . $this->getFirstName()) : $this->getFirstName();
if(!preg_match("%^[А-яё\-]+$%", $name))
if(!preg_match("%[А-яё\-]+$%", $name))
return $name; # name is probably not russian
$inflected = inflectName($name, $case, $this->isFemale() ? Gender::FEMALE : Gender::MALE);

View file

@ -311,8 +311,8 @@ final class AudioPresenter extends OpenVKPresenter
$playlist = new Playlist;
$playlist->setOwner($owner);
$playlist->setName(substr($title, 0, 128));
$playlist->setDescription(substr($description, 0, 2048));
$playlist->setName(substr($title, 0, 125));
$playlist->setDescription(substr($description, 0, 2045));
if($_FILES["cover"]["error"] === UPLOAD_ERR_OK) {
if(!str_starts_with($_FILES["cover"]["type"], "image"))
@ -432,8 +432,8 @@ final class AudioPresenter extends OpenVKPresenter
if(empty($title) || iconv_strlen($title) < 1)
$this->flashFail("err", tr("error"), tr("set_playlist_name"));
$playlist->setName(ovk_proc_strtr($title, 128));
$playlist->setDescription(ovk_proc_strtr($description, 2048));
$playlist->setName(ovk_proc_strtr($title, 125));
$playlist->setDescription(ovk_proc_strtr($description, 2045));
$playlist->setEdited(time());
$playlist->resetLength();

View file

@ -184,8 +184,8 @@
</object>
</a>
<a n:if="$thisUser->getLeftMenuItemStatus('photos')" href="/albums{$thisUser->getId()}" class="link">{_my_photos}</a>
<a n:if="$thisUser->getLeftMenuItemStatus('audios')" href="/audios{$thisUser->getId()}" class="link">{_my_audios}</a>
<a n:if="$thisUser->getLeftMenuItemStatus('videos')" href="/videos{$thisUser->getId()}" class="link">{_my_videos}</a>
<a n:if="$thisUser->getLeftMenuItemStatus('audios')" href="/audios{$thisUser->getId()}" class="link">{_my_audios}</a>
<a n:if="$thisUser->getLeftMenuItemStatus('messages')" href="/im" class="link">{_my_messages}
<object type="internal/link" n:if="$thisUser->getUnreadMessagesCount() > 0">
(<b>{$thisUser->getUnreadMessagesCount()}</b>)

View file

@ -178,11 +178,29 @@
<h2>{_tour_section_6_title_1|noescape}</h2>
<ul class="listing">
<li><span>{_tour_section_6_text_1|noescape}</span></li>
<li><span>{_tour_section_6_text_1|noescape}</span></li>
<li><span>{_tour_section_6_text_2|noescape}</span></li>
<li><span>{_tour_section_6_text_3|noescape}</span></li>
<img src="assets/packages/static/openvk/img/tour/audios.png" width="440">
</ul>
<ul class="listing">
<li><span>{_tour_section_6_text_4|noescape}</span></li>
<img src="assets/packages/static/openvk/img/tour/audios_search.png" width="440">
<li><span>{_tour_section_6_text_5|noescape}</span></li>
<img src="assets/packages/static/openvk/img/tour/audios_upload.png" width="440">
</ul>
<p class="big">{_tour_section_6_bottom_text_1|noescape}</p>
<h2>{_tour_section_6_title_2|noescape}</h2>
<ul class="listing">
<li><span>{_tour_section_6_text_6|noescape}</span></li>
<li><span>{_tour_section_6_text_7|noescape}</span></li>
<img src="assets/packages/static/openvk/img/tour/audios_playlists.png" width="440">
</ul>
<br>
</div>

View file

@ -26,11 +26,11 @@
<div style="padding-left: 13px;width:75%">
<div class="playlistInfo">
<input value="{$playlist->getName()}" type="text" name="title">
<input value="{$playlist->getName()}" type="text" name="title" maxlength="125">
</div>
<div class="moreInfo">
<textarea name="description" style="margin-top: 11px;">{$playlist->getDescription()}</textarea>
<textarea name="description" maxlength="2045" style="margin-top: 11px;">{$playlist->getDescription()}</textarea>
</div>
</div>
</div>

View file

@ -2,13 +2,21 @@
{block title}
{if $mode == 'list'}
{_audios}
{if $ownerId > 0}
{_audios} {$owner->getMorphedName("genitive", false)}
{else}
{_audios_group}
{/if}
{elseif $mode == 'new'}
{_audio_new}
{elseif $mode == 'popular'}
{_audio_popular}
{else}
{_playlists}
{if $ownerId > 0}
{_playlists} {$owner->getMorphedName("genitive", false)}
{else}
{_playlists_group}
{/if}
{/if}
{/block}
@ -87,17 +95,18 @@
<div class="playlistCover">
<img src="{$playlist->getCoverURL()}">
</div>
<div class="playlistInfo">
<span style="font-size: 12px" class="playlistName">
{ovk_proc_strtr($playlist->getName(), 12)}
</span>
<span style="font-size: 12px" class="playlistAuthor">
<a href="{$playlist->getOwner()->getURL()}">{ovk_proc_strtr($playlist->getOwner()->getCanonicalName(), 20)}</a>
</span>
</div>
</a>
<div class="playlistInfo">
<a href="/playlist{$playlist->getPrettyId()}">
<span style="font-size: 12px" class="playlistName">
{ovk_proc_strtr($playlist->getName(), 15)}
</span>
</a>
<a href="{$playlist->getOwner()->getURL()}">{ovk_proc_strtr($playlist->getOwner()->getCanonicalName(), 20)}</a>
</div>
</div>
</div>

View file

@ -39,10 +39,10 @@
<div style="padding-left: 17px;width: 75%;" class="plinfo">
<div>
<input type="text" name="title" placeholder="{_title}" maxlength="128" />
<input type="text" name="title" placeholder="{_title}" maxlength="125" />
</div>
<div class="moreInfo" style="margin-top: 11px;">
<textarea placeholder="{_description}" name="description" maxlength="2048" />
<textarea placeholder="{_description}" name="description" maxlength="2045" />
</div>
</div>
</div>

View file

@ -51,11 +51,11 @@
<tbody>
<tr>
<td width="120" valign="top"><span class="nobold">{_audio_name}:</span></td>
<td><input type="text" name="name" autocomplete="off" /></td>
<td><input type="text" name="name" autocomplete="off" maxlength="80" /></td>
</tr>
<tr>
<td width="120" valign="top"><span class="nobold">{_performer}:</span></td>
<td><input name="performer" type="text" autocomplete="off" /></td>
<td><input name="performer" type="text" autocomplete="off" maxlength="80" /></td>
</tr>
<tr>
<td width="120" valign="top"><span class="nobold">{_genre}:</span></td>

View file

@ -14,10 +14,10 @@
<div class="mediaInfo" style="margin-bottom: -8px; cursor: pointer;display:flex;width: 85%;">
<div class="info noOverflow">
<strong class="performer">
<a href="/search?query=&type=audios&sort=id&only_performers=on&query={$audio->getPerformer()}">{ovk_proc_strtr($audio->getPerformer(), 50)}</a>
<a href="/search?query=&type=audios&sort=id&only_performers=on&query={$audio->getPerformer()}">{$audio->getPerformer()}</a>
</strong>
<span class="title {if !empty($audio->getLyrics())}withLyrics{/if}">{ovk_proc_strtr($audio->getTitle(), 50)}</span>
<span class="title {if !empty($audio->getLyrics())}withLyrics{/if}">{$audio->getTitle()}</span>
</div>
<div class="explicitMark" n:if="$audio->isExplicit()"></div>

View file

@ -323,6 +323,19 @@
</select>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_privacy_setting_view_audio}</span>
</td>
<td>
<select name="audios.read" style="width: 164px;">
<option value="3" {if $user->getPrivacySetting('audios.read') == 3}selected{/if}>{_privacy_value_anybody_dative}</option>
<option value="2" {if $user->getPrivacySetting('audios.read') == 2}selected{/if}>{_privacy_value_users}</option>
<option value="1" {if $user->getPrivacySetting('audios.read') == 1}selected{/if}>{_privacy_value_friends_dative}</option>
<option value="0" {if $user->getPrivacySetting('audios.read') == 0}selected{/if}>{_privacy_value_only_me_dative}</option>
</select>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_privacy_setting_see_notes}</span>
@ -384,19 +397,6 @@
</select>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">{_privacy_setting_view_audio}</span>
</td>
<td>
<select name="audios.read" style="width: 164px;">
<option value="3" {if $user->getPrivacySetting('audios.read') == 3}selected{/if}>{_privacy_value_anybody_dative}</option>
<option value="2" {if $user->getPrivacySetting('audios.read') == 2}selected{/if}>{_privacy_value_users}</option>
<option value="1" {if $user->getPrivacySetting('audios.read') == 1}selected{/if}>{_privacy_value_friends_dative}</option>
<option value="0" {if $user->getPrivacySetting('audios.read') == 0}selected{/if}>{_privacy_value_only_me_dative}</option>
</select>
</td>
</tr>
<tr>
<td>
@ -610,17 +610,6 @@
<td>
<span class="nobold">{_my_photos}</span>
</td>
</tr>
<tr>
<td width="120" valign="top" align="right">
<input
n:attr="checked => $user->getLeftMenuItemStatus('audios')"
type="checkbox"
name="menu_muziko" />
</td>
<td>
<span class="nobold">{_my_audios}</span>
</td>
</tr>
<tr>
<td width="120" valign="top" align="right">
@ -633,6 +622,17 @@
<span class="nobold">{_my_videos}</span>
</td>
</tr>
<tr>
<td width="120" valign="top" align="right">
<input
n:attr="checked => $user->getLeftMenuItemStatus('audios')"
type="checkbox"
name="menu_muziko" />
</td>
<td>
<span class="nobold">{_my_audios}</span>
</td>
</tr>
<tr>
<td width="120" valign="top" align="right">
<input

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View file

@ -671,11 +671,11 @@ document.addEventListener("DOMContentLoaded", function() {
const overfl = info.querySelector(".info")
if(e.originalEvent.type == "mouseleave" || e.originalEvent.type == "mouseout") {
overfl.classList.add("noOverflow")
overfl.classList.remove("overflowedName")
info.classList.add("noOverflow")
info.classList.remove("overflowedName")
} else {
overfl.classList.remove("noOverflow")
overfl.classList.add("overflowedName")
info.classList.remove("noOverflow")
info.classList.add("overflowedName")
}
})
})
@ -847,12 +847,12 @@ $(document).on("click", ".musicIcon.edit-icon", (e) => {
MessageBox(tr("edit_audio"), `
<div>
${tr("performer")}
<input name="performer" maxlength="40" type="text" value="${performer}">
<input name="performer" maxlength="256" type="text" value="${performer}">
</div>
<div style="margin-top: 11px">
${tr("audio_name")}
<input name="name" maxlength="40" type="text" value="${name}">
<input name="name" maxlength="256" type="text" value="${name}">
</div>
<div style="margin-top: 11px">

View file

@ -833,6 +833,8 @@
"broadcast_audio" = "Broadcast audio to status";
"sure_delete_playlist" = "Do you sure want to delete this playlist?";
"edit_audio" = "Edit audio";
"audios_group" = "Audios from group";
"playlists_group" = "Playlists from group";
/* Notifications */
@ -1755,17 +1757,16 @@
"tour_section_5_text_3" = "In addition to uploading videos directly, the site also supports embedding videos from YouTube";
"tour_section_6_title_1" = "Listen to audios";
"tour_section_6_text_1" = "Вы можете слушать аудиозаписи в разделе \"Мои Аудиозаписи\".";
"tour_section_6_text_2" = "Этот раздел также регулируется настройками приватности.";
"tour_section_6_text_3" = "Самые прослушиваемые песни находятся во вкладке \"Популярное\", а недавно загруженные — во вкладке \"Новое\"";
"tour_section_6_text_4" = "Найти нужную песню можно в поиске.";
"tour_section_6_text_5" = "Чтобы добавить песню в свою коллекцию, наведите на неё и нажмите на плюс.";
"tour_section_6_text_6" = "Если вы не можете найти нужную песню, вы можете загрузить её самостоятельно.";
"tour_section_6_bottom_text_1" = "<b>Важно:</b> песня не должна нарушать авторские права";
"tour_section_6_title_1" = "Создавайте плейлисты";
"tour_section_6_text_7" = "Вы можете создавать сборники треков во вкладке \"Мои плейлисты\".";
"tour_section_6_text_8" = "Можно также добавлять чужие плейлисты в свою коллекцию.";
"tour_section_6_title_1" = "Listen to music";
"tour_section_6_text_1" = "You can listen to music in \"My Audios\"";
"tour_section_6_text_2" = "This section is also controlled by the privacy settings.";
"tour_section_6_text_3" = "The most listened songs are in \"Popular\", and recently uploaded songs are in \"New\"";
"tour_section_6_text_4" = "To add a song to your collection, hover over it and click on the \"plus\". You can search for the song you want.";
"tour_section_6_text_5" = "If you can't find the song you want, you can upload it yourself";
"tour_section_6_bottom_text_1" = "<b>Important:</b> the song must not infringe copyright";
"tour_section_6_title_2" = "Create playlists";
"tour_section_6_text_6" = "You can create playlists in the \"My Playlists\" tab";
"tour_section_6_text_7" = "You can also add another's playlists to your collection";
"tour_section_7_title_1" = "Follow what your friends write";

View file

@ -788,6 +788,8 @@
"broadcast_audio" = "Транслировать аудио в статус";
"sure_delete_playlist" = "Вы действительно хотите удалить этот плейлист?";
"edit_audio" = "Редактировать аудиозапись";
"audios_group" = "Аудиозаписи группы";
"playlists_group" = "Плейлисты группы";
/* Notifications */
@ -1645,16 +1647,15 @@
"tour_section_6_title_1" = "Слушайте аудиозаписи";
"tour_section_6_text_1" = "Вы можете слушать аудиозаписи в разделе \"Мои Аудиозаписи\".";
"tour_section_6_text_2" = "Этот раздел также регулируется настройками приватности.";
"tour_section_6_text_1" = "Вы можете слушать аудиозаписи в разделе \"Мои Аудиозаписи\"";
"tour_section_6_text_2" = "Этот раздел также регулируется настройками приватности";
"tour_section_6_text_3" = "Самые прослушиваемые песни находятся во вкладке \"Популярное\", а недавно загруженные — во вкладке \"Новое\"";
"tour_section_6_text_4" = "Найти нужную песню можно в поиске.";
"tour_section_6_text_5" = "Чтобы добавить песню в свою коллекцию, наведите на неё и нажмите на плюс.";
"tour_section_6_text_6" = "Если вы не можете найти нужную песню, вы можете загрузить её самостоятельно.";
"tour_section_6_text_4" = "Чтобы добавить песню в свою коллекцию, наведите на неё и нажмите на плюс. Найти нужную песню можно в поиске";
"tour_section_6_text_5" = "Если вы не можете найти нужную песню, вы можете загрузить её самостоятельно";
"tour_section_6_bottom_text_1" = "<b>Важно:</b> песня не должна нарушать авторские права";
"tour_section_6_title_1" = "Создавайте плейлисты";
"tour_section_6_text_7" = "Вы можете создавать сборники треков во вкладке \"Мои плейлисты\".";
"tour_section_6_text_8" = "Можно также добавлять чужие плейлисты в свою коллекцию.";
"tour_section_6_title_2" = "Создавайте плейлисты";
"tour_section_6_text_6" = "Вы можете создавать сборники треков во вкладке \"Мои плейлисты\"";
"tour_section_6_text_7" = "Можно также добавлять чужие плейлисты в свою коллекцию";
"tour_section_7_title_1" = "Следите за тем, что пишут ваши друзья";